incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1172132 - in /incubator/ooo/trunk/main/sd/source/ui/slidesorter: controller/SlsClipboard.cxx controller/SlsVisibleAreaManager.cxx inc/controller/SlsVisibleAreaManager.hxx
Date Sat, 17 Sep 2011 22:43:38 GMT
Author: mst
Date: Sat Sep 17 22:43:38 2011
New Revision: 1172132

URL: http://svn.apache.org/viewvc?rev=1172132&view=rev
Log:
slidesorter1: #i116412# Temporarily turning off slide tracking to avoid unwanted repositioning
of visible area.

# HG changeset patch
# User Andre Fischer<andre.f.fischer@oracle.com>
# Date 1300891523 -3600
# Node ID d926168e689e211d1ae6bfa5932be8c9f015b19c
# Parent  dd74093681332c51934ab449c4b7c9eaec89359a

Modified:
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsClipboard.cxx?rev=1172132&r1=1172131&r2=1172132&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsClipboard.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsClipboard.cxx Sat Sep
17 22:43:38 2011
@@ -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);

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx?rev=1172132&r1=1172131&r2=1172132&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
(original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
Sat Sep 17 22:43:38 2011
@@ -94,6 +94,14 @@ void VisibleAreaManager::DeactivateCurre
 
 
 
+bool VisibleAreaManager::IsCurrentSlideTrackingActive (void) const
+{
+    return mbIsCurrentSlideTrackingActive;
+}
+
+
+
+
 void VisibleAreaManager::RequestVisible (
     const model::SharedPageDescriptor& rpDescriptor,
     const bool bForce)

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx?rev=1172132&r1=1172131&r2=1172132&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx
(original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/inc/controller/SlsVisibleAreaManager.hxx
Sat Sep 17 22:43:38 2011
@@ -47,6 +47,7 @@ public:
 
     void ActivateCurrentSlideTracking (void);
     void DeactivateCurrentSlideTracking (void);
+    bool IsCurrentSlideTrackingActive (void) const;
 
     /** Request the current slide to be moved into the visible area.
         This request is only obeyed when the current slide tracking is



Mime
View raw message