diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-11-07 15:50:21 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-11-07 17:58:25 +0000 |
commit | 7ec1ae356a6b06a31fca68eb30c706b906d75fdd (patch) | |
tree | 1c8170e70a6cd78d68474c9c3ac5f665be665590 /sd | |
parent | 9d90fc7593445d0cd2333a827840e1c993e7a9b5 (diff) |
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
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 0d3fc63bd1f3..4220a0ecf8aa 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -251,10 +251,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); @@ -301,10 +308,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); @@ -817,6 +833,7 @@ void SelectionFunction::SwitchToDragAndDropMode (const Point aMousePosition) { if (mpModeHandler->GetMode() != DragAndDropMode) { +#ifndef MACOSX ::boost::shared_ptr<DragAndDropModeHandler> handler( new DragAndDropModeHandler(mrSlideSorter, *this)); SwitchMode(handler); @@ -824,6 +841,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 } } @@ -835,6 +856,7 @@ void SelectionFunction::SwitchToMultiSelectionMode ( const sal_uInt32 nEventCode) { if (mpModeHandler->GetMode() != MultiSelectionMode) +#ifndef MACOSX { ::boost::shared_ptr<MultiSelectionModeHandler> handler( new MultiSelectionModeHandler(mrSlideSorter, *this, aMousePosition)); @@ -843,6 +865,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 } @@ -1513,7 +1539,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), @@ -1522,11 +1553,13 @@ MultiSelectionModeHandler::MultiSelectionModeHandler ( mnSecondIndex(-1), maButtonBarLock(rSlideSorter) { +#ifndef MACOSX } void MultiSelectionModeHandler::Initialize(const sal_uInt32 nEventCode) { +#endif const Pointer aSelectionPointer (POINTER_TEXT); mrSlideSorter.GetContentWindow()->SetPointer(aSelectionPointer); SetSelectionModeFromModifier(nEventCode); @@ -1766,13 +1799,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) { |