summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
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;