diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-06-15 21:07:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-16 09:30:11 +0100 |
commit | 115fdccd6d69348203375edb3bb262dbc2088a8a (patch) | |
tree | e1eb7e9c86315f0d62a7e4891bc4aa158f255f68 | |
parent | c3db4d2298dd5b18695cf8fd0a56815af75ee9a1 (diff) |
unfold the if statements a bit, no logic change
Change-Id: I079ba61ef1a559054221029e1c6aa4e53d7be17a
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 2f19e1faf113..3fdbaa24f141 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -1153,35 +1153,39 @@ sal_Int8 SwNavigationPI::ExecuteDrop( const ExecuteDropEvent& rEvt ) { TransferableDataHelper aData( rEvt.maDropEvent.Transferable ); sal_Int8 nRet = DND_ACTION_NONE; - OUString sFileName; - if( !SwContentTree::IsInDrag() && - !(sFileName = SwNavigationPI::CreateDropFileName( aData )).isEmpty() ) + if(SwContentTree::IsInDrag()) + return nRet; + + OUString sFileName = SwNavigationPI::CreateDropFileName(aData); + if (sFileName.isEmpty()) + return nRet; + + INetURLObject aTemp(sFileName); + GraphicDescriptor aDesc(aTemp); + if (aDesc.Detect()) // accept no graphics + return nRet; + + if (-1 != sFileName.indexOf('#')) + return nRet; + + if ((sContentFileName.isEmpty() || sContentFileName != sFileName)) { - INetURLObject aTemp( sFileName ); - GraphicDescriptor aDesc( aTemp ); - if( !aDesc.Detect() ) // accept no graphics + nRet = rEvt.mnAction; + sFileName = comphelper::string::stripEnd(sFileName, 0); + sContentFileName = sFileName; + if(pxObjectShell) { - if( -1 == sFileName.indexOf('#') - && (sContentFileName.isEmpty() || sContentFileName != sFileName )) - { - nRet = rEvt.mnAction; - sFileName = comphelper::string::stripEnd(sFileName, 0); - sContentFileName = sFileName; - if(pxObjectShell) - { - aContentTree->SetHiddenShell( 0 ); - (*pxObjectShell)->DoClose(); - DELETEZ( pxObjectShell); - } - SfxStringItem aFileItem(SID_FILE_NAME, sFileName ); - SfxStringItem aOptionsItem( SID_OPTIONS, OUString("HRC") ); - SfxLinkItem aLink( SID_DONELINK, - LINK( this, SwNavigationPI, DoneLink ) ); - GetActiveView()->GetViewFrame()->GetDispatcher()->Execute( - SID_OPENDOC, SfxCallMode::ASYNCHRON, - &aFileItem, &aOptionsItem, &aLink, 0L ); - } + aContentTree->SetHiddenShell( 0 ); + (*pxObjectShell)->DoClose(); + DELETEZ( pxObjectShell); } + SfxStringItem aFileItem(SID_FILE_NAME, sFileName ); + SfxStringItem aOptionsItem( SID_OPTIONS, OUString("HRC") ); + SfxLinkItem aLink( SID_DONELINK, + LINK( this, SwNavigationPI, DoneLink ) ); + GetActiveView()->GetViewFrame()->GetDispatcher()->Execute( + SID_OPENDOC, SfxCallMode::ASYNCHRON, + &aFileItem, &aOptionsItem, &aLink, 0L ); } return nRet; } |