Author: alg
Date: Wed Jun 19 11:23:41 2013
New Revision: 1494553

URL: http://svn.apache.org/r1494553
Log:
i122497 Filter D&D flags for calc D&D

Modified:
    openoffice/trunk/main/sc/source/ui/view/gridwin.cxx

Modified: openoffice/trunk/main/sc/source/ui/view/gridwin.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/view/gridwin.cxx?rev=1494553&r1=1494552&r2=1494553&view=diff
==============================================================================
--- openoffice/trunk/main/sc/source/ui/view/gridwin.cxx (original)
+++ openoffice/trunk/main/sc/source/ui/view/gridwin.cxx Wed Jun 19 11:23:41 2013
@@ -3564,6 +3564,13 @@ sal_Int8 ScGridWindow::AcceptDrop( const
                else
                {
                        sal_Int8 nMyAction = rEvt.mnAction;
+                       
+                       // clear DND_ACTION_LINK when other actions are set. 
The usage below cannot handle
+                       // multiple set values
+                       if((nMyAction & DND_ACTION_LINK) && (nMyAction & 
(DND_ACTION_COPYMOVE)))
+                       {
+                           nMyAction &= ~DND_ACTION_LINK;
+                       }
 
                        if ( !rData.pDrawTransfer ||
                                        
!IsMyModel(rData.pDrawTransfer->GetDragSourceView()) )          // drawing 
within the document
@@ -3573,7 +3580,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const
                        ScDocument* pThisDoc = pViewData->GetDocument();
                        SdrObject* pHitObj = pThisDoc->GetObjectAtPoint(
                                                pViewData->GetTabNo(), 
PixelToLogic(rEvt.maPosPixel) );
-                       if ( pHitObj && nMyAction == DND_ACTION_LINK && 
!rData.pDrawTransfer )
+                       if ( pHitObj && nMyAction == DND_ACTION_LINK ) // && 
!rData.pDrawTransfer )
                        {
                                if ( 
IsDropFormatSupported(SOT_FORMATSTR_ID_SVXB)
                                        || 
IsDropFormatSupported(SOT_FORMAT_GDIMETAFILE)
@@ -4191,8 +4198,9 @@ sal_Int8 ScGridWindow::ExecuteDrop( cons
        }
 
        Point aLogicPos = PixelToLogic(aPos);
+       sal_Bool bIsLink = ( rEvt.mnAction == DND_ACTION_LINK );
 
-       if (rData.pDrawTransfer)
+       if (!bIsLink && rData.pDrawTransfer)
        {
                sal_uInt16 nFlags = rData.pDrawTransfer->GetDragSourceFlags();
 
@@ -4228,8 +4236,6 @@ sal_Int8 ScGridWindow::ExecuteDrop( cons
                }
        }
 
-       sal_Bool bIsLink = ( rEvt.mnAction == DND_ACTION_LINK );
-
        ScDocument* pThisDoc = pViewData->GetDocument();
        SdrObject* pHitObj = pThisDoc->GetObjectAtPoint( pViewData->GetTabNo(), 
PixelToLogic(aPos) );
        if ( pHitObj && bIsLink )


Reply via email to