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-06-01 16:30:44 +0200
commit9c7e9cbdaf06b0bbd1f8a476e77b9a3172c99ef6 (patch)
treedb9e2508e4cf009e941d382942e8a750e64a7a0d
parent509029dd9583a4b3328ad72b91054ff8b54d5535 (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> (cherry picked from commit 82beda528fb74ae1c6b5e12a98dbf5d4e9e4c0db) Reviewed-on: https://gerrit.libreoffice.org/38233
-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 25421ad60c52..390e8ef37a53 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