Kaydet (Commit) 5149ad82 authored tarafından Ariel Constenla-Haile's avatar Ariel Constenla-Haile

i122401 - framework::NewToolbarController needs early initialization of its PopupMenu

üst e0f9eb4c
......@@ -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 );
......
......@@ -264,6 +264,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 )
......@@ -409,10 +420,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();
......@@ -421,16 +429,9 @@ void NewToolbarController::setItemImage( const OUString &rCommand )
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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment