sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx |   42 +++++++++++
 1 file changed, 42 insertions(+)

New commits:
commit 192a0eb2beccee5349c3c7b60208aa95eb985f35
Author: Tor Lillqvist <t...@iki.fi>
Date:   Wed Nov 7 15:50:21 2012 +0200

    fdo51023: Revert e4450c54aee85b295b933e91d207fd8220c01107 for Mac OS X
    
    See bug for discussion. Basically, the root cause to the problem is
    that on the Mac, all the drag-and-drop action happens during the call
    to pSlideSorterViewShell->StartDrag() in the Initialize method. Thus
    no wonder that mpDragAndDropContext is null in the ProcessDragEvent()
    as it has not been initialized yet, and is in fact initialised
    pointlessly only after the drag-and-drop already has finished.
    
    Reverted just for Mac OS X and ifdefified in a straightforward even if
    ugly fashion.
    
    Change-Id: Icfb62fb24a5c72fda39c8bcea125267c99ecf624

diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx 
b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index a451c12..516ba98 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -246,10 +246,17 @@ public:
     MultiSelectionModeHandler (
         SlideSorter& rSlideSorter,
         SelectionFunction& rSelectionFunction,
+#ifndef MACOSX
         const Point& rMouseModelPosition);
+#else
+        const Point& rMouseModelPosition,
+        const sal_uInt32 nEventCode);
+#endif
     virtual ~MultiSelectionModeHandler (void);
 
+#ifndef MACOSX
     void Initialize(const sal_uInt32 nEventCode);
+#endif
 
     virtual SelectionFunction::Mode GetMode (void) const;
     virtual void Abort (void);
@@ -296,10 +303,19 @@ class DragAndDropModeHandler : public 
SelectionFunction::ModeHandler
 public:
     DragAndDropModeHandler (
         SlideSorter& rSlideSorter,
+#ifndef MACOSX
         SelectionFunction& rSelectionFunction);
+#else
+        SelectionFunction& rSelectionFunction,
+        const Point& rMousePosition,
+        ::Window* pWindow);
+#endif
     virtual ~DragAndDropModeHandler (void);
 
+#ifndef MACOSX
     void Initialize(const Point& rMousePosition, ::Window* pWindow);
+#endif
+
     virtual SelectionFunction::Mode GetMode (void) const;
     virtual void Abort (void);
 
@@ -775,6 +791,7 @@ void SelectionFunction::SwitchToDragAndDropMode (const 
Point aMousePosition)
 {
     if (mpModeHandler->GetMode() != DragAndDropMode)
     {
+#ifndef MACOSX
         ::boost::shared_ptr<DragAndDropModeHandler> handler(
             new DragAndDropModeHandler(mrSlideSorter, *this));
         SwitchMode(handler);
@@ -782,6 +799,10 @@ void SelectionFunction::SwitchToDragAndDropMode (const 
Point aMousePosition)
         // could already trigger DND events, which would recursively trigger 
this code again,
         // and without mpModeHandler set it would again try to set a new 
handler.
         handler->Initialize(aMousePosition, mpWindow);
+#else
+        SwitchMode(::boost::shared_ptr<ModeHandler>(
+            new DragAndDropModeHandler(mrSlideSorter, *this, aMousePosition, 
mpWindow)));
+#endif
     }
 }
 
@@ -793,6 +814,7 @@ void SelectionFunction::SwitchToMultiSelectionMode (
     const sal_uInt32 nEventCode)
 {
     if (mpModeHandler->GetMode() != MultiSelectionMode)
+#ifndef MACOSX
     {
         ::boost::shared_ptr<MultiSelectionModeHandler> handler(
             new MultiSelectionModeHandler(mrSlideSorter, *this, 
aMousePosition));
@@ -801,6 +823,10 @@ void SelectionFunction::SwitchToMultiSelectionMode (
         // is non-trivial, so it could possibly recurse just like the DND 
handler above.
         handler->Initialize(nEventCode);
     }
+#else
+        SwitchMode(::boost::shared_ptr<ModeHandler>(
+            new MultiSelectionModeHandler(mrSlideSorter, *this, 
aMousePosition, nEventCode)));
+#endif
 }
 
 
@@ -1414,7 +1440,12 @@ void NormalModeHandler::ResetButtonDownLocation (void)
 MultiSelectionModeHandler::MultiSelectionModeHandler (
     SlideSorter& rSlideSorter,
     SelectionFunction& rSelectionFunction,
+#ifndef MACOSX
     const Point& rMouseModelPosition)
+#else
+    const Point& rMouseModelPosition,
+    const sal_uInt32 nEventCode)
+#endif
     : ModeHandler(rSlideSorter, rSelectionFunction, false),
       meSelectionMode(SM_Normal),
       maSecondCorner(rMouseModelPosition),
@@ -1423,11 +1454,13 @@ MultiSelectionModeHandler::MultiSelectionModeHandler (
       mnAnchorIndex(-1),
       mnSecondIndex(-1)
 {
+#ifndef MACOSX
 }
 
 
 void MultiSelectionModeHandler::Initialize(const sal_uInt32 nEventCode)
 {
+#endif
     const Pointer aSelectionPointer (POINTER_TEXT);
     mrSlideSorter.GetContentWindow()->SetPointer(aSelectionPointer);
     SetSelectionModeFromModifier(nEventCode);
@@ -1683,13 +1716,22 @@ void MultiSelectionModeHandler::UpdateSelection (void)
 
 DragAndDropModeHandler::DragAndDropModeHandler (
     SlideSorter& rSlideSorter,
+#ifndef MACOSX
     SelectionFunction& rSelectionFunction)
+#else
+    SelectionFunction& rSelectionFunction,
+    const Point& rMousePosition,
+    ::Window* pWindow)
+#endif
     : ModeHandler(rSlideSorter, rSelectionFunction, false)
 {
+#ifndef MACOSX
 }
 
+
 void DragAndDropModeHandler::Initialize(const Point& rMousePosition, ::Window* 
pWindow)
 {
+#endif
     SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag;
     if (pDragTransferable==NULL && mrSlideSorter.GetViewShell() != NULL)
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to