summaryrefslogtreecommitdiff
path: root/basic/source/sbx/sbxconv.hxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-11-30 20:27:24 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-12-01 13:52:24 +0100
commit25a368c30acb54e0819d2b2b890a3fd1530d8a76 (patch)
tree4d48772b82e4a9d99d23702012abb25685e3c296 /basic/source/sbx/sbxconv.hxx
parent9425ea3f8f5622e857dc1e860b151fd94323de0c (diff)
tdf#145928 svx: fix undo of sorting shapes
The problem is that in sw there are these obnoxious virtual SdrObjects that are created and destroyed by the layout. 0 SdrObject::~SdrObject() 3 SwVirtFlyDrawObj::~SwVirtFlyDrawObj() 5 SwFlyFrame::FinitDrawObj() 12 SwFrame::DestroyFrame(SwFrame*) 13 SwFrameFormat::DelFrames() 14 SwUndoFlyBase::DelFly(SwDoc*) 15 SwUndoDelLayFormat::SwUndoDelLayFormat(SwFrameFormat*) 16 SwHistoryTextFlyCnt::SwHistoryTextFlyCnt(SwFrameFormat*) This misdesign means that SdrUndoObj::pObj may point to a deleted object. Commit 9bc6160e0acbc78be998129ea55ed7e4529959fa may create SdrUnoObj when saving the document, so that is now an additional way to introduce the problem. Try to work around it by not using a SdrUndoObj subclass in this case, but create a new SdrUndoAction subclass that uses SdrPage::sort() and stores no pointers. There is still the problem that changes in the layout or view settings like "Hide tracked changes" could cause different virtual SdrObjects to exist between when the Undo was recorded and when it is activated, in which case nothing is done. But that really requires a larger refactoring such as having a SdrPage for the model that never contains virtual SdrObjects, and another SdrPage for the view that does contain virtual SdrObjects to fix. Change-Id: I4cf5d4eb8bb24a51730c55ff34a043b8a88fdb52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126153 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'basic/source/sbx/sbxconv.hxx')
0 files changed, 0 insertions, 0 deletions