View Issue Details

IDProjectCategoryView StatusLast Update
0037207PatchesIDEpublic2020-06-30 21:15
ReporterSven Barth Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionreopened 
Platformx86_64OSWindows NT 
Product Version2.1 (SVN) 
Summary0037207: Object Inspector does not respect absence of paRevertable of property editor
DescriptionWhen setting a new value in the Object Inspector it always also creates an undo item even if the property editor of the selected property does not specify the paRevertable value in its GetAttributes (normally it is set, because TPropertyEditor sets it).
Steps To Reproduce- Install the attached package
- Place a TTestClass on a form
- Change the NonRevertableProp to something else
(- If not using docked form editor: select the TTestClass component on the form, otherwise the undo actions of the source editor are used)
- Use Ctrl+Z to undo the change <- this should not have been possible

Solution:
- apply attached patch to Lazarus
- repeat above steps
- Use Ctrl+Z to undo the change <- will not undo the change, but will undo whatever was the previous undo item
Additional InformationThe attached patch fixes the above mentioned problem.

It might however be confusing if the IDE executes the previous undo item (e.g. if the previous action was to place the component on the form the component will be removed again), so maybe a kind of NOP undo item should be added, that does nothing when directly executed, but gets replaced by the next undo item?
TagsNo tags attached.
Fixed in Revisionr63437
LazTarget-
Widgetset
Attached Files

Activities

Sven Barth

2020-06-12 22:14

manager  

testpkg.zip (1,502 bytes)
propedit-revertable.patch (820 bytes)   
Index: components/ideintf/objectinspector.pp
===================================================================
--- components/ideintf/objectinspector.pp	(revision 63342)
+++ components/ideintf/objectinspector.pp	(working copy)
@@ -1580,7 +1580,7 @@
   isExcept := false;
   Editor:=CurRow.Editor;
   prpInfo := nil;
-  if CompEditDsg<>nil then begin
+  if (CompEditDsg<>nil) and (paRevertable in Editor.GetAttributes) then begin
     SetLength(OldUndoValues, Editor.PropCount);
     prpInfo := Editor.GetPropInfo;
     if prpInfo<>nil then
@@ -1611,7 +1611,7 @@
     end;
 
     // add Undo action
-    if (not isExcept) and (CompEditDsg<>nil) then
+    if (not isExcept) and (CompEditDsg<>nil) and (paRevertable in Editor.GetAttributes) then
     begin
       for i := 0 to Editor.PropCount - 1 do
       begin
propedit-revertable.patch (820 bytes)   

Juha Manninen

2020-06-24 12:08

developer   ~0123551

Applied, thanks.

Sven Barth

2020-06-27 17:01

manager   ~0123628

Thank you for applying!

But can it be that the commit message is incorrect? You wrote:

IdeIntf: Do not undo paRevertable property editor in Object Inspector. Issue 0037207, patch from Sven Barth.

Shouldn't it be something like:

IdeIntf: Do not undo property editor without paRevertable in Object Inspector. Issue 0037207, patch from Sven Barth.

After all paRevertable is set by default and only without it undo should not be possible. ;)

Note: I don't know whether editing commit messages is enabled for the Lazarus repo. It is for the FPC repo.

Bart Broersma

2020-06-27 22:37

developer   ~0123637

> Note: I don't know whether editing commit messages is enabled for the Lazarus repo. It is for the FPC repo.
It is.

Juha Manninen

2020-06-28 10:52

developer   ~0123646

Oops yes. I must figure out how to change the message with Subversion client. I use git-svn link for my normal development and my Subversion knowledge is limited.

Bart Broersma

2020-06-28 16:12

developer   ~0123651

Last edited: 2020-06-28 16:13

View 2 revisions

@Juha
svn propset -r N --revprop svn:log "new log message" URL
 or
svn propset -r N --revprop svn:log --file messagefilename URL

N would be the number of the revison.
You can skip the URL if you do this form with the lazarus folder (which is under svn control)

Juha Manninen

2020-06-30 11:54

developer   ~0123678

$ svn propset -r 63437 --revprop svn:log "IdeIntf: Do not undo property editor without paRevertable in Object Inspector. Issue 0037207, patch from Sven Barth."

and it looks I succeeded. Got: "property 'svn:log' set on repository revision 63437"
Please check.

Sven Barth

2020-06-30 16:10

manager   ~0123682

Looks good. :) You may resolve again. Thank you!

Juha Manninen

2020-06-30 18:19

developer   ~0123686

Resolving ... :)

Sven Barth

2020-06-30 21:15

manager   ~0123687

And closing. :D

Issue History

Date Modified Username Field Change
2020-06-12 22:14 Sven Barth New Issue
2020-06-12 22:14 Sven Barth File Added: testpkg.zip
2020-06-12 22:14 Sven Barth File Added: propedit-revertable.patch
2020-06-24 12:08 Juha Manninen Assigned To => Juha Manninen
2020-06-24 12:08 Juha Manninen Status new => assigned
2020-06-24 12:08 Juha Manninen Status assigned => resolved
2020-06-24 12:08 Juha Manninen Resolution open => fixed
2020-06-24 12:08 Juha Manninen Fixed in Revision => r63437
2020-06-24 12:08 Juha Manninen LazTarget => -
2020-06-24 12:08 Juha Manninen Note Added: 0123551
2020-06-27 17:01 Sven Barth Status resolved => assigned
2020-06-27 17:01 Sven Barth Resolution fixed => reopened
2020-06-27 17:01 Sven Barth Note Added: 0123628
2020-06-27 22:37 Bart Broersma Note Added: 0123637
2020-06-28 10:52 Juha Manninen Note Added: 0123646
2020-06-28 16:12 Bart Broersma Note Added: 0123651
2020-06-28 16:13 Bart Broersma Note Edited: 0123651 View Revisions
2020-06-30 11:54 Juha Manninen Note Added: 0123678
2020-06-30 11:54 Juha Manninen Status assigned => feedback
2020-06-30 16:10 Sven Barth Note Added: 0123682
2020-06-30 16:10 Sven Barth Status feedback => assigned
2020-06-30 18:19 Juha Manninen Status assigned => resolved
2020-06-30 18:19 Juha Manninen Note Added: 0123686
2020-06-30 21:15 Sven Barth Status resolved => closed
2020-06-30 21:15 Sven Barth Note Added: 0123687