sc/qa/unit/subsequent_export_test3.cxx | 3 +-- sc/source/filter/oox/sheetdatabuffer.cxx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
New commits: commit 16d43b7c5396d6382926d514dc9ce10b3ce94cba Author: Paris Oplopoios <paris.oplopo...@collabora.com> AuthorDate: Mon Aug 28 20:40:33 2023 +0300 Commit: Paris Oplopoios <parisop...@gmail.com> CommitDate: Mon Aug 28 22:12:43 2023 +0200 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 <parisop...@gmail.com> diff --git a/sc/qa/unit/subsequent_export_test3.cxx b/sc/qa/unit/subsequent_export_test3.cxx index ff8a27727a1b..45e65cf8bed8 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 76721ded0d17..d1410eb04970 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 ) ) {