sc/qa/unit/subsequent_export_test2.cxx | 2 +- sc/source/filter/xml/xmlcelli.cxx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
New commits: commit 8f5f0c754222425af019a9fdc1ba47d72c541d9e Author: Justin Luth <jl...@mail.com> AuthorDate: Tue Sep 20 14:28:19 2022 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Wed Sep 21 19:27:44 2022 +0200 tdf#75702 ODS import: send text:line-break to editeng A cell with a line-break specified is no longer a simple string, so send the string to editeng where it can be properly displayed. This already works fine for XLS and XLSX. This change effectively means that text:line-break will disappear, and become two separate paragraphs. Given the nature of spreadsheets, the precidence in various other patches and the failure to properly display without this, I think I'm fine with unilaterally changing one paragraph into two. Change-Id: I7abcbc6f698a4cb319aea5465a8b0393cf63f31f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140262 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 7bbb908a96fb..cadc2da0d595 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -1456,7 +1456,7 @@ void ScExportTest2::testTdf75702() xmlDocUniquePtr pContent = XPathHelper::parseExport2(*this, *xShell, m_xSFactory, "content.xml", FORMAT_ODS); - assertXPath(pContent, "//table:table-row[1]/table:table-cell/text:p/text:line-break"); + assertXPath(pContent, "//table:table-row[1]/table:table-cell/text:p", 2); } void ScExportTest2::testTdf103829() diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index e7a8037cd7eb..29450409e608 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -47,6 +47,7 @@ #include "editattributemap.hxx" #include <tokenarray.hxx> #include <scmatrix.hxx> +#include <stringutil.hxx> #include <documentimport.hxx> #include <externalrefmgr.hxx> @@ -612,7 +613,7 @@ void ScXMLTableRowCellContext::PushParagraphEnd() } mpEditEngine->InsertParagraph(mpEditEngine->GetParagraphCount(), maParagraph.makeStringAndClear()); } - else if (mbHasFormatRuns) + else if (mbHasFormatRuns || ScStringUtil::isMultiline(maParagraph)) { mpEditEngine->Clear(); mpEditEngine->SetTextCurrentDefaults(maParagraph.makeStringAndClear());