diff options
author | Armin Le Grand <alg@apache.org> | 2013-09-05 13:01:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-06 11:20:47 +0100 |
commit | c77ec4fe42c064adc507caa2760a99e096f8c016 (patch) | |
tree | 8e7b8dc91f83a0b2366331c2bf56fbc67ae4d403 /svx/source/svdraw/svdundo.cxx | |
parent | 871cc47c5ea66d1c2f1cbff5d7564202192ea84c (diff) |
Resolves: #i122985# Various speedups for graphic object swapping
(cherry picked from commit f18ad6132d79540431bf04f090a7472e21a23e49)
Conflicts:
svtools/source/filter/jpeg/jpeg.cxx
svx/inc/svx/svdundo.hxx
svx/source/svdraw/svdograf.cxx
vcl/source/gdi/pngread.cxx
Change-Id: I733551fa9447eb8f45e9163a9c0189f013b03e82
Diffstat (limited to 'svx/source/svdraw/svdundo.cxx')
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index fcdf5f09546d..caf3ba46e1bd 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -38,8 +38,9 @@ #include <svx/svdocapt.hxx> #include <svl/whiter.hxx> #include <svx/e3dsceneupdater.hxx> - -#include "svx/svdviter.hxx" +#include <svx/svdviter.hxx> +#include <svx/svdograf.hxx> +#include <svx/sdr/contact/viewcontactofgraphic.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -887,6 +888,34 @@ void SdrUndoInsertObj::Redo() //////////////////////////////////////////////////////////////////////////////////////////////////// +void SdrUndoDelObj::TryToFlushGraphicContent() +{ + SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pObj); + + if(pSdrGrafObj) + { + sdr::contact::ViewContactOfGraphic* pVC = dynamic_cast< sdr::contact::ViewContactOfGraphic* >(&pSdrGrafObj->GetViewContact()); + + if(pVC) + { + pVC->flushViewObjectContacts(); + pVC->flushGraphicObjects(); + } + + pSdrGrafObj->ForceSwapOut(); + } +} + +SdrUndoDelObj::SdrUndoDelObj(SdrObject& rNewObj, bool bOrdNumDirect) +: SdrUndoRemoveObj(rNewObj,bOrdNumDirect) +{ + SetOwner(true); + + // #i122985# if graphic object is deleted (but goes to undo) flush it's graphic content + // since it is potentially no longer needed + TryToFlushGraphicContent(); +} + void SdrUndoDelObj::Undo() { SdrUndoRemoveObj::Undo(); @@ -899,6 +928,10 @@ void SdrUndoDelObj::Redo() SdrUndoRemoveObj::Redo(); DBG_ASSERT(!IsOwner(),"RedoDeleteObj: pObj already belongs to UndoAction"); SetOwner(sal_True); + + // #i122985# if graphic object is deleted (but goes to undo) flush it's graphic content + // since it is potentially no longer needed + TryToFlushGraphicContent(); } OUString SdrUndoDelObj::GetComment() const |