summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParis Oplopoios <paris.oplopoios@collabora.com>2023-08-28 20:40:33 +0300
committerParis Oplopoios <parisoplop@gmail.com>2023-08-28 22:12:43 +0200
commit16d43b7c5396d6382926d514dc9ce10b3ce94cba (patch)
treefa7bfdbbfd3cb0c90a53cb4d9f88bb35439c35d0
parentfcb42f363bd1212bebb880d265c95d28deac84f3 (diff)
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>
-rw-r--r--sc/qa/unit/subsequent_export_test3.cxx3
-rw-r--r--sc/source/filter/oox/sheetdatabuffer.cxx2
2 files changed, 2 insertions, 3 deletions
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 ) )
{