summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-25 01:48:21 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-25 01:51:06 +0100
commitd9c1921c5031e5b372ee9d8db1e00fe7211cdd31 (patch)
tree6908385f51c9e656603ec87ff7bba24ab041e394
parent4518faa31dec03ffabee30437e6960558a940957 (diff)
use the ScRefCellValue that is already available, tdf#93405
Change-Id: I68a2ddbe5049d10b5c11c2d77b26dce8dc55ab28
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx18
1 files changed, 13 insertions, 5 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index e4e45c7e79a7..bf1955218f86 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -213,20 +213,28 @@ OUString lcl_RangeSequenceToString(
return aResult.makeStringAndClear();
}
-OUString lcl_GetFormattedString( ScDocument* pDoc, const ScAddress& rPos )
+OUString lcl_GetFormattedString(ScDocument* pDoc, ScRefCellValue& rCell, const ScAddress& rAddr)
{
// return text/edit cell string content, with line feeds in edit cells
if (!pDoc)
return EMPTY_OUSTRING;
- switch (pDoc->GetCellType(rPos))
+ switch (rCell.meType)
{
case CELLTYPE_STRING:
- return pDoc->GetString(rPos);
+ {
+ OUString aStr;
+ Color* pColor;
+ SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+
+ sal_uLong nFormat = pDoc->GetNumberFormat(rAddr);
+ ScCellFormat::GetString(rCell, nFormat, aStr, &pColor, *pFormatter, pDoc);
+ return aStr;
+ }
case CELLTYPE_EDIT:
{
- const EditTextObject* pData = pDoc->GetEditText(rPos);
+ const EditTextObject* pData = rCell.mpEditText;
if (!pData)
return EMPTY_OUSTRING;
@@ -3095,7 +3103,7 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount)
break;
case table::CellContentType_TEXT :
{
- OUString sFormattedString(lcl_GetFormattedString(pDoc, aCell.maCellAddress));
+ OUString sFormattedString(lcl_GetFormattedString(pDoc, aCell.maBaseCell, aCell.maCellAddress));
OUString sCellString = aCell.maBaseCell.getString(pDoc);
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
sCellString, sFormattedString);