summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
authorAriel Constenla-Haile <arielch@apache.org>2013-05-28 22:09:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-24 11:25:35 +0100
commit2f3e79ee907f6e483d8886984f262fd1763adccc (patch)
tree2a72b3f05442e4da25a4eaa5feca5ec08f1f4ba0 /framework
parentsvx::ExtrusionDepthController is a ToolbarController (diff)
downloadcore-2f3e79ee907f6e483d8886984f262fd1763adccc.tar.gz
core-2f3e79ee907f6e483d8886984f262fd1763adccc.zip
Resolves: #i122401# framework::NewToolbarController needs...
early initialization of its PopupMenu (cherry picked from commit 5149ad822bb66cca9561b7c181c6c2279affc29a) Conflicts: framework/inc/uielement/popuptoolbarcontroller.hxx framework/source/uielement/popuptoolbarcontroller.cxx Change-Id: I619fe7b86a19b146079792a73a50d23682d04a3c
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/uielement/popuptoolbarcontroller.hxx1
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx29
2 files changed, 16 insertions, 14 deletions
diff --git a/framework/inc/uielement/popuptoolbarcontroller.hxx b/framework/inc/uielement/popuptoolbarcontroller.hxx
index f8e8bf951ebd..56f32513dc59 100644
--- a/framework/inc/uielement/popuptoolbarcontroller.hxx
+++ b/framework/inc/uielement/popuptoolbarcontroller.hxx
@@ -77,6 +77,7 @@ namespace framework
DECLARE_XSERVICEINFO
private:
void functionExecuted( const OUString &rCommand );
+ void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& rEvent ) throw ( ::com::sun::star::uno::RuntimeException );
void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
void setItemImage( const OUString &rCommand );
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index b38c6177a311..26ac39cb7b45 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -257,6 +257,17 @@ NewToolbarController::NewToolbarController(
}
void SAL_CALL
+NewToolbarController::initialize(
+ const css::uno::Sequence< css::uno::Any >& aArguments )
+throw ( css::uno::Exception, css::uno::RuntimeException )
+{
+ PopupMenuToolbarController::initialize( aArguments );
+
+ osl::MutexGuard aGuard( m_aMutex );
+ createPopupMenuController();
+}
+
+void SAL_CALL
NewToolbarController::statusChanged(
const css::frame::FeatureStateEvent& rEvent )
throw ( css::uno::RuntimeException )
@@ -401,10 +412,7 @@ void NewToolbarController::setItemImage( const OUString &rCommand )
Image aMenuImage;
sal_Bool bValid( Impl_ExistURLInMenu( m_xPopupMenu, aURL, sFallback, aMenuImage ) );
- // do not change aURL if Impl_ExistURLInMenu returned sal_False
- // this allows later initialization of the PopupMenuController on createPopupWindow()
- // and works even if SvFileInformationManager does not know the module
- if ( !aURL.getLength() )
+ if ( !bValid )
aURL = sFallback;
sal_Bool bBig = SvtMiscOptions().AreCurrentSymbolsLarge();
@@ -412,16 +420,9 @@ void NewToolbarController::setItemImage( const OUString &rCommand )
INetURLObject aURLObj( aURL );
Image aImage = SvFileInformationManager::GetImageNoDefault( aURLObj, bBig );
if ( !aImage )
- {
- if ( !!aMenuImage )
- aImage = aMenuImage;
- else if ( !bValid )
- // If SvFileInformationManager didn't know the module, try with the default
- aImage = SvFileInformationManager::GetImageNoDefault( INetURLObject( sFallback ), bBig );
-
- if ( !aImage )
- aImage = SvFileInformationManager::GetImage( aURLObj, bBig );
- }
+ aImage = !!aMenuImage ?
+ aMenuImage :
+ SvFileInformationManager::GetImage( aURLObj, bBig );
// if everything failed, just use the image associated with the toolbar item command
if ( !aImage )