[Libreoffice-commits] core.git: sd/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Feb 24 19:39:16 UTC 2020
sd/source/ui/dlg/sdtreelb.cxx | 62 ++++++++++--------------------------------
1 file changed, 16 insertions(+), 46 deletions(-)
New commits:
commit b74032346ef2a00db457c4dec14997b6423a3e8c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Feb 24 16:11:31 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Feb 24 20:38:40 2020 +0100
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 at redhat.com>
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;
}
/**
More information about the Libreoffice-commits
mailing list