[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa sw/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Mon Apr 27 09:32:16 UTC 2020
sw/qa/extras/uiwriter/data2/tdf117923.docx |binary
sw/qa/extras/uiwriter/uiwriter2.cxx | 42 ++++++++++++++++
sw/source/core/doc/DocumentContentOperationsManager.cxx | 3 +
3 files changed, 45 insertions(+)
New commits:
commit f64bc71404e5662c4537ae166eae2ee054197350
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Thu Apr 23 10:15:31 2020 +0200
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Mon Apr 27 11:31:45 2020 +0200
tdf#132351 DOCX export: fix character formatting of numbering
with removed ListAutoFormat.
Using untouched text portion of paragraph marker,
DOCX export restored the changed character
formatting of numbering with removed ListAutoFormat
(see RES_PARATR_LIST_AUTOFMT in wrtw8nds.cxx).
Follow-up of commit e4509d7db7562f7e4ab9366b915ed558291ac3de
(tdf#127606 DOCX lists: fix unchangeable formatting)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92744
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry-picked from commit 7690f3269c89140930f49068133e7d061d475948)
Change-Id: Ie576a204d86694296cb29185a5b130e87a518b7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92801
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/sw/qa/extras/uiwriter/data2/tdf117923.docx b/sw/qa/extras/uiwriter/data2/tdf117923.docx
new file mode 100644
index 000000000000..c10ac24050b2
Binary files /dev/null and b/sw/qa/extras/uiwriter/data2/tdf117923.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 921c7dcd1468..6472929fc5ab 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -142,6 +142,48 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf47471_paraStyleBackground)
getProperty<OUString>(getParagraph(3), "ParaStyleName"));
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat)
+{
+ createDoc("tdf117923.docx");
+ // Ensure that all text portions are calculated before testing.
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwViewShell* pViewShell
+ = pTextDoc->GetDocShell()->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell();
+ CPPUNIT_ASSERT(pViewShell);
+ pViewShell->Reformat();
+
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+
+ // Check that we actually test the line we need
+ assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", "GHI GHI GHI GHI");
+ assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nType",
+ "PortionType::Number");
+ assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "rText", "2.");
+ // The numbering height was 960 in DOC format.
+ assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nHeight", "220");
+
+ // tdf#127606: now it's possible to change formatting of numbering
+ // increase font size (220 -> 260)
+ lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ lcl_dispatchCommand(mxComponent, ".uno:Grow", {});
+ pViewShell->Reformat();
+ discardDumpedLayout();
+ pXmlDoc = parseLayoutDump();
+ assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nHeight", "260");
+
+ // save it to DOCX
+ reload("Office Open XML Text", "tdf117923.docx");
+ pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ pViewShell
+ = pTextDoc->GetDocShell()->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell();
+ pViewShell->Reformat();
+ discardDumpedLayout();
+ pXmlDoc = parseLayoutDump();
+ // this was 220
+ assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nHeight", "260");
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101534)
{
// Copy the first paragraph of the document.
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index caec3a3e9fe7..dd25731710cb 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -1311,6 +1311,9 @@ namespace //local functions originally from docfmt.cxx
(pCurrentNode->GetIndex() < nEndIndex || pEnd->nContent.GetIndex() == pEndNode->Len()))
{
pCurrentNode->ResetAttr(RES_PARATR_LIST_AUTOFMT);
+ // reset also paragraph marker
+ SwIndex nIdx( pCurrentNode, pCurrentNode->Len() );
+ pCurrentNode->GetTextNode()->RstTextAttr(nIdx, 1);
}
pCurrentNode = SwNodes::GoPrevious( &aIdx );
}
More information about the Libreoffice-commits
mailing list