Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002472 [JEDI VCL] 00 JVCL Components tweak always 2005-01-04 11:49 2005-01-04 15:33
Reporter Simes View Status public  
Assigned To
Priority normal Resolution fixed  
Status resolved   Product Version 3.00 BETA 2
Summary 0002472: TJvEditor doesn't invoke OnChange event for final undo
Description When undoing changes made to an instance of TJvEditor, undoing the final (or only) change doesn't invoke the OnChange or OnStatusChange events. This means, for example, that an editor caption may still have the "*" signifying the buffer has been changed, after all changes have been removed.
Additional Information Suggested change to file JvEditorCommon.pas (changes marked with //sda):

procedure TJvUndoBuffer.Undo;
  UndoClass: TClass;
  Compound: Integer;
  IsOnlyCaret: Boolean;
  Selection: TJvSelectionRec;

   function IsIntf(AInstance: TObject; IID: TGUID): Boolean; overload;
     Result := (AInstance <> nil) and (AInstance.GetInterfaceEntry(IID) <> nil);

   function IsIntf(AClass: TClass; IID: TGUID): Boolean; overload;
     Result := (AClass <> nil) and (AClass.GetInterfaceEntry(IID) <> nil);

var //sda
  WasModified: boolean; //sda
  if InUndo then

  Selection := FJvEditor.FSelection;
  WasModified := FJvEditor.Modified; //sda

  IsOnlyCaret := True;
  InUndo := True;
    if LastUndo <> nil then
      Compound := 0;
      UndoClass := LastUndo.ClassType;
      while (LastUndo <> nil) and
        ((UndoClass = LastUndo.ClassType) or
        {(LastUndo is TJvDeleteTrailUndo) or
        (LastUndo is TJvReLineUndo) or}
        IsIntf(LastUndo, IJvUndoCompound) or
        (Compound > 0)) or
        {((UndoClass = TJvBackspaceUndo) and
        (LastUndo is TJvBackspaceUnindentUndo)) do}
        IsIntf(UndoClass, IJvBackspaceUndo) and
        IsIntf(LastUndo, IJvBackspaceUnindentUndo) do
        if LastUndo.ClassType = TJvBeginCompoundUndo then
          UndoClass := nil;
        if LastUndo.ClassType = TJvEndCompoundUndo then
        if LastUndo <> nil then
          FJvEditor.Modified := LastUndo.FModified;
        {if (UndoClass = TJvDeleteTrailUndo) or
          (UndoClass = TJvReLineUndo) then}
        if IsIntf(UndoClass, IJvUndoCompound) then
          UndoClass := LastUndo.ClassType;
        if (UndoClass <> TJvCaretUndo) and
          (UndoClass <> TJvSelectUndo) and
          (UndoClass <> TJvUnselectUndo) then
          IsOnlyCaret := False;
        if not FJvEditor.GroupUndo then
      if not FJvEditor.Modified then
        IsOnlyCaret := True;

      // paint selection
      if not CompareMem(@Selection, @FJvEditor.FSelection, SizeOf(TJvSelectionRec)) then

      if FJvEditor.FUpdateLock = 0 then
        if not IsOnlyCaret then
        else if WasModified then //sda
          FJvEditor.StatusChanged; //sda
    InUndo := False;
Tags No tags attached.
Attached Files

- Relationships

-  Notes
AHUser (developer)
2005-01-04 15:33


Fixed in CVS.

- Issue History
Date Modified Username Field Change
2005-01-04 11:49 Simes New Issue
2005-01-04 15:33 AHUser Status new => resolved
2005-01-04 15:33 AHUser Resolution open => fixed
2005-01-04 15:33 AHUser Assigned To => AHUser
2005-01-04 15:33 AHUser Note Added: 0006090
2005-01-04 15:33 AHUser Assigned To AHUser =>

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker