summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-11-21 15:24:56 +0100
committerEike Rathke <erack@redhat.com>2017-11-21 15:25:45 +0100
commitba9833a1d63747eaa5124271a1ac51cb926bce7a (patch)
tree7637854f19e2801cdeb30078f12ab302070af22a /sc
parentf2f0a7c5a9d8185fedef5c737d1b7479b9fc0c1e (diff)
Keep number format on string cell content Undo, tdf#103234 follow-up
Change-Id: I18c281211e6eeb4816da13972c360df85d577491
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/stringutil.hxx6
-rw-r--r--sc/source/ui/undo/undocell.cxx2
2 files changed, 8 insertions, 0 deletions
diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index e02c06bc392c..e44bdcc84e39 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -47,6 +47,12 @@ struct SAL_WARN_UNUSED SC_DLLPUBLIC ScSetStringParam
SpecialNumberOnly,
/**
+ * Keep an existing number format, do not set Text number format and do
+ * not set another number format.
+ */
+ Keep,
+
+ /**
* Never set Text number format.
*/
Never
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 129d2fc43191..5c10cd3282aa 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -457,6 +457,8 @@ void ScUndoSetCell::SetValue( const ScCellValue& rVal )
{
ScSetStringParam aParam;
aParam.setTextInput();
+ // Undo only cell content, without setting any number format.
+ aParam.meSetTextNumFormat = ScSetStringParam::Keep;
rDoc.SetString(maPos, rVal.mpString->getString(), &aParam);
}
break;