And finally I realized that there is no IMPL_LINK_NOARG in
libreoffice-3-5, so the cherry-pick would not succeed.
Attached all 3 patches, they are applicable now and no corrections
needed. For sure.
On 06.06.2012 11:06, Bjoern Michaelsen wrote:
> On Wed, Jun 06, 2012 at 06:21:43AM +0200, Lionel Elie Mamane wrote:
>> (And somebody find me a brown paper bag...)
>
> Here you have one from my collection!
And one for me, please!
Ivan
From 2acadc62acce2ccac49cbe255d9a266fdfd042eb Mon Sep 17 00:00:00 2001
From: Ivan Timofeev <timofeev.i.s@gmail.com>
Date: Fri, 8 Jun 2012 21:31:06 +0400
Subject: [PATCH 1/3] 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)
---
framework/source/uielement/addonstoolbarmanager.cxx | 4 ----
1 file changed, 4 deletions(-)
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) );
--
1.7.10
From 4b237543a737328d8ca3d573a1e4a19cebbf7272 Mon Sep 17 00:00:00 2001
From: Ivan Timofeev <timofeev.i.s@gmail.com>
Date: Sat, 9 Jun 2012 21:23:46 +0400
Subject: [PATCH 2/3] 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)
---
vcl/source/window/toolbox.cxx | 62 ++++++++++++++++++++++-------------------
1 file changed, 34 insertions(+), 28 deletions(-)
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
--
1.7.10
From 4e108d08f5029493929f4dd51e099300d0dcc7ee Mon Sep 17 00:00:00 2001
From: Ivan Timofeev <timofeev.i.s@gmail.com>
Date: Thu, 7 Jun 2012 22:34:01 +0400
Subject: [PATCH 3/3] fdo#35972: toolbarmanager must be aware of changes in
SvtMiscOptions
(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
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.