Issue 120515 - Use enhancements from #120498# in calc and writer for editing draw objects
Summary: Use enhancements from #120498# in calc and writer for editing draw objects
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: editing (show other issues)
Version: 4.0.0-dev
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: Armin Le Grand
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-09 09:10 UTC by Armin Le Grand
Modified: 2017-05-20 10:31 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Armin Le Grand 2012-08-09 09:10:23 UTC
ALG: #120498# added more intuitive mxing of text edit and other changes regarding Undo/Redo (see there). It is not possible to simply adapt this to sw and sc since these have their own special implementations of undo with lots ox exceptional stuff. Some cleanup is needed (in sc, sw svx and others, e.g. chart2, basctl, reportdesigner) to do this safely. To not endanger #120498# which does this for draw/impress and adds the prerequisites, I splitted this in this two tasks.
Comment 1 Armin Le Grand 2012-08-09 09:10:56 UTC
ALG: Changed to enhancement and took over.
Comment 2 Armin Le Grand 2012-08-09 11:36:31 UTC
ALG: Checked for sc again; even when cleaning up some of the Undo stuff there the changes are dangerous, e.g. for each DrawingLayer undo sc is encapsulating it into a ScUndoDraw, doing some extra stuff. This would be missing when setting the document UndoManager from sc directly and is too dangerous without very deep analysis.
Checking another possibility; just use the document UndoManager for the text edit itself. It could be provided bi derivations of SdrObjEditView in the apps (e.g. sc), used in SdrBeginTextEdit/SdrEndTextEdit, default would provide the UndoManager already registered at the DrawingLayer model. Checking if this is doable...
Comment 3 Armin Le Grand 2012-08-10 14:22:55 UTC
ALG: That possibility is good, added virtual method getSdrUndoManagerForEnhancedTextEdit to SdrObjEditView, default gives UndoManager registered at SdrModel. It is used in the SdrObjEditView::SdrBeginTextEdit/SdrEndTextEdit implementations and make the Draw/Impress case work as expected. Committed this as preparation for adaption in apps with revision 1371711 for parent task #120498#.
Comment 4 Armin Le Grand 2012-08-10 14:25:27 UTC
ALG: Exmainated the Calc case; apps outside of Draw/Impress use a mechanism SetNotifyUndoActionHandler. It sets a handler at SdrModel; when set all undo actions from DrawingLayer are sent over this link to the receiver with ownership change. Otherwise sc has it's own mechanisms for grouping undos from Drawinglayer.
Comment 5 SVN Robot 2012-08-10 14:28:01 UTC
"alg" committed SVN revision 1371714 into trunk:
#120515# Implemented and finetuned the enhanced Undo feature (see #120498#) f...
Comment 6 Armin Le Grand 2012-08-10 14:28:15 UTC
ALG: Changed the UndoManger to be created from sc to SdrUndoManger, added and implemented getSdrUndoManagerForEnhancedTextEdit in the sc derivation of FmFormView. Some more finetuning needed, got the feature working for calc. Comitting changes as revision 1371714.
Comment 7 SVN Robot 2012-08-10 14:30:56 UTC
"alg" committed SVN revision 1371716 into trunk:
#120515# Implemented and finetuned the enhanced Undo feature (see #120498#) f...
Comment 8 Armin Le Grand 2012-08-10 14:31:07 UTC
ALG: Checked Writer; it has a completely different, grown undo implementation and also an own derivation of UndoManager. Changed to use SdrUndoManager, implemented getSdrUndoManagerForEnhancedTextEdit. Still a lot of problems, needed to debug deeply and had to rail function calls in sw's own UndoManger implementation dependent of being in text edit mode.
After some debugging got it working stable. Comitting changes as revision 1371716.
Comment 9 SVN Robot 2012-08-10 14:33:26 UTC
"alg" committed SVN revision 1371717 into trunk:
#120515# do not create undo action when in Init()
Comment 10 Armin Le Grand 2012-08-10 14:34:40 UTC
ALG: Small optimization for outliner: No need to create undo actions during Init(), comitted as revision 1371717.
Comment 11 Armin Le Grand 2012-08-10 14:41:09 UTC
ALG: The method SetNotifyUndoActionHdl is a good trace where the undo should be applied. Already done for Draw/Impress, Calc and Writer, the big apps are complete. Open are:
- basctl (basic dialog editor)
- chart2

Evaluating basctl:
Seems as if it has no Undo/Redo at all, but creates a UndoManager and sets the link. In the link, the undo actions are ignored. This could be a big memory leak, need to check this deeper.
The editor itself allows no draw shapes, but only controls. This means this feature is not needed.

Evaluating chart2:
Chart2 supports draw shapes (not in Symphony, a good reason for AOO as base btw). The undo is there, but does not really work. Could get to crash easily with playing around with draw shapes and text edit/undo in AOO3.4.1. Also needs more action.
Comment 12 Armin Le Grand 2012-08-10 14:58:12 UTC
ALG: basctl: There is an undo/restore button, but not used. Indeed there is a memory leak in DialogWindow, NotifyUndoActionHdl. There is a comment saying 'DialogWindow, NotifyUndoActionHdl' and adding to the UndoManager is commented. No info in svn history who did it and why. This needs further evaluation, maybe an own task.
Comment 13 SVN Robot 2012-08-16 10:00:19 UTC
"alg" committed SVN revision 1373773 into trunk:
#120515# fixed memory leak
Comment 14 Armin Le Grand 2012-08-16 10:00:34 UTC
ALG Wrote #120592# for Undo/Redo not working in basctl. I experimented with activation of Undo/Redo in basctl, but it is not working stable. For now I'll fix the memory leak there using this task. Comitted as rev 1373773.
Comment 15 Armin Le Grand 2012-08-16 15:13:29 UTC
ALG: Wrote #120594# for chart issues. It is not easy to adapt for chart, so I decided for an extra issue.
Done for main modules Draw/Impress, Calc and Writer.
Comment 16 Shenfeng Liu 2012-10-10 07:20:05 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.