View Issue Details

IDProjectCategoryView StatusLast Update
0002472JEDI VCL00 JVCL Componentspublic2005-01-04 15:33
ReporterSimesAssigned To 
Status resolvedResolutionfixed 
Product Version3.00 BETA 2 
Target VersionFixed in Version3.00 RC 1 
Summary0002472: TJvEditor doesn't invoke OnChange event for final undo
DescriptionWhen 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 InformationSuggested 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;
TagsNo tags attached.



2005-01-04 15:33

developer   ~0006090


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 =>