summaryrefslogtreecommitdiff
path: root/sc/source/core/tool
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-15 10:12:58 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-04-15 15:46:07 +0000
commiteec62f3d823048c9b3b767cb7de72650a40b73cd (patch)
tree223fd807188f80f11be87a792d00233805d357f2 /sc/source/core/tool
parent1f87e2e837b4e35b909bf68ccdd3cefd84253940 (diff)
fdo#76409: Write output cell string to <text:p> element when saving to ods.
The change was made by accident. Change-Id: Ife2461b0fca6e3ea5a65d72d985d1e0976737b5a (cherry picked from commit a0752fa4246dc71b64907c679657a1af3cb617e1) Reviewed-on: https://gerrit.libreoffice.org/9014 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r--sc/source/core/tool/cellform.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 6a23ba238f05..d96430af0f7e 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -29,6 +29,7 @@
#include "cellvalue.hxx"
#include "formula/errorcodes.hxx"
#include "sc.hrc"
+#include <editutil.hxx>
// STATIC DATA
// Err527 Workaround
@@ -266,4 +267,35 @@ void ScCellFormat::GetInputString(
rString = aString;
}
+OUString ScCellFormat::GetOutputString( ScDocument& rDoc, const ScAddress& rPos, ScRefCellValue& rCell )
+{
+ if (rCell.isEmpty())
+ return EMPTY_OUSTRING;
+
+ OUString aVal;
+
+ if (rCell.meType == CELLTYPE_EDIT)
+ {
+ // GetString an der EditCell macht Leerzeichen aus Umbruechen,
+ // hier werden die Umbrueche aber gebraucht
+ const EditTextObject* pData = rCell.mpEditText;
+ if (pData)
+ {
+ ScFieldEditEngine& rEngine = rDoc.GetEditEngine();
+ rEngine.SetText(*pData);
+ aVal = rEngine.GetText(LINEEND_LF);
+ }
+ // Edit-Zellen auch nicht per NumberFormatter formatieren
+ // (passend zur Ausgabe)
+ }
+ else
+ {
+ // wie in GetString am Dokument (column)
+ Color* pColor;
+ sal_uLong nNumFmt = rDoc.GetNumberFormat(rPos);
+ aVal = GetString(rDoc, rPos, nNumFmt, &pColor, *rDoc.GetFormatTable());
+ }
+ return aVal;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */