core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa
sw/qa/extras/uiwriter/uiwriter.cxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit 517df06183508742ae1f3640b28af65fc0069b79 Author: Michael Stahl AuthorDate: Thu Mar 14 13:13:36 2024 +0100 Commit: Michael Stahl CommitDate: Thu Mar 14 13:14:27 2024 +0100 sw: oops, forgot to commit test changes Change-Id: I8cde7ee17d1e717bf2228affe6f88d3461e4b5b3 diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index c3b5c0d98dac..d1b117f6a467 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -813,7 +813,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) SwDoc * pDoc(createDoc("pagebreak-source.fodt")); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); -CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); +CPPUNIT_ASSERT_EQUAL(long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->SelAll(); @@ -833,7 +833,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(OUString("TargetSection"), pWrtShell->GetCurrSection()->GetSectionName()); // page style WithMargin is used -CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); +CPPUNIT_ASSERT_EQUAL(long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); //paste not working in this branch? lcl_dispatchCommand(mxComponent, ".uno:Paste", {}); TransferableDataHelper aHelper(pTransfer.get()); @@ -846,7 +846,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) // the problem was that there was a page break now CPPUNIT_ASSERT_EQUAL(1, getPages()); // page style WithMargin is used -CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); +CPPUNIT_ASSERT_EQUAL(long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->Undo(); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); @@ -854,7 +854,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) CPPUNIT_ASSERT_EQUAL(OUString("TargetSection"), pWrtShell->GetCurrSection()->GetSectionName()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // page style WithMargin is used -CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); +CPPUNIT_ASSERT_EQUAL(long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->Redo(); CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); @@ -863,7 +863,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) CPPUNIT_ASSERT_EQUAL(OUString("SourceSection"), pWrtShell->GetCurrSection()->GetSectionName()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // page style WithMargin is used -CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); +CPPUNIT_ASSERT_EQUAL(long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->Undo(); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); @@ -871,7 +871,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) CPPUNIT_ASSERT_EQUAL(OUString("TargetSection"), pWrtShell->GetCurrSection()->GetSectionName()); CPPUNIT_ASSERT_EQUAL(1, getPages()); // page style WithMargin is used -CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); +CPPUNIT_ASSERT_EQUAL(long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); } void SwUiWriterTest::testBookmarkCopy()
core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa sw/source
sw/qa/extras/uiwriter/data/pagebreak-source.fodt | 12 ++-- sw/qa/extras/uiwriter/data/pagebreak-target.fodt | 12 ++-- sw/qa/extras/uiwriter/uiwriter.cxx | 22 +- sw/source/core/layout/pagechg.cxx|6 +- 4 files changed, 42 insertions(+), 10 deletions(-) New commits: commit 391b620507d137f50aad2fe84d42583b62761e28 Author: Michael Stahl AuthorDate: Wed Mar 13 09:38:00 2024 +0100 Commit: Michael Stahl CommitDate: Wed Mar 13 14:15:29 2024 +0100 sw: layout: use page style set on hidden paragraph SwPageFrame::FindPageDesc() now ignores paragraphs hidden for any reason, but to maintain layout compatibility it should only ignore paragraphs in a hidden section, not paragraphs hidden by fields. (regression from commit 0c96119895b347f8eb5bb89f393351bd3c02b9f1) Change-Id: Iad5e76f5cc437d35b4ae9bde6bc9b73dbe32bf3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164761 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 7335babda93974104a39202c434e9499b8086f3a) diff --git a/sw/qa/extras/uiwriter/data/pagebreak-source.fodt b/sw/qa/extras/uiwriter/data/pagebreak-source.fodt index e09c1b447cfd..cb72fea62a85 100644 --- a/sw/qa/extras/uiwriter/data/pagebreak-source.fodt +++ b/sw/qa/extras/uiwriter/data/pagebreak-source.fodt @@ -85,7 +85,7 @@ - + @@ -101,9 +101,17 @@ + + + + + + + + @@ -120,4 +128,4 @@ - \ No newline at end of file + diff --git a/sw/qa/extras/uiwriter/data/pagebreak-target.fodt b/sw/qa/extras/uiwriter/data/pagebreak-target.fodt index f059e33f1514..1219cdd95e25 100644 --- a/sw/qa/extras/uiwriter/data/pagebreak-target.fodt +++ b/sw/qa/extras/uiwriter/data/pagebreak-target.fodt @@ -86,7 +86,7 @@ - + @@ -104,9 +104,17 @@ + + + + + + + + @@ -126,4 +134,4 @@ - \ No newline at end of file + diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 9e1a8c4c3b50..c3b5c0d98dac 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -811,7 +811,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) rtl::Reference pTransfer; { SwDoc * pDoc(createDoc("pagebreak-source.fodt")); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->SelAll(); @@ -828,38 +830,48 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testCopyPastePageBreak) SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); -CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty(getParagraph(1), "PageDescName")); +CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(OUString("TargetSection"), pWrtShell->GetCurrSection()->GetSectionName()); +// page style WithMargin is used +CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); //paste not working in this branch? lcl_dispatchCommand(mxComponent, ".uno:Paste", {}); TransferableDataHelper aHelper(pTransfer.get()); SwTransferable::Paste(*pWrtShell, aHelper); CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); -CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty(getParagraph(1), "PageDescName")); +CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetSections().size()); CPPUNIT_ASSERT_EQUAL(OUString("SourceSection"), pWrtShell->GetCurrSection()->GetSectionName()); // the problem was that there was a page break now CPPUNIT_ASSERT_EQUAL(1, getPages()); +// page style WithMargin is used +CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->Undo(); CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); -CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty(getParagraph(1), "PageDescName")); +CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty(getParagraph(1), "PageDescName")); CPPUNIT_ASSERT_EQUAL(OUString("TargetSection"), pWrtShell->GetCurrSection()->GetSectionName()); CPPUNIT_ASSERT_EQUAL(1, getPages()); +// page style WithMargin is used +CPPUNIT_ASSERT_EQUAL(tools::Long(5669), pWrtShell->GetLayout()->GetLower()->getFramePrintArea().Top()); pWrtShell->Redo(); CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); -CPPUNIT_ASSERT_EQUAL(OUString("Standard"), getProperty(getParagraph(1), "PageDescName")); +CPPUNIT_ASSERT_EQUAL(OUString("WithMargin"), getProperty(getParagraph(1),
core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa sw/source
sw/qa/extras/layout/data/table-0-height-rows.fodt | 611 ++ sw/qa/extras/layout/layout.cxx| 14 sw/source/core/layout/tabfrm.cxx | 118 3 files changed, 742 insertions(+), 1 deletion(-) New commits: commit f7c74f6605bad0d278e3c4042ddc333b9602bc7a Author: Michael Stahl AuthorDate: Wed Jan 17 16:56:38 2024 +0100 Commit: Michael Stahl CommitDate: Thu Jan 18 13:43:00 2024 +0100 sw: layout: prevent bad page break in table with 0-height rows The bugdoc contains a table with most rows having a hidden-paragraph field in every paragraph, and no cell border or padding. The SwTabFrame is initially split across 6 pages, which should all be joined, as there are only 3 visible rows, but the last follow is never joined. This is because SwTabFrame::Join() of the next-to-last follow doesn't invalidate the SwTabFrame, because Grow(0) doesn't invalidate, and later formatting anything in the moved SwRowFrame doesn't invalidate either as it is all height 0. Try to fix this by guessing that the row will have height 0 (even if it's not formatted yet). Change-Id: Ic8246ac91c741f5a215f89dc159c44d7c7cf2ce1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162203 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit ab7893544dc6be6dc192dffefd57cd5ddd421c35) diff --git a/sw/qa/extras/layout/data/table-0-height-rows.fodt b/sw/qa/extras/layout/data/table-0-height-rows.fodt new file mode 100644 index ..c73991490249 --- /dev/null +++ b/sw/qa/extras/layout/data/table-0-height-rows.fodt @@ -0,0 +1,611 @@ + +http://openoffice.org/2009/office; xmlns:css3t="http://www.w3.org/TR/css3-text/; xmlns:grddl="http://www.w3.org/2003/g/data-view#; xmlns:xhtml="http://www.w3.org/1999/xhtml; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd="http://www.w3.org/2001/XMLSchema; xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:rpt="http://openoffice.org/2005/report; xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink; xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:dc="http://purl.org/dc/eleme nts/1.1/" xmlns:ooo="http://openoffice.org/2004/office; xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw; xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer; xmlns:oooc="http://openoffice.org/2004/calc; xmlns:tableooo="http://openoffice.org/2009/table; xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML; xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0 " xmlns:dom="http://www.w3.org/2001/xml-events; xmlns:xforms="http://www.w3.org/2002/xforms; office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa sw/source
sw/qa/extras/layout/data/s4_min2.fodt | 360 ++ sw/qa/extras/layout/layout.cxx| 12 + sw/source/core/layout/newfrm.cxx |5 3 files changed, 377 insertions(+) New commits: commit 57c5dc443068ebc4be83b5ebe375e5533ec0ad78 Author: Michael Stahl AuthorDate: Wed Jun 28 17:19:02 2023 +0200 Commit: Michael Stahl CommitDate: Wed Jun 28 18:42:11 2023 +0200 tdf#156077 sw: layout: call AssertFlyPages() in Init() The bugdoc has 3 pages, and there are at-page flys anchored to the 3rd page, and these are not displayed - simply missing from the layout. In LO 6.1, this worked because the layout-cache was read from the file, and 3 pages were created in SwRootFrame::Init() calling InsertCnt_(). But now this creates only 2 pages, and later SwLayAction creates the 2nd page between the existing ones on some MoveFwd(), but despite page nr 2 becoming page nr 3 nothing attaches the at-page flys to the now-page-3. If a document is loaded containing at-page flys, then all pages that have flys anchored to them should be created in SwRootFrame::Init() already. (regression from commit 7e8b4756d95057f069467b34e7849f9354856578) Change-Id: I4792c483a7620efd81211e6ad0d9220152367d68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153720 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit ff8ec4cfe5df1e15c3e9f6adc843dfe31358e097) diff --git a/sw/qa/extras/layout/data/s4_min2.fodt b/sw/qa/extras/layout/data/s4_min2.fodt new file mode 100644 index ..e1317de597d8 --- /dev/null +++ b/sw/qa/extras/layout/data/s4_min2.fodt @@ -0,0 +1,360 @@ + +http://www.w3.org/1999/xlink; xmlns:dc="http://purl.org/dc/elements/1.1/; xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML; xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oas is:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office; xmlns:ooow="http://openoffice.org/2004/writer; xmlns:oooc="http://openoffice.org/2004/calc; xmlns:dom="http://www.w3.org/2001/xml-events; xmlns:xforms="http://www.w3.org/2002/xforms; xmlns:xsd="http://www.w3.org/2001/XMLSchema; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xmlns:rpt="http://openoffice.org/2005/report; xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml; xmlns:grddl="http://www.w3.org/2003/g/data-view#; xmlns:officeooo="http://openoffice.org/2009/office; xmlns:tableooo="http://openoffice.org/2009/table; xmlns:drawooo="http://openoffice.org/2010/draw; xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names: experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/; office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text"> + CIB_OfficeDev/6.1.7.41$Linux_X86_64 LibreOffice_project/1df0ab666a1bb346850daa72aaa2e29a697a252c2023-06-26T22:28:03.054604345de-DE11PT14M3S2023-06-26T23:06:43.147312212 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +- 2- + + + + + + + + + + +
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa sw/source
sw/qa/extras/layout/data/three_sections.fodt | 18 ++ sw/qa/extras/layout/layout.cxx | 43 ++ sw/source/core/inc/sectfrm.hxx |2 sw/source/core/layout/frmtool.cxx| 63 +++-- sw/source/core/layout/layhelp.hxx|3 + sw/source/core/layout/sectfrm.cxx| 79 ++- 6 files changed, 129 insertions(+), 79 deletions(-) New commits: commit eae41835161a90bf395ea29559db953fb5b820e2 Author: Mike Kaganski AuthorDate: Thu Apr 20 11:18:34 2023 +0300 Commit: Michael Stahl CommitDate: Tue Jun 27 16:57:03 2023 +0200 tdf#154113: do not forget to split the outermost section frame ... when the inserted section node is not the first one. The very first frame, where InsertCnt_ puts content to, may already have some content after the insertion position. When an inner section ends, the current section needs a new frame, and the rest of content must go to that new frame. Previously, the new empty frame was created without taking the content move into account. This moves the split into the single place inside InsertCnt_, to avoid special processing in MakeFrames. Change-Id: I1335ebbc620af0f2b064141e8267e5bd1af0b195 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150675 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry-picked from commit efb3c57851d29440ef086c68a6c1ddbb8bc8fc00) Change-Id: I021d868835b85226ab62ed8728c8aacdaf8e4528 diff --git a/sw/qa/extras/layout/data/three_sections.fodt b/sw/qa/extras/layout/data/three_sections.fodt new file mode 100644 index ..9233fed89085 --- /dev/null +++ b/sw/qa/extras/layout/data/three_sections.fodt @@ -0,0 +1,18 @@ + + + + + + Select the text below, copy to clipboard, and paste from clipboard, replacing the selection. + +-- Start selection here. Section1 + + +Section2 + + +Section3. End selection here -- + + + + \ No newline at end of file diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index a6015fedaac3..6debcdbd0f17 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -4098,6 +4098,49 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134548) } } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf154113) +{ +createDoc("three_sections.fodt"); +Scheduler::ProcessEventsToIdle(); + +lcl_dispatchCommand(mxComponent, ".uno:GoToStartOfDoc", {}); +lcl_dispatchCommand(mxComponent, ".uno:GoToNextPara", {}); +lcl_dispatchCommand(mxComponent, ".uno:EndOfDocumentSel", {}); // to the end of current section! +lcl_dispatchCommand(mxComponent, ".uno:EndOfDocumentSel", {}); // to the end of the document. + +css::uno::Reference xModel(mxComponent, css::uno::UNO_QUERY_THROW); +css::uno::Reference xSelected(xModel->getCurrentSelection(), css::uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSelected->getCount()); +css::uno::Reference xRange (xSelected->getByIndex(0), css::uno::UNO_QUERY_THROW); + +//css::uno::Reference < css::uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT_EQUAL(OUString("<-- Start selection here. Section1" SAL_NEWLINE_STRING + "Section2" SAL_NEWLINE_STRING "Section3. End selection here -->"), + xRange->getString()); + +lcl_dispatchCommand(mxComponent, ".uno:Cut", {}); + +xSelected = css::uno::Reference (xModel->getCurrentSelection(), css::uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSelected->getCount()); +xRange = css::uno::Reference (xSelected->getByIndex(0), css::uno::UNO_QUERY_THROW); +CPPUNIT_ASSERT_EQUAL(OUString(), xRange->getString()); + +lcl_dispatchCommand(mxComponent, ".uno:Paste", {}); + +xmlDocPtr pXml = parseLayoutDump(); + +// Without the fix in place, this would fail with +// - Expected: 3 +// - Actual : 2 +assertXPath(pXml, "/root/page/body/section", 3); +assertXPath(pXml, "/root/page/body/section[1]/txt/LineBreak", "Line", +"<-- Start selection here. Section1"); +assertXPath(pXml, "/root/page/body/section[2]/txt/LineBreak", "Line", +"Section2"); +assertXPath(pXml, "/root/page/body/section[3]/txt/LineBreak", "Line", +"Section3. End selection here -->"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx index 3b890b385e2a..9f75c83cac7b 100644 --- a/sw/source/core/inc/sectfrm.hxx +++ b/sw/source/core/inc/sectfrm.hxx @@ -96,7 +96,7 @@ public: * Splits the SectionFrame surrounding the pFrame up in two parts: * pFrame and the start of the 2nd part */ -bool SplitSect( SwFrame* pFrame, bool bApres ); +SwSectionFrame* SplitSect( SwFrame* pFrameStartAfter,
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf155690.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport13.cxx| 47 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 ++ 3 files changed, 53 insertions(+) New commits: commit fb3948cc559528013e77549f3502c8c1c954b7f6 Author: Michael Stahl AuthorDate: Wed Jun 14 15:35:24 2023 +0200 Commit: Michael Stahl CommitDate: Wed Jun 14 17:02:26 2023 +0200 tdf#155690 writerfilter: fix import of bookmark in table... ... at start of section. (regression from commit 2e8aad6d45c53d554ccaf26de998ede708cfc289) Change-Id: I1e0e720758b607b69645b29c46f4092264289f9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153053 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 142aa77265361492e74707b08c5bcd366e7205ad) diff --git a/sw/qa/extras/ooxmlexport/data/tdf155690.docx b/sw/qa/extras/ooxmlexport/data/tdf155690.docx new file mode 100644 index ..1839862688ee Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf155690.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 62ad331a8c64..aa6d6e557e79 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -61,6 +61,53 @@ DECLARE_OOXMLEXPORT_TEST(testTdf126994_lostPageBreak, "tdf126994_lostPageBreak.d CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 3, getPages() ); } +DECLARE_OOXMLEXPORT_TEST(testTdf155690, "tdf155690.docx") +{ +uno::Reference xBookmarksSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xBookmarks = xBookmarksSupplier->getBookmarks(); +{ +uno::Reference xMark(xBookmarks->getByName("row1_1"), uno::UNO_QUERY); +CPPUNIT_ASSERT(xMark.is()); +// the problem was that the start was after the H +CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); +} +{ +uno::Reference xMark(xBookmarks->getByName("row1_2"), uno::UNO_QUERY); +CPPUNIT_ASSERT(xMark.is()); +CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); +} +{ +uno::Reference xMark(xBookmarks->getByName("row1_3"), uno::UNO_QUERY); +CPPUNIT_ASSERT(xMark.is()); +CPPUNIT_ASSERT_EQUAL(OUString("ello world"), xMark->getAnchor()->getString()); +} +{ +uno::Reference xMark(xBookmarks->getByName("row1_4"), uno::UNO_QUERY); +CPPUNIT_ASSERT(xMark.is()); +CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); +} +{ +uno::Reference xMark(xBookmarks->getByName("row2_1"), uno::UNO_QUERY); +CPPUNIT_ASSERT(xMark.is()); +CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); +} +{ +uno::Reference xMark(xBookmarks->getByName("row2_1"), uno::UNO_QUERY); +CPPUNIT_ASSERT(xMark.is()); +CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); +} +{ +uno::Reference xMark(xBookmarks->getByName("row2_3"), uno::UNO_QUERY); +CPPUNIT_ASSERT(xMark.is()); +CPPUNIT_ASSERT_EQUAL(OUString("ello world"), xMark->getAnchor()->getString()); +} +{ +uno::Reference xMark(xBookmarks->getByName("row2_4"), uno::UNO_QUERY); +CPPUNIT_ASSERT(xMark.is()); +CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); +} +} + DECLARE_OOXMLEXPORT_TEST(testTdf121374_sectionHF, "tdf121374_sectionHF.odt") { uno::Reference xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 049a644cbef8..22626bc8bf34 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -6003,6 +6003,9 @@ void DomainMapper_Impl::StartOrEndBookmark( const OUString& rId ) else { xCursor = xText->createTextCursorByRange( aBookmarkIter->second.m_xTextRange ); +} +if (!aBookmarkIter->second.m_bIsStartOfText) +{ xCursor->goRight( 1, false ); } @@ -6131,6 +6134,9 @@ void DomainMapper_Impl::startOrEndPermissionRange(sal_Int32 permissinId) else { xCursor = xText->createTextCursorByRange(aPermIter->second.m_xTextRange); +} +if (!aPermIter->second.m_bIsStartOfText) +{ xCursor->goRight(1, false); }
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa
sw/qa/extras/ooxmlexport/ooxmlexport8.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 413a520c440d5cfa9f7f33568b9d3018a82c7714 Author: Michael Stahl AuthorDate: Tue Apr 18 13:28:42 2023 +0200 Commit: Michael Stahl CommitDate: Tue Apr 18 13:43:17 2023 +0200 sw: disable testN830205 on this branch The problem is that since commit de49e1c55dc10ce1b59345af5cc49fde3adf65b7 "tdf#149548 sw: don't rely on binary search in SplitRedline()" the test asserts, but only with --enable-dbgutil: sw/source/core/doc/DocumentRedlineManager.cxx:110: void {anonymous}::lcl_CheckRedline(IDocumentRedlineAccess&): Assertion `std::is_sorted(rTable.begin(), rTable.end(), CompareSwRedlineTable())' failed. The elements 237/238 are not sorted by end position as they should be. They were disordered by a TextToTable() via SplitRedline(). This was not asserting before the commit was backported, but that was probably an accident. It's not obvious what fixed this because it doesn't happen on 7.4 or later. Change-Id: I866aee29ac58bd224c86ee29e020bf65d75355cb diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index fbe8d9d01421..2647b12bcde5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -1019,11 +1019,13 @@ DECLARE_OOXMLEXPORT_TEST(testN820509, "n820509.docx") CPPUNIT_ASSERT_EQUAL(OUString("M.d."), sDateFormat); } +#if 0 DECLARE_OOXMLEXPORT_TEST(testN830205, "n830205.docx") { // Previously import just crashed (due to infinite recursion). getParagraph(1, "XXX"); } +#endif DECLARE_OOXMLEXPORT_TEST(tdf123705, "tdf123705.docx") {
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa sw/source
sw/qa/extras/odfimport/data/incorrectsum.odt |binary sw/qa/extras/odfimport/odfimport.cxx | 12 sw/source/filter/basflt/shellio.cxx |2 +- 3 files changed, 13 insertions(+), 1 deletion(-) New commits: commit d888ed101b6c1a22ae2e6eb2536adda2fa45a802 Author: Samuel Mehrbrodt AuthorDate: Mon Mar 6 17:00:10 2023 +0100 Commit: Samuel Mehrbrodt CommitDate: Mon Apr 3 12:51:19 2023 +0200 Always update fields when loading document to make sure that table formulas are re-evaluated after loading. When a document has a wrong sum saved (which seems to happen sometimes), this sum is used until user clicks into the table or otherwise refreshes the formula. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148355 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt (cherry picked from commit c132a1abd57c109331191c3b3fbd14e1c5e46631) Change-Id: I5cc3f983524b395089c17aa35d8641847a388bad diff --git a/sw/qa/extras/odfimport/data/incorrectsum.odt b/sw/qa/extras/odfimport/data/incorrectsum.odt new file mode 100644 index ..0e1e99b0d699 Binary files /dev/null and b/sw/qa/extras/odfimport/data/incorrectsum.odt differ diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index c14a4ac60c87..3fa5321389e4 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -465,6 +466,17 @@ DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(422), xShape->getPosition().Y); // Was -2371 } +DECLARE_ODFIMPORT_TEST(testIncorrectSum, "incorrectsum.odt") +{ +Scheduler::ProcessEventsToIdle(); +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); +uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); +uno::Reference xCell(xTextTable->getCellByName("C3"), uno::UNO_QUERY); +// Use indexOf instead of exact match since the result contains an Euro sign which OUString doesn't like +CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xCell->getString().indexOf("1,278")); +} + DECLARE_ODFIMPORT_TEST(testCalcFootnoteContent, "ooo32780-1.odt") { //this was a CalcFootnoteContent crash diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 5c80d7da6fef..06bbbe14e88c 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -378,7 +378,7 @@ ErrCode SwReader::Read( const Reader& rOptions ) // not insert: set the redline mode read from settings.xml eOld = ePostReadRedlineFlags & ~RedlineFlags::Ignore; -mxDoc->getIDocumentFieldsAccess().SetFieldsDirty(false, nullptr, 0); +mxDoc->getIDocumentFieldsAccess().SetFieldsDirty(true, nullptr, 0); } mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa xmloff/source
sw/qa/extras/odfexport/data/tdf151100.docx |binary sw/qa/extras/odfexport/odfexport.cxx | 15 +++ xmloff/source/draw/shapeexport.cxx | 15 --- 3 files changed, 15 insertions(+), 15 deletions(-) New commits: commit df61e75834048d77a3e0bbbf1e465fc822256578 Author: Mike Kaganski AuthorDate: Wed Sep 21 11:11:47 2022 +0300 Commit: Michael Stahl CommitDate: Tue Oct 4 20:48:16 2022 +0200 tdf#151100: xText->getString() may be empty for content needing export The check that is removed prevents collecting the table data. Assume that it's the performance optimization, and that processing empty text objects would be fast anyway. This basically reverts commit 73fcb052edf1a21d785583bc53e8b4323b577bb1 Author Christian Lippka Date Thu Nov 22 12:26:35 2001 + #90330# only export text autostyles for shapes with text and commit 7661bbbaef31adfdb298b1447301b24a70f85834 Author Michael Stahl Date Fri Nov 25 22:46:34 2016 +0100 tdf#102479 ODF export: ignore exceptions when checking shape text that becomes unnecessary after the former change is reverted. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140313 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140352 Tested-by: Jenkins (cherry picked from commit 226b1c2006e936e4b32748b810624c5d655c4a98) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140378 Reviewed-by: Michael Stahl (cherry picked from commit d194474aabd699806cb3631bc8641dd0548b8026) Change-Id: I709a7b4c5ac1cc0621d3a1b18f2eb74feb987efb diff --git a/sw/qa/extras/odfexport/data/tdf151100.docx b/sw/qa/extras/odfexport/data/tdf151100.docx new file mode 100644 index ..e0341bdb9c8c Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf151100.docx differ diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 0be421765b51..e686e9d46a46 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -99,6 +99,21 @@ public: } }; +CPPUNIT_TEST_FIXTURE(Test, tdf151100) +{ +// Similar to tdf135942 + +load(mpTestDocumentPath, "tdf151100.docx"); +reload(mpFilter, "tdf151100.docx"); +// All table autostyles should be collected, including nested, and must not crash. + +CPPUNIT_ASSERT_EQUAL(1, getPages()); + +xmlDocPtr pXmlDoc = parseExport("styles.xml"); + +assertXPath(pXmlDoc, "/office:document-styles/office:automatic-styles/style:style[@style:family='table']", 1); +} + DECLARE_ODFEXPORT_TEST(testMathObjectFlatExport, "2_MathType3.docx") { uno::Reference xModifiable(mxComponent, uno::UNO_QUERY); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index ddd128d1d8b0..61193072f84e 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -302,22 +302,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap if( xPropSet.is() && bObjSupportsText ) { uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY); -bool bSkip = false; if (xText.is()) -{ -try -{ -bSkip = xText->getString().isEmpty(); -} -catch (uno::RuntimeException const&) -{ -// tdf#102479: SwXTextFrame that contains only a table will -// throw, but the table must be iterated so that -// SwXMLExport::ExportTableLines() can find its auto styles -// so do not skip it! -} -} -if (!bSkip) { uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa
sw/qa/extras/uiwriter/uiwriter.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 42f0c4f24c8a6f85d1ce5ebf622dcd49f345a240 Author: Michael Stahl AuthorDate: Mon Sep 19 14:20:16 2022 +0200 Commit: Michael Stahl CommitDate: Mon Sep 19 14:20:16 2022 +0200 sw: disable testTdf139843 page check Somehow get 9 pages on WNT; the bug this test was added for was a crash anyway. Change-Id: Idb8fc98337e743d83001bab6ce2f4bb34530c7fd diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 4fd56405933d..761be1217244 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -4233,7 +4233,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf139843) { load(DATA_DIRECTORY, "tdf139843.odt"); -int nPages = getPages(); +//int nPages = getPages(); lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {}); Scheduler::ProcessEventsToIdle(); @@ -4247,7 +4247,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf139843) lcl_dispatchCommand(mxComponent, ".uno:Paste", {}); Scheduler::ProcessEventsToIdle(); -CPPUNIT_ASSERT_EQUAL(nPages, getPages()); +//FIXME?CPPUNIT_ASSERT_EQUAL(nPages, getPages()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134252)
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa
sw/qa/extras/uiwriter/uiwriter.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit f335dad0fe61ec4807ad6ee17166a569e9a97b1d Author: Xisco Fauli AuthorDate: Mon Feb 14 15:44:37 2022 +0100 Commit: Michael Stahl CommitDate: Fri Sep 16 20:27:44 2022 +0200 sw_uiwriter3: just check the number of pages is the same... ... before and after, sometimes it might be 6 instead of 7 and in this test we just care about it not crashing Change-Id: Ia358517f4b0c566199af368da51ba385845218a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129916 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 5c49a9c98620153e206a3aabc2a89ef19c0a1046) diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 1e0b5b46114e..4fd56405933d 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -4233,7 +4233,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf139843) { load(DATA_DIRECTORY, "tdf139843.odt"); -CPPUNIT_ASSERT_EQUAL(7, getPages()); +int nPages = getPages(); lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {}); Scheduler::ProcessEventsToIdle(); @@ -4247,7 +4247,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf139843) lcl_dispatchCommand(mxComponent, ".uno:Paste", {}); Scheduler::ProcessEventsToIdle(); -CPPUNIT_ASSERT_EQUAL(7, getPages()); +CPPUNIT_ASSERT_EQUAL(nPages, getPages()); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134252)
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa
sw/qa/uitest/writer_tests/data/tdf135018.odt |binary 1 file changed New commits: commit 8c8e0866f73ececf9207dfb565c6a5cddeef6e6a Author: Caolán McNamara AuthorDate: Sun Sep 20 19:51:58 2020 +0100 Commit: Michael Stahl CommitDate: Tue Jun 21 11:44:04 2022 +0200 Replace "Bahnschrift Light" with "DejaVu Sans" Change-Id: Iebe86f54a8aa30de87db80f55ae201ec02ffb80c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103076 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit d3c870fcbfed4bbbcbc5d943c2526b353ad396c6) diff --git a/sw/qa/uitest/writer_tests/data/tdf135018.odt b/sw/qa/uitest/writer_tests/data/tdf135018.odt index 2dc9e2a4da0d..9c255f81fa42 100644 Binary files a/sw/qa/uitest/writer_tests/data/tdf135018.odt and b/sw/qa/uitest/writer_tests/data/tdf135018.odt differ
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa sw/source
sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt |binary sw/qa/extras/odfexport/odfexport.cxx | 10 ++ sw/source/filter/xml/xmltbli.cxx |2 +- 3 files changed, 11 insertions(+), 1 deletion(-) New commits: commit d9d7b17adf91c90a21a59250934e2e52e1133d81 Author: Justin Luth AuthorDate: Fri Oct 22 21:11:59 2021 +0200 Commit: Michael Stahl CommitDate: Wed Feb 23 18:20:20 2022 +0100 tdf#131025 ODF import: recognize SV_COUNTRY_LANGUAGE_OFFSET File import was making an exception for "float value 0" if the accompanying text had no resemblance to the value 0, but that only applied to GENERAL number format. It should apply to any language's default number format. REGRESSION warning: as we can see, this has been handled inconsistently in the past. But from the coding exception to overcome losing text to a zero (and the huge number of duplicate bugs) the best choice seems to be ignore the spec that says that a number value overrides the text value - at least in the case where the number value is zero. Change-Id: I701e72c6a5dad42c7799ab501255a4859adf61d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124080 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Eike Rathke (cherry picked from commit 3e1d316734354c6b49696c8904e0fc431cfb5143) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124014 Reviewed-by: Xisco Fauli (cherry picked from commit d3b4ef0f7726ef1619717d9e3327963ceb4c065a) diff --git a/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt b/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt new file mode 100644 index ..f2bffb050ac4 Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt differ diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 321ce301fb9c..6a216a1b5e92 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -219,6 +219,16 @@ DECLARE_ODFEXPORT_TEST(testTdf43569, "tdf43569_conditionalfield.doc") CPPUNIT_ASSERT(xFields->hasMoreElements()); } +DECLARE_ODFEXPORT_TEST(testTdf131025_noZerosInTable, "tdf131025_noZerosInTable.odt") +{ +uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables = xSupplier->getTextTables(); +uno::Reference xTable(xTables->getByName("Table1"), uno::UNO_QUERY); + +uno::Reference xCell(xTable->getCellByName("C3"), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(OUString("5 gp"), xCell->getString()); +} + DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt") { uno::Reference const xShape(getShape(1)); diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 0fde4d3c509d..07ea1355b8fb 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -2021,7 +2021,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( { const SwTableBoxNumFormat* pNumFormat = static_cast( pItem ); -if( ( pNumFormat != nullptr ) && ( pNumFormat->GetValue() == 0 ) ) +if (pNumFormat && (pNumFormat->GetValue() % SV_COUNTRY_LANGUAGE_OFFSET) == 0) { // only one text node? SwNodeIndex aNodeIndex( *(pCell->GetStartNode()), 1 );
[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sw/qa sw/source
sw/qa/extras/layout/data/tdf141079.odt |binary sw/qa/extras/layout/layout.cxx | 30 ++ sw/source/core/text/itrcrsr.cxx|8 ++-- 3 files changed, 36 insertions(+), 2 deletions(-) New commits: commit 2be0c266276bf5e6c4ae8c84aba7d715adcfcc1f Author: Samuel Mehrbrodt AuthorDate: Thu Mar 18 11:41:29 2021 +0100 Commit: Thorsten Behrens CommitDate: Wed Mar 31 00:21:47 2021 +0200 tdf#141079 Restore double click behavior for script fields Change-Id: I5daa730740ea042bdae56b832f2557ec974339b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112668 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt (cherry picked from commit 5302268de6a33716c7746aa13232746ad2f2b561) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113074 Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/layout/data/tdf141079.odt b/sw/qa/extras/layout/data/tdf141079.odt new file mode 100644 index ..65dfcb4a296f Binary files /dev/null and b/sw/qa/extras/layout/data/tdf141079.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index c94811b4d5e7..9e990266dea9 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3419,6 +3419,36 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testImageComment) CPPUNIT_ASSERT_EQUAL(static_cast(5), aPosition.nContent.GetIndex()); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testScriptField) +{ +// Test clicking script field inside table ( tdf#141079 ) +SwDoc* pDoc = createDoc("tdf141079.odt"); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +// Look up layout position which is the first cell in the table +SwRootFrame* pRoot = pWrtShell->GetLayout(); +CPPUNIT_ASSERT(pRoot->GetLower()->IsPageFrame()); +SwPageFrame* pPage = static_cast(pRoot->GetLower()); +CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame()); +SwBodyFrame* pBody = static_cast(pPage->GetLower()); +CPPUNIT_ASSERT(pBody->GetLower()->IsTextFrame()); +SwTextFrame* pTextFrame = static_cast(pBody->GetLower()); +CPPUNIT_ASSERT(pTextFrame->GetNext()->IsTabFrame()); +SwFrame* pTable = pTextFrame->GetNext(); +SwFrame* pRow1 = pTable->GetLower(); +CPPUNIT_ASSERT(pRow1->GetLower()->IsCellFrame()); +SwFrame* pCell1 = pRow1->GetLower(); +CPPUNIT_ASSERT(pCell1->GetLower()->IsTextFrame()); +SwTextFrame* pCellTextFrame = static_cast(pCell1->GetLower()); +const SwRect& rCellRect = pCell1->getFrameArea(); +Point aPoint = rCellRect.Center(); +aPoint.setX(aPoint.getX() - rCellRect.Width() / 2); +// Ask for the doc model pos of this layout point. +SwPosition aPosition(*pCellTextFrame->GetTextNodeForFirstText()); +pCellTextFrame->GetModelPositionForViewPoint(, aPoint); +// Position was 1 without the fix from tdf#141079 +CPPUNIT_ASSERT_EQUAL(static_cast(0), aPosition.nContent.GetIndex()); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf64222) { createDoc("tdf64222.docx"); diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 5806f06e3b76..6528440e 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1538,8 +1538,12 @@ TextFrameIndex SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point { if (pPor->IsPostItsPortion()) { -// Offset would be nCurrStart + nLength below, do the same for post-it portions. -nCurrStart += pPor->GetLen(); +SwPostItsPortion* pPostItsPortion = dynamic_cast(pPor); +if (!pPostItsPortion->IsScript()) // tdf#141079 +{ +// Offset would be nCurrStart + nLength below, do the same for post-it portions. +nCurrStart += pPor->GetLen(); +} } return nCurrStart; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits