diff options
Diffstat (limited to 'sd/source/ui/slidesorter/controller/SlsClipboard.cxx')
-rwxr-xr-x | sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 4545e371ea37..a0b725c96782 100755 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -46,6 +46,7 @@ #include "controller/SlsSelectionManager.hxx" #include "controller/SlsTransferableData.hxx" #include "controller/SlsSelectionObserver.hxx" +#include "controller/SlsVisibleAreaManager.hxx" #include "cache/SlsPageCache.hxx" #include "ViewShellBase.hxx" @@ -90,6 +91,37 @@ namespace sd { namespace slidesorter { namespace controller { +namespace { +/** Temporarily deactivate slide tracking of the VisibleAreaManager. + This is used as a workaround to avoid unwanted repositioning of + the visible area when the selection of slides is copied to the + clipboard (cloning of slides leads to model change notifications + for the original model.) +*/ +class TemporarySlideTrackingDeactivator +{ +public: + TemporarySlideTrackingDeactivator (SlideSorterController& rController) + : mrController(rController), + mbIsCurrentSlideTrackingActive ( + mrController.GetVisibleAreaManager().IsCurrentSlideTrackingActive()) + { + if (mbIsCurrentSlideTrackingActive) + mrController.GetVisibleAreaManager().DeactivateCurrentSlideTracking(); + } + ~TemporarySlideTrackingDeactivator (void) + { + if (mbIsCurrentSlideTrackingActive) + mrController.GetVisibleAreaManager().ActivateCurrentSlideTracking(); + } + +private: + SlideSorterController& mrController; + const bool mbIsCurrentSlideTrackingActive; +}; +} // end of anonymous namespace + + class Clipboard::UndoContext { public: @@ -472,7 +504,11 @@ void Clipboard::CreateSlideTransferable ( pTransferable->SetStartPos (pActionWindow->PixelToLogic( pActionWindow->GetPointerPosPixel())); pTransferable->SetObjectDescriptor (aObjDesc); - pTransferable->SetPageBookmarks (aBookmarkList, !bDrag); + + { + TemporarySlideTrackingDeactivator aDeactivator (mrController); + pTransferable->SetPageBookmarks (aBookmarkList, !bDrag); + } for (void* p=aBookmarkList.First(); p!=NULL; p=aBookmarkList.Next()) delete static_cast<String*>(p); |