framework/inc/uielement/toolbarmanager.hxx | 1 framework/source/uielement/addonstoolbarmanager.cxx | 7 -- framework/source/uielement/toolbarmanager.cxx | 10 +++ vcl/source/window/toolbox.cxx | 62 ++++++++++---------- 4 files changed, 48 insertions(+), 32 deletions(-)
New commits: commit e9b63535e426068435d36fbe9a70817950a55ef3 Author: Ivan Timofeev <timofeev....@gmail.com> Date: Thu Jun 7 22:34:01 2012 +0400 fdo#35972: toolbarmanager must be aware of changes in SvtMiscOptions (cherry picked from commit 1829efaf9f5d9af9d51b01d273c7b6c60970b05d) Conflicts: framework/source/uielement/toolbarmanager.cxx Change-Id: Ie6e3036e83b5ea859e2c73df47629eb79791a52c Signed-off-by: Caolán McNamara <caol...@redhat.com> 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 commit b29d04e9360920045cfa87f1e6263434915ae9a7 Author: Ivan Timofeev <timofeev....@gmail.com> Date: Sat Jun 9 21:23:46 2012 +0400 fdo#42379: hide separators before calculating line breaks it is nesessary since commit 1703501a100cd6d52578baeb4e8097218b285ffb, ImplCalcBreaks looks for the last visible item. (cherry picked from commit 243fefb72897f45448d946d571397b7bc4893e7d) Signed-off-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 9da3a7a..a055c6a 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -2336,6 +2336,38 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode ) return aCurrentSize; } +namespace +{ +static void lcl_hideDoubleSeparators( std::vector< ImplToolItem >& rItems ) +{ + bool bLastSep( true ); + std::vector< ImplToolItem >::iterator it; + for ( it = rItems.begin(); it != rItems.end(); ++it ) + { + if ( it->meType == TOOLBOXITEM_SEPARATOR ) + { + it->mbVisible = sal_False; + if ( !bLastSep ) + { + // check if any visible items have to appear behind it + std::vector< ImplToolItem >::iterator temp_it; + for ( temp_it = it+1; temp_it != rItems.end(); ++temp_it ) + { + if ( ((temp_it->meType == TOOLBOXITEM_BUTTON) && + temp_it->mbVisible) ) + { + it->mbVisible = sal_True; + break; + } + } + } + bLastSep = true; + } + else if ( it->mbVisible ) + bLastSep = false; + } +} +} void ToolBox::ImplFormat( sal_Bool bResize ) { @@ -2355,10 +2387,8 @@ void ToolBox::ImplFormat( sal_Bool bResize ) long nMax; // width of layoutarea in pixels sal_uInt16 nFormatLine; sal_Bool bMustFullPaint; - sal_Bool bLastSep; std::vector< ImplToolItem >::iterator it; - std::vector< ImplToolItem >::iterator temp_it; ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); sal_Bool bIsInPopupMode = ImplIsInPopupMode(); @@ -2517,7 +2547,6 @@ void ToolBox::ImplFormat( sal_Bool bResize ) long nX = nLeft; // top-left offset long nY = nTop; nFormatLine = 1; - bLastSep = sal_True; // save old scroll rectangles and reset them Rectangle aOldLowerRect = maLowerRect; @@ -2552,6 +2581,8 @@ void ToolBox::ImplFormat( sal_Bool bResize ) // do we have any toolbox items at all ? if ( !mpData->m_aItems.empty() || IsMenuEnabled() ) { + lcl_hideDoubleSeparators( mpData->m_aItems ); + // compute line breaks and visible lines give the current window width (nMax) // the break indicators will be stored within each item (it->mbBreak) mnCurLines = ImplCalcBreaks( nMax, NULL, mbHorz ); @@ -2648,31 +2679,6 @@ void ToolBox::ImplFormat( sal_Bool bResize ) it = mpData->m_aItems.begin(); while ( it != mpData->m_aItems.end() ) { - // hide double separators - if ( it->meType == TOOLBOXITEM_SEPARATOR ) - { - it->mbVisible = sal_False; - if ( !bLastSep ) - { - // check if any visible items have to appear behind it - temp_it = it+1; - while ( temp_it != mpData->m_aItems.end() ) - { - if ( (temp_it->meType == TOOLBOXITEM_SEPARATOR) || - ((temp_it->meType == TOOLBOXITEM_BUTTON) && - temp_it->mbVisible) ) - { - it->mbVisible = sal_True; - break; - } - ++temp_it; - } - } - bLastSep = sal_True; - } - else if ( it->mbVisible ) - bLastSep = sal_False; - it->mbShowWindow = sal_False; // check for line break and advance nX/nY accordingly commit f11040c27f60e3b3c4e31c43de6b74f5b8676c31 Author: Ivan Timofeev <timofeev....@gmail.com> Date: Fri Jun 8 21:31:06 2012 +0400 fdo#42405: remove this, nowadays MenuItemAllowed disables menu entries since c4461665bd030a555a8b7ffa5bd6717cfb787b9d m_bCanBeCustomized = false will lead to toolbar locking, but we don't want this, indeed. Change-Id: I42f16a017c7f1cf6e8321c7fe26c027ec79c7953 (cherry picked from commit 3768e71344a298d8e7ac07fb38a97ccf58f83a10) Signed-off-by: Caolán McNamara <caol...@redhat.com> diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index facbf5b..1ea2388 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -104,10 +104,6 @@ AddonsToolBarManager::AddonsToolBarManager( const Reference< XMultiServiceFactor ToolBar* pToolBar ) : ToolBarManager( rServiceManager, rFrame, rResourceName, pToolBar ) { - // Configuration data is retrieved from non-writable configuration layer. Therefor we - // must disable some menu entries. - m_bCanBeCustomized = sal_False; - m_pToolBar->SetMenuType( TOOLBOX_MENUTYPE_CLIPPEDITEMS ); m_pToolBar->SetSelectHdl( LINK( this, AddonsToolBarManager, Select) ); m_pToolBar->SetActivateHdl( LINK( this, AddonsToolBarManager, Activate) );
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits