sc/qa/unit/subsequent_export_test.cxx    |    3 +--
 sc/source/filter/oox/sheetdatabuffer.cxx |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit f6740f0c3b9af9d6e3227e7ce0776147eb6219a9
Author:     Paris Oplopoios <paris.oplopo...@collabora.com>
AuthorDate: Mon Aug 28 20:40:33 2023 +0300
Commit:     Paris Oplopoios <parisop...@gmail.com>
CommitDate: Tue Aug 29 09:50:15 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/+/156210
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Paris Oplopoios <parisop...@gmail.com>

diff --git a/sc/qa/unit/subsequent_export_test.cxx 
b/sc/qa/unit/subsequent_export_test.cxx
index 1d4285346f61..cbbc99de69d8 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -3877,8 +3877,7 @@ void ScExportTest::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");
 }
 
 void ScExportTest::testHiddenShapeXLS()
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx 
b/sc/source/filter/oox/sheetdatabuffer.cxx
index 624772ef263e..1b4f9cf719d8 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 ) )
     {

Reply via email to