[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Sat Feb 6 18:39:25 UTC 2021


 sw/qa/extras/uiwriter/uiwriter3.cxx |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

New commits:
commit 51ecbd06bdef5d9c0738703f16160799f261c860
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Sat Feb 6 18:32:36 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Sat Feb 6 19:38:44 2021 +0100

    tdf#135014: sw_uiwriter3: Add unittest
    
    Change-Id: I6baf00837de37604a872bb1a125010a7a6f06e89
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110511
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 87f2cc338038..b755378b0b72 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1585,6 +1585,35 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132744)
     CPPUNIT_ASSERT_EQUAL(1, getShapes());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135014)
+{
+    mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    uno::Sequence<beans::PropertyValue> aArgs(
+        comphelper::InitPropertySequence({ { "KeyModifier", uno::makeAny(sal_Int32(0)) } }));
+
+    // Toggle Numbering List
+    dispatchCommand(mxComponent, ".uno:DefaultBullet", aArgs);
+    Scheduler::ProcessEventsToIdle();
+
+    uno::Sequence<beans::PropertyValue> aArgs2(comphelper::InitPropertySequence(
+        { { "Param", uno::makeAny(OUString("NewNumberingStyle")) },
+          { "Family", uno::makeAny(static_cast<sal_Int16>(SfxStyleFamily::Pseudo)) } }));
+
+    // New Style from selection
+    dispatchCommand(mxComponent, ".uno:StyleNewByExample", aArgs2);
+    Scheduler::ProcessEventsToIdle();
+
+    // Without the fix in place, this test would have failed here
+    reload("Office Open XML Text", "tdf135014.docx");
+
+    xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='NewNumberingStyle']/w:qFormat", 1);
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133358)
 {
     mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");


More information about the Libreoffice-commits mailing list