summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-24 16:11:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-02-24 20:38:40 +0100
commitb74032346ef2a00db457c4dec14997b6423a3e8c (patch)
treebc098b0913af23e5005f746cb13c44fa9d2ba9dd /sd
parentff29d9205a42fa603fc586f1d4e31cd98be56784 (diff)
IsDropFormatSupported(...::SIMPLE_FILE) is always false
for this navigator as far as I can tell so reduce accordingly Change-Id: I8c8b62487d6aa94114c523d8d4a9ebb71a0896c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89364 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx62
1 files changed, 16 insertions, 46 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 101dc46a5c15..b149354506b5 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1081,32 +1081,25 @@ sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent)
{
sal_Int8 nResult (DND_ACTION_NONE);
- if ( !bIsInDrag && IsDropFormatSupported( SotClipboardFormatId::SIMPLE_FILE ) )
+ SvTreeListEntry* pEntry = GetDropTarget(rEvent.maPosPixel);
+ if (rEvent.mbLeaving || !CheckDragAndDropMode( this, rEvent.mnAction ))
{
- nResult = rEvent.mnAction;
+ ImplShowTargetEmphasis( pTargetEntry, false );
}
- else
+ else if( GetDragDropMode() == DragDropMode::NONE )
+ {
+ SAL_WARN( "sc.ui", "SdPageObjsTLB::AcceptDrop(): no target" );
+ }
+ else if (IsDropAllowed(pEntry))
{
- SvTreeListEntry* pEntry = GetDropTarget(rEvent.maPosPixel);
- if (rEvent.mbLeaving || !CheckDragAndDropMode( this, rEvent.mnAction ))
+ nResult = DND_ACTION_MOVE;
+
+ // Draw emphasis.
+ if (pEntry != pTargetEntry || !(nImpFlags & SvTreeListBoxFlags::TARGEMPH_VIS))
{
ImplShowTargetEmphasis( pTargetEntry, false );
- }
- else if( GetDragDropMode() == DragDropMode::NONE )
- {
- SAL_WARN( "sc.ui", "SdPageObjsTLB::AcceptDrop(): no target" );
- }
- else if (IsDropAllowed(pEntry))
- {
- nResult = DND_ACTION_MOVE;
-
- // Draw emphasis.
- if (pEntry != pTargetEntry || !(nImpFlags & SvTreeListBoxFlags::TARGEMPH_VIS))
- {
- ImplShowTargetEmphasis( pTargetEntry, false );
- pTargetEntry = pEntry;
- ImplShowTargetEmphasis( pTargetEntry, true );
- }
+ pTargetEntry = pEntry;
+ ImplShowTargetEmphasis( pTargetEntry, true );
}
}
@@ -1122,31 +1115,8 @@ sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent)
*/
sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt )
{
- sal_Int8 nRet = DND_ACTION_NONE;
-
- try
- {
- if( !bIsInDrag && mpNavigator)
- {
- TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable );
- OUString aFile;
-
- if( aDataHelper.GetString( SotClipboardFormatId::SIMPLE_FILE, aFile ) &&
- mpNavigator->InsertFile( aFile ) )
- {
- nRet = rEvt.mnAction;
- }
- }
- }
- catch (css::uno::Exception&)
- {
- DBG_UNHANDLED_EXCEPTION("sd");
- }
-
- if (nRet == DND_ACTION_NONE)
- SvTreeListBox::ExecuteDrop(rEvt, this);
-
- return nRet;
+ SvTreeListBox::ExecuteDrop(rEvt, this);
+ return DND_ACTION_NONE;
}
/**