Shared string shouldn't account preserve space property
XLSX documents opened in Excel don't seem to account for the
xml:space="preserve" value for whether the string is single line or not
The test that was changed seems to have more accurate behavior now,
where the second cell does not have multiple lines (like in Excel)
Change-Id: Iad8f351c19102249e2cb1e1d063c8690dfb3d753
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156206
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
diff --git a/sc/qa/unit/subsequent_export_test3.cxx b/sc/qa/unit/subsequent_export_test3.cxx
index ff8a277..45e65cf 100644
--- a/sc/qa/unit/subsequent_export_test3.cxx
+++ b/sc/qa/unit/subsequent_export_test3.cxx
@@ -1424,8 +1424,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testPreserveTextWhitespace2XLSX)
xmlDocUniquePtr pDoc = parseExport("xl/sharedStrings.xml");
CPPUNIT_ASSERT(pDoc);
assertXPath(pDoc, "/x:sst/x:si[1]/x:t", "space", "preserve");
assertXPath(pDoc, "/x:sst/x:si[2]/x:r[1]/x:t", "space", "preserve");
assertXPath(pDoc, "/x:sst/x:si[2]/x:r[2]/x:t", "space", "preserve");
assertXPath(pDoc, "/x:sst/x:si[2]/x:t", "space", "preserve");
}
CPPUNIT_TEST_FIXTURE(ScExportTest3, testHiddenShapeXLS)
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 76721de..d1410eb 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -122,7 +122,7 @@ void SheetDataBuffer::setStringCell( const CellModel& rModel, const RichStringRe
OSL_ENSURE( rxString, "SheetDataBuffer::setStringCell - missing rich string object" );
const oox::xls::Font* pFirstPortionFont = getStyles().getFontFromCellXf( rModel.mnXfId ).get();
const Xf* pXf = getStyles().getCellXf( rModel.mnXfId ).get();
bool bSingleLine = pXf ? !rxString->isPreserveSpace() && !pXf->getAlignment().getModel().mbWrapText : false;
bool bSingleLine = pXf ? !pXf->getAlignment().getModel().mbWrapText : false;
OUString aText;
if( rxString->extractPlainString( aText, pFirstPortionFont ) )
{