[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jan 4 23:17:38 UTC 2021
sw/qa/extras/odfimport/data/tdf138879.odt |binary
sw/qa/extras/odfimport/odfimport.cxx | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+)
New commits:
commit 8e691505d4675b878b30bd00cd2e4fb4f794f0ef
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Jan 4 13:53:09 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jan 5 00:16:56 2021 +0100
tdf#138879: sw_odfimport: Add unittest
Change-Id: Idbe6775dd00f985fbbf6d102e88e768edf2ad525
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108667
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/qa/extras/odfimport/data/tdf138879.odt b/sw/qa/extras/odfimport/data/tdf138879.odt
new file mode 100644
index 000000000000..801fe32a22b1
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf138879.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 71046fe1ca9e..6ab87d07a3de 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -1112,6 +1112,26 @@ DECLARE_ODFIMPORT_TEST(testTdf134971, "tdf134971a.odt")
CPPUNIT_ASSERT_EQUAL(OUString("Arial"), sString);
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf138879)
+{
+ // Create a new document.
+ mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
+
+ uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence(
+ {
+ {"Name", uno::makeAny(
+ m_directories.getURLFromSrc(mpTestDocumentPath) + "tdf138879.odt")},
+ {"Filter", uno::makeAny(OUString("writer8"))},
+ });
+ dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: Heading 1
+ // - Actual : Standard
+ CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"),
+ getProperty<OUString>(getParagraph(1), "ParaStyleName"));
+}
+
CPPUNIT_TEST_FIXTURE(Test, testPasteFirstParaDirectFormat)
{
// Create a new document.
More information about the Libreoffice-commits
mailing list