diff options
Diffstat (limited to 'sc/source/core/tool/cellform.cxx')
-rw-r--r-- | sc/source/core/tool/cellform.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index 3e155173cdc6..804088dcfcf6 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 @@ -268,4 +269,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: */ |