diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-06-16 11:50:53 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-06-16 11:50:53 +0000 |
commit | 6956253e29a21dcab2d39ba3eb85299fe6acc071 (patch) | |
tree | 4f0767dada06a9a8e738eed6dd9ea33a540f1119 /chart2/source/controller/main/CommandDispatchContainer.cxx | |
parent | INTEGRATION: CWS rptchart02 (1.28.4); FILE MERGED (diff) | |
download | core-6956253e29a21dcab2d39ba3eb85299fe6acc071.tar.gz core-6956253e29a21dcab2d39ba3eb85299fe6acc071.zip |
INTEGRATION: CWS rptchart02 (1.3.84); FILE MERGED
2008/04/16 06:35:33 oj 1.3.84.2: RESYNC: (1.3-1.4); FILE MERGED
2008/04/15 12:50:18 oj 1.3.84.1: use comphelper copyProperties
Diffstat (limited to 'chart2/source/controller/main/CommandDispatchContainer.cxx')
-rw-r--r-- | chart2/source/controller/main/CommandDispatchContainer.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx index 37fb2cf93703..72e8dcf5ed8e 100644 --- a/chart2/source/controller/main/CommandDispatchContainer.cxx +++ b/chart2/source/controller/main/CommandDispatchContainer.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: CommandDispatchContainer.cxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.5 $ * * This file is part of OpenOffice.org. * @@ -66,8 +66,9 @@ void CommandDispatchContainer::setModel( const Reference< frame::XModel > & xModel ) { // remove all existing dispatcher that base on the old model - DisposeHelper::DisposeAllMapElements( m_aCachedDispatches ); m_aCachedDispatches.clear(); + DisposeHelper::DisposeAllElements( m_aToBeDisposedDispatches ); + m_aToBeDisposedDispatches.clear(); m_xModel.set( xModel ); } @@ -81,8 +82,10 @@ void CommandDispatchContainer::setFallbackDispatch( const Reference< frame::XDispatch > xFallbackDispatch, const ::std::set< OUString > & rFallbackCommands ) { + OSL_ENSURE(xFallbackDispatch.is(),"Invalid fall back dispatcher!"); m_xFallbackDispatcher.set( xFallbackDispatch ); m_aFallbackCommands = rFallbackCommands; + m_aToBeDisposedDispatches.push_back( m_xFallbackDispatcher ); } Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( @@ -105,6 +108,7 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( pDispatch->initialize(); m_aCachedDispatches[ C2U(".uno:Undo") ].set( xResult ); m_aCachedDispatches[ C2U(".uno:Redo") ].set( xResult ); + m_aToBeDisposedDispatches.push_back( xResult ); } else if( rURL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Context" )) || rURL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ModifiedStatus" ))) @@ -117,6 +121,7 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( pDispatch->initialize(); m_aCachedDispatches[ C2U(".uno:Context") ].set( xResult ); m_aCachedDispatches[ C2U(".uno:ModifiedStatus") ].set( xResult ); + m_aToBeDisposedDispatches.push_back( xResult ); } else if( m_xModel.is() && (m_aContainerDocumentCommands.find( rURL.Path ) != m_aContainerDocumentCommands.end()) ) @@ -152,8 +157,9 @@ Sequence< Reference< frame::XDispatch > > CommandDispatchContainer::getDispatche void CommandDispatchContainer::DisposeAndClear() { - DisposeHelper::DisposeAllMapElements( m_aCachedDispatches ); m_aCachedDispatches.clear(); + DisposeHelper::DisposeAllElements( m_aToBeDisposedDispatches ); + m_aToBeDisposedDispatches.clear(); m_xFallbackDispatcher.clear(); m_aFallbackCommands.clear(); } |