summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2017-05-30 15:45:24 +0300
committerGülşah Köse <gulsah.1004@gmail.com>2017-05-30 19:41:40 +0200
commit82beda528fb74ae1c6b5e12a98dbf5d4e9e4c0db (patch)
tree2153619e1b072bf2c31cbccca0bde03518053bd8
parent4c5ce12608526e76d90a400fa3f499ab83528e90 (diff)
tdf#86119 Fix toggle behaviour of SID_NUMBER_STANDARD.
Change-Id: I718869c92a3a03c05b8db3fe665f5502202f434b Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/38217 Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sc/sdi/formatsh.sdi2
-rw-r--r--sc/source/ui/view/formatsh.cxx11
-rw-r--r--sc/source/ui/view/tabview3.cxx1
3 files changed, 12 insertions, 2 deletions
diff --git a/sc/sdi/formatsh.sdi b/sc/sdi/formatsh.sdi
index 3663955aadfa..54771a8dbb80 100644
--- a/sc/sdi/formatsh.sdi
+++ b/sc/sdi/formatsh.sdi
@@ -110,7 +110,7 @@ interface FormatForSelection
SID_NUMBER_CURRENCY [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
SID_NUMBER_PERCENT [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
SID_NUMBER_TIME [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
- SID_NUMBER_STANDARD [ ExecMethod = ExecuteNumFormat;]
+ SID_NUMBER_STANDARD [ ExecMethod = ExecuteNumFormat; StateMethod = GetNumFormatState; ]
SID_NUMBER_INCDEC [ ExecMethod = ExecuteNumFormat;]
SID_NUMBER_DECDEC [ ExecMethod = ExecuteNumFormat;]
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 259338a37ab4..cef3eab48bc3 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1127,7 +1127,9 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
rReq.Done();
break;
case SID_NUMBER_STANDARD:
- pTabViewShell->SetNumberFormat( css::util::NumberFormat::NUMBER );
+ if (!(nType & css::util::NumberFormat::NUMBER))
+ pTabViewShell->SetNumberFormat( css::util::NumberFormat::NUMBER );
+ rBindings.Invalidate( nSlot );
rReq.Done();
break;
case SID_NUMBER_INCDEC:
@@ -2637,6 +2639,13 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
rSet.Put( SfxBoolItem(nWhich, (nType & css::util::NumberFormat::NUMBER) && nNumberFormat == 4 ) );
}
break;
+ case SID_NUMBER_STANDARD:
+ {
+ const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet();
+ sal_uInt32 nNumberFormat = static_cast<const SfxUInt32Item&>(rAttrSet.Get(ATTR_VALUE_FORMAT)).GetValue();
+ rSet.Put( SfxBoolItem(nWhich, (nType & css::util::NumberFormat::NUMBER) && nNumberFormat == 0 ) );
+ }
+ break;
}
nWhich = aIter.NextWhich();
}
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 429f34e1017e..de638447b567 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -322,6 +322,7 @@ void ScTabView::InvalidateAttribs()
rBindings.Invalidate( SID_NUMBER_PERCENT );
rBindings.Invalidate( SID_NUMBER_TWODEC );
rBindings.Invalidate( SID_NUMBER_TIME );
+ rBindings.Invalidate( SID_NUMBER_STANDARD );
}
// SetCursor - Cursor, set, draw, update InputWin