Author: arielch
Date: Tue May 28 22:09:27 2013
New Revision: 1487142

URL: http://svn.apache.org/r1487142
Log:
i122401 - framework::NewToolbarController needs early initialization of its 
PopupMenu

Modified:
    openoffice/trunk/main/framework/inc/uielement/popuptoolbarcontroller.hxx
    openoffice/trunk/main/framework/source/uielement/popuptoolbarcontroller.cxx

Modified: 
openoffice/trunk/main/framework/inc/uielement/popuptoolbarcontroller.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/framework/inc/uielement/popuptoolbarcontroller.hxx?rev=1487142&r1=1487141&r2=1487142&view=diff
==============================================================================
--- openoffice/trunk/main/framework/inc/uielement/popuptoolbarcontroller.hxx 
(original)
+++ openoffice/trunk/main/framework/inc/uielement/popuptoolbarcontroller.hxx 
Tue May 28 22:09:27 2013
@@ -81,6 +81,7 @@ namespace framework
         DECLARE_XSERVICEINFO
     private:
         void functionExecuted( const rtl::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 rtl::OUString &rCommand );

Modified: 
openoffice/trunk/main/framework/source/uielement/popuptoolbarcontroller.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/framework/source/uielement/popuptoolbarcontroller.cxx?rev=1487142&r1=1487141&r2=1487142&view=diff
==============================================================================
--- openoffice/trunk/main/framework/source/uielement/popuptoolbarcontroller.cxx 
(original)
+++ openoffice/trunk/main/framework/source/uielement/popuptoolbarcontroller.cxx 
Tue May 28 22:09:27 2013
@@ -265,6 +265,17 @@ NewToolbarController::NewToolbarControll
 }
 
 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 )
@@ -409,10 +420,7 @@ void NewToolbarController::setItemImage(
     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();
@@ -421,16 +429,9 @@ void NewToolbarController::setItemImage(
     INetURLObject aURLObj( aURL );
     Image aImage = SvFileInformationManager::GetImageNoDefault( aURLObj, bBig, 
bHC );
     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, bHC );
-
-        if ( !aImage )
-            aImage = SvFileInformationManager::GetImage( aURLObj, bBig, bHC );
-    }
+        aImage = !!aMenuImage ?
+            aMenuImage :
+            SvFileInformationManager::GetImage( aURLObj, bBig, bHC );
 
     // if everything failed, just use the image associated with the toolbar 
item command
     if ( !aImage )


Reply via email to