Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Enhance user experience for editing text in draw shapes and/or tables when using undo/redo | ||
---|---|---|---|
Product: | Draw | Reporter: | Armin Le Grand <Armin.Le.Grand> |
Component: | editing | Assignee: | Armin Le Grand <Armin.Le.Grand> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | Normal | ||
Priority: | P3 | CC: | awf.aoo, liushenf |
Version: | 4.0.0-dev | ||
Target Milestone: | 4.0.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Latest Confirmation in: | --- |
Developer Difficulty: | --- |
Description
Armin Le Grand
2012-08-08 11:53:23 UTC
ALG: Taking over. Base reason for this behaviour is that a new UndoManager is used by the EditEngine/Outliner for text edit, not the existing one from the document (which hold all the other undos and will get the text edit undo action when ending text edit. I will try to use the regular document undo manager for text edit, too. This will require to derive it from EditUndoManager, not from SfxUndoManager, to allow to set an own UndoManager in Outliner/EditEngine and other stuff. Also needed is a mechanism to detect that the edit undo actions are all undo(ne) and edit mode has to be left with the next triggered Undo and the last non-edit undo has to be triggered instead. Investigating... ALG: Changed to enhancement ALG: Undo is patched stuff, hard to control. Have found a solution now which: - adds an SdrUndoManager to svx to allow later sw and sc to use it, too - SdrUndoManager derived from EditUndoManager, added Undo/Redo methods, added method to start/end text edit, added callback to signal that text edit shall be ended - sd's UndoManager derived from SdrUndoManager to support new mechanism - activate/deactivate text edit mode in SdrUndoManager on SdrBegin/EndTextEdit accordingly, if the given UndoManager is a SdrUndoManager, do needed corrections in SdrEndTextEdit - many adaptions to handle this smoothly (some caveats with redo stack, etc where the standard SfxUndoManager is not too good with) Behaviour for (a) is now: - when starting text edit, the undo stack ui shows all undo actions (before, all previous seemed to be gone), text edit actions are added as expected - when using Undo in text edit mode, text edits are undone as before. When all are undone, text edit mode is left smoothly and the next action of the undo stack is triggered; this is what users intuitively expect - when there were redos left for text edit actions when text edit is ended, an extra undo action is created containing these and put on the redo stack. The principle is to never throw away user input when possible. A user using redo will get back his last changes as long as he has not done something else in between. Behaviour for (b) is now: - same as for (a) except that edit change is triggered when changing active cell, user can smoothly edit table as intuitively expected and Undo will undo the single cell edits (not the single char edits in each cell, these will be bundled when leaving edit mode, as before) - as in (a), last edits in redo will be preserved All in all: Users can now intuitively mix text edit and other actions and do not need to be aware that leaving edit mode is an active action. Undo works smoothly and intuitively, no longer blocking in an activated edit. Example: New draw (or impress), insert table, edit fields as wanted. Without clicking or ESC for leaving edit mode, all actions can be undone, including inserting the table. All can then be redone, no already entered text is lost. ALG: Invested some time to also do this for sw and sc, but found out that unfortunately each app is baking it's own version of undo handling. Lots of cleanups will be needed doing this, too dangerous to mix with this enhancement, so opening a new task for it. Done, added #120515#. Som emore tests/checks, removing started changes for sw/sc again. "alg" committed SVN revision 1371123 into trunk: #120498# Enhanced Undo/Redo and user experience when editing texts in graphic... ALG: Works well, no drawbacks found (also checked with undo depth == 1). Checked in initial version, looking forward for people trying it out and comments/suggestions. ALG: One drawback found, problems with one case: New object, enter text edit, add two words )two undo actions). Undo the first one, end text edit (esc or click). All text is removed, redo action for text with deleted part is created. This is not acceptable, the mechanism for creating redo actions for deleted text can only be applied when the text edit end was triggered from the last text change undo; this will keep the enhancement. I see currently no possibility to 'split' the text undo actions to create another grouped redo from a partial undone text edit. Adapted mechanisms, also simplified and added some basic support mechanism to use it with low danger for other apps (preps for #120515#). Committing changes for svx. "alg" committed SVN revision 1371711 into trunk: #120498# fixed error with half text edit undone, extended as preparation for ... set Target Milestone to AOO 3.5.0 for PM purpose. See bug 123468 for a possible regression. |