[Libreoffice-commits] core.git: 4 commits - sfx2/source sw/source vcl/source
Caolán McNamara
caolanm at redhat.com
Tue Jun 16 01:30:45 PDT 2015
sfx2/source/appl/appopen.cxx | 10 ++++-
sfx2/source/sidebar/ResourceManager.cxx | 2 -
sw/source/uibase/utlui/navipi.cxx | 56 +++++++++++++++++---------------
vcl/source/window/toolbox.cxx | 4 +-
4 files changed, 40 insertions(+), 32 deletions(-)
New commits:
commit 9ef671364ff9fbb552a5433053af9283d12d90c7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 16 09:29:39 2015 +0100
Resolves: tdf#88911 Crash when dragging unsupported url to navigator pane
Change-Id: I9d4fc8e3edac699c8543ab9dce8d0e35bbf40e5b
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index e27754e..4ac17df 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1112,10 +1112,14 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
}
- if ( pLinkItem )
+ if (pLinkItem)
{
- SfxPoolItem* pRet = rReq.GetReturnValue()->Clone();
- pLinkItem->GetValue().Call(pRet);
+ const SfxPoolItem* pRetValue = rReq.GetReturnValue();
+ if (pRetValue)
+ {
+ SfxPoolItem* pClone = pRetValue->Clone();
+ pLinkItem->GetValue().Call(pClone);
+ }
delete pLinkItem;
}
}
commit 115fdccd6d69348203375edb3bb262dbc2088a8a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 15 21:07:24 2015 +0100
unfold the if statements a bit, no logic change
Change-Id: I079ba61ef1a559054221029e1c6aa4e53d7be17a
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 2f19e1f..3fdbaa2 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;
}
commit c3db4d2298dd5b18695cf8fd0a56815af75ee9a1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 15 17:29:17 2015 +0100
state *which* context name is not recognized
Change-Id: I179155364f0470b75f14f2ac7b675d76462a9635
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index 2679a3e..1535675 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -390,7 +390,7 @@ void ResourceManager::ReadContextList (
const EnumContext::Context eContext (EnumContext::GetContextEnum(sContextName));
if (eContext == EnumContext::Context_Unknown)
{
- OSL_FAIL("context name not recognized");
+ SAL_WARN("sfx2.sidebar", "context name " << sContextName << " not recognized");
continue;
}
commit ff66595adb1385ce18b1809072c823a65b24357c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jun 15 17:28:14 2015 +0100
downgrade this WARN to an INFO
Change-Id: I040a36cc1656c70c7c258e17757745a196c2bf71
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 3d1231d..b60e79e 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4160,7 +4160,7 @@ void ToolBox::Resize()
if (mpData->m_aItems[i].mbExpand)
{
vcl::Window *pWindow = mpData->m_aItems[i].mpWindow;
- SAL_WARN_IF(!pWindow, "vcl.layout", "only tabitems with window supported at the moment");
+ SAL_INFO_IF(!pWindow, "vcl.layout", "only tabitems with window supported at the moment");
if (!pWindow)
continue;
Size aWinSize(pWindow->GetSizePixel());
@@ -4797,7 +4797,7 @@ Size ToolBox::GetOptimalSize() const
if (mpData->m_aItems[i].mbExpand)
{
vcl::Window *pWindow = mpData->m_aItems[i].mpWindow;
- SAL_WARN_IF(!pWindow, "vcl.layout", "only tabitems with window supported at the moment");
+ SAL_INFO_IF(!pWindow, "vcl.layout", "only tabitems with window supported at the moment");
if (!pWindow)
continue;
Size aWinSize(pWindow->GetSizePixel());
More information about the Libreoffice-commits
mailing list