diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2014-05-11 01:53:30 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2014-05-14 12:39:41 +0300 |
commit | b07377b3effd8b64054f923be99cde65e663f025 (patch) | |
tree | 33e9deb821c2687702ecad5b67bb43148cf18e61 | |
parent | fb33f0d898d371401a0efeba04713cd73efe2836 (diff) |
Revert "fdo#77683 the color in the toolbar buttons doesn't change."
This reverts commit f5dc536eae7dc28e09112ab9dd69e55fae015ee8.
This commit actually created a regression. A split button supposed
to show the last used color, not the current one.
I'll try to solve fdo#77683 in a different way, in a following commit.
Change-Id: I5df1ce49995e4755f54af977ca25d4e4dfdee629
-rw-r--r-- | include/svx/tbcontrl.hxx | 1 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index 22c1c5ecf432..94868eaae8a3 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -269,6 +269,7 @@ class SVX_DLLPUBLIC SvxColorExtToolBoxControl : public SfxToolBoxControl ::svx::ToolboxButtonColorUpdater* pBtnUpdater; Color mLastColor; + bool bChoiceFromPalette; public: SFX_DECL_TOOLBOX_CONTROL(); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 2d1e733b9ac8..2c222941f25f 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2482,6 +2482,7 @@ SvxColorExtToolBoxControl::SvxColorExtToolBoxControl( mLastColor( COL_AUTO ) { rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) ); + bChoiceFromPalette = false; // The following commands are available at the various modules switch( nSlotId ) @@ -2558,6 +2559,7 @@ SfxPopupWindow* SvxColorExtToolBoxControl::CreatePopupWindow() FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_ALLOWTEAROFF|FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); pColorWin->StartSelection(); SetPopupWindow( pColorWin ); + bChoiceFromPalette = true; return pColorWin; } @@ -2575,10 +2577,13 @@ void SvxColorExtToolBoxControl::StateChanged( rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState ); rTbx.SetItemState( nId, ( SFX_ITEM_DONTCARE == eState ) ? TRISTATE_INDET : TRISTATE_FALSE ); - if ( SFX_ITEM_DEFAULT == eState ) + if (bChoiceFromPalette) { + bChoiceFromPalette = false; + const SvxColorItem* pItem = 0; - pItem = PTR_CAST( SvxColorItem, pState ); + if ( SFX_ITEM_DONTCARE != eState ) + pItem = PTR_CAST( SvxColorItem, pState ); if ( pItem ) { |