[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sc/sdi sc/source
Gulsah Kose
gulsah.1004 at gmail.com
Thu Jun 1 14:31:26 UTC 2017
sc/sdi/formatsh.sdi | 2 +-
sc/source/ui/view/formatsh.cxx | 11 ++++++++++-
sc/source/ui/view/tabview3.cxx | 1 +
3 files changed, 12 insertions(+), 2 deletions(-)
New commits:
commit 9c7e9cbdaf06b0bbd1f8a476e77b9a3172c99ef6
Author: Gulsah Kose <gulsah.1004 at gmail.com>
Date: Tue May 30 15:45:24 2017 +0300
tdf#86119 Fix toggle behaviour of SID_NUMBER_STANDARD.
Change-Id: I718869c92a3a03c05b8db3fe665f5502202f434b
Signed-off-by: Gulsah Kose <gulsah.1004 at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/38217
Tested-by: Jenkins <ci at libreoffice.org>
(cherry picked from commit 82beda528fb74ae1c6b5e12a98dbf5d4e9e4c0db)
Reviewed-on: https://gerrit.libreoffice.org/38233
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
More information about the Libreoffice-commits
mailing list