[PATCH 3/3] fdo#35972: toolbarmanager must be aware of changes in SvtMiscOptions
Ivan Timofeev
timofeev.i.s at gmail.com
Thu Jun 7 11:34:01 PDT 2012
(cherry picked from commit 1829efaf9f5d9af9d51b01d273c7b6c60970b05d)
Conflicts:
framework/source/uielement/toolbarmanager.cxx
Change-Id: Ie6e3036e83b5ea859e2c73df47629eb79791a52c
---
framework/inc/uielement/toolbarmanager.hxx | 1 +
framework/source/uielement/addonstoolbarmanager.cxx | 3 +++
framework/source/uielement/toolbarmanager.cxx | 10 ++++++++++
3 files changed, 14 insertions(+)
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index 2f8ad05..a18d84f 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -173,6 +173,7 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener
DECL_LINK( Deactivate, ToolBox * );
DECL_LINK( StateChanged, StateChangedType* );
DECL_LINK( DataChanged, DataChangedEvent* );
+ DECL_LINK( MiscOptionsChanged, void* );
DECL_LINK( MenuButton, ToolBox * );
DECL_LINK( MenuSelect, Menu * );
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 1ea2388..dc886e8 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -215,6 +215,9 @@ void AddonsToolBarManager::RefreshImages()
);
}
}
+ m_pToolBar->SetToolboxButtonSize( bBigImages ? TOOLBOX_BUTTONSIZE_LARGE : TOOLBOX_BUTTONSIZE_SMALL );
+ ::Size aSize = m_pToolBar->CalcWindowSizePixel();
+ m_pToolBar->SetOutputSizePixel( aSize );
}
void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue > >& rAddonToolbar )
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index df50488..74930d2 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -301,6 +301,8 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic
m_aAsyncUpdateControllersTimer.SetTimeout( 50 );
m_aAsyncUpdateControllersTimer.SetTimeoutHdl( LINK( this, ToolBarManager, AsyncUpdateControllersHdl ) );
+
+ SvtMiscOptions().AddListenerLink( LINK( this, ToolBarManager, MiscOptionsChanged ) );
}
ToolBarManager::~ToolBarManager()
@@ -350,6 +352,8 @@ void ToolBarManager::Destroy()
m_pToolBar->SetCommandHdl( aEmpty );
m_pToolBar = 0;
+
+ SvtMiscOptions().RemoveListenerLink( LINK( this, ToolBarManager, MiscOptionsChanged ) );
}
ToolBox* ToolBarManager::GetToolBar() const
@@ -2139,6 +2143,12 @@ IMPL_LINK( ToolBarManager, DataChanged, DataChangedEvent*, pDataChangedEvent )
return 1;
}
+IMPL_LINK(ToolBarManager, MiscOptionsChanged, void*, EMPTYARG)
+{
+ CheckAndUpdateImages();
+ return 0;
+}
+
IMPL_LINK( ToolBarManager, AsyncUpdateControllersHdl, Timer *, EMPTYARG )
{
// The guard must be in its own context as the we can get destroyed when our
--
1.7.10
--------------090600070206000008090701--
More information about the LibreOffice
mailing list