diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-09-02 14:39:04 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-09-04 11:42:05 +0300 |
commit | 3317b1f7eec887f4ed1303ef0ab8b43acd200f60 (patch) | |
tree | db42acf0d3ef83993965e4321c14ea1e75458e4e | |
parent | a57f8cb0709f7f2ff0aaf6f5be06f59c4d859074 (diff) |
Restore the toggle state of the currency button
Change-Id: Ibe7d8b183038c4a925282ccab1b637342a714712
-rw-r--r-- | include/svx/tbcontrl.hxx | 2 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 2 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 12 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 15 |
4 files changed, 3 insertions, 28 deletions
diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index 34e5563ca31f..662a9fb58c7b 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -304,8 +304,6 @@ public: virtual ~SvxCurrencyToolBoxControl(); virtual void Select( sal_uInt16 nSelectModifier ) override; virtual VclPtr<SfxPopupWindow> CreatePopupWindow() override; - virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) override; }; diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 77add5ae1996..c371c283bb35 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -3773,7 +3773,7 @@ SfxVoidItem NumberFormatCurrency SID_NUMBER_CURRENCY Container = FALSE, RecordAbsolute = FALSE, RecordPerSet; - SlotType = SfxUInt32Item + SlotType = SfxBoolItem AccelConfig = TRUE, MenuConfig = TRUE, diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 2fcce12b0741..8794ba12b2a0 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2584,17 +2584,7 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet ) } break; case SID_NUMBER_CURRENCY: - { - const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet(); - if( SfxItemState::DONTCARE != rAttrSet.GetItemState( ATTR_VALUE_FORMAT ) ) - { - sal_uInt32 nNumberFormat = static_cast<const SfxUInt32Item&>( - rAttrSet.Get( ATTR_VALUE_FORMAT ) ).GetValue(); - rSet.Put( SfxUInt32Item( nWhich, nNumberFormat ) ); - } - else - rSet.InvalidateItem( nWhich ); - } + rSet.Put( SfxBoolItem(nWhich, (nType & css::util::NumberFormat::CURRENCY)) ); break; case SID_NUMBER_SCIENTIFIC: rSet.Put( SfxBoolItem(nWhich, (nType & css::util::NumberFormat::SCIENTIFIC)) ); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 757a15b2cd44..2670db97e772 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -119,7 +119,7 @@ SFX_IMPL_TOOLBOX_CONTROL( SvxFontNameToolBoxControl, SvxFontItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFrameToolBoxControl, SvxBoxItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineStyleToolBoxControl, SvxLineItem ); SFX_IMPL_TOOLBOX_CONTROL( SvxSimpleUndoRedoController, SfxStringItem ); -SFX_IMPL_TOOLBOX_CONTROL( SvxCurrencyToolBoxControl, SfxUInt32Item ); +SFX_IMPL_TOOLBOX_CONTROL( SvxCurrencyToolBoxControl, SfxBoolItem ); class SvxStyleBox_Impl : public ComboBox { @@ -3058,19 +3058,6 @@ void SvxCurrencyToolBoxControl::Select( sal_uInt16 nSelectModifier ) aArgs ); } -void SvxCurrencyToolBoxControl::StateChanged( - sal_uInt16, SfxItemState eState, const SfxPoolItem* ) -{ - sal_uInt16 nId = GetId(); - ToolBox& rTbx = GetToolBox(); - - rTbx.EnableItem( nId, SfxItemState::DISABLED != eState ); - rTbx.SetItemState( nId, (SfxItemState::DONTCARE == eState) - ? TRISTATE_INDET - : TRISTATE_FALSE ); -} - - static void lcl_CalcSizeValueSet( vcl::Window &rWin, ValueSet &rValueSet, const Size &aItemSize ) { Size aSize = rValueSet.CalcWindowSizePixel( aItemSize ); |