summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-05-27 20:49:48 +0200
committerJan Holesovsky <kendy@suse.cz>2011-05-27 20:49:48 +0200
commit5a9d7a54e97c701c117b72c33ec9dc29ec73fc27 (patch)
tree7ed6de9fdba21d3588dba96889ba0ad6e672ba2f /sfx2/source
parent9df8682ced86258da76a730ecf354c788fffc1f2 (diff)
parentda658a4956fc3c6bcb1d45ecad22ece93e43f303 (diff)
Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/libs-core
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/lnkbase2.cxx8
-rw-r--r--sfx2/source/control/bindings.cxx14
2 files changed, 9 insertions, 13 deletions
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 0f2488cfe3d5..cc7b31bd1b15 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -330,12 +330,13 @@ sal_Bool SvBaseLink::Update()
if( xObj->GetData( aData, sMimeType ) )
{
- DataChanged( sMimeType, aData );
+ UpdateResult eRes = DataChanged(sMimeType, aData);
+ bool bSuccess = eRes == SUCCESS;
//for manual Updates there is no need to hold the ServerObject
if( OBJECT_CLIENT_DDE == nObjType &&
LINKUPDATE_ONCALL == GetUpdateMode() && xObj.Is() )
xObj->RemoveAllDataAdvise( this );
- return sal_True;
+ return bSuccess;
}
if( xObj.Is() )
{
@@ -439,7 +440,7 @@ void SvBaseLink::Disconnect()
}
}
-void SvBaseLink::DataChanged( const String &, const ::com::sun::star::uno::Any & )
+SvBaseLink::UpdateResult SvBaseLink::DataChanged( const String &, const ::com::sun::star::uno::Any & )
{
switch( nObjType )
{
@@ -448,6 +449,7 @@ void SvBaseLink::DataChanged( const String &, const ::com::sun::star::uno::Any &
pImplData->DDEType.pItem->Notify();
break;
}
+ return SUCCESS;
}
void SvBaseLink::Edit( Window* pParent, const Link& rEndEditHdl )
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 3f837323a1fd..49359002de34 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -72,6 +72,7 @@
#include <comphelper/uieventslogger.hxx>
#include <com/sun/star/frame/XModuleManager.hpp>
+#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -1144,14 +1145,14 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
rDispatcher.GetFrame(); // -Wall is this required???
// get SlotServer (Slot+ShellLevel) and Shell from cache
- sal_Bool bDeleteCache = sal_False;
+ ::boost::scoped_ptr<SfxStateCache> xCache;
if ( !pCache )
{
// Execution of non cached slots (Accelerators don't use Controllers)
// slot is uncached, use SlotCache to handle external dispatch providers
- pCache = new SfxStateCache( nId );
+ xCache.reset(new SfxStateCache(nId));
+ pCache = xCache.get();
pCache->GetSlotServer( rDispatcher, pImp->xProv );
- bDeleteCache = sal_True;
}
if ( pCache && pCache->GetDispatch().is() )
@@ -1167,14 +1168,10 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
// cache binds to an external dispatch provider
pCache->Dispatch( aReq.GetArgs(), nCallMode == SFX_CALLMODE_SYNCHRON );
- if ( bDeleteCache )
- DELETEZ( pCache );
SfxPoolItem *pVoid = new SfxVoidItem( nId );
DeleteItemOnIdle( pVoid );
return pVoid;
}
- else if ( pCache && bDeleteCache ) // just in case it was created, but GetDispatch() is 0
- DELETEZ( pCache );
// slot is handled internally by SfxDispatcher
if ( pImp->bMsgDirty )
@@ -1224,9 +1221,6 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
pRet = pVoid;
}
- if ( bDeleteCache )
- delete pCache;
-
return pRet;
}