summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2019-08-01 15:50:00 +0300
committerMiklos Vajna <vmiklos@collabora.com>2019-08-02 08:46:18 +0200
commit8b81a453b22611f25674f5e44ae411d78c2fcada (patch)
tree1cb42ea2f3bc671abec05a57b6a6dfd096a97257 /sw
parentb2c651b378b52f823b8350aece0fd1e6b914bdc5 (diff)
tdf#126544 writerfilter: check parent style exists before assigning
If you set the parent style to a style that is not yet created, then it silently fails, and thus inherits from nothing! Change-Id: Ibb85235643dd5b1eb9b0bd43f701580f24b2b7fa Reviewed-on: https://gerrit.libreoffice.org/76805 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit b47a8f091ad8f9048a6b7962e9cde5d04ea0d665) Reviewed-on: https://gerrit.libreoffice.org/76824 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 5a2176aa8253..42d5d3f39c58 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -935,6 +935,11 @@ DECLARE_OOXMLEXPORT_TEST(testExtraSectionBreak, "1_page.docx")
uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
xCursor->jumpToLastPage();
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage());
+
+ // tdf126544 Styles were being added before their base/parent/inherited-from style existed, and so were using default settings.
+ uno::Reference<container::XNameAccess> xParaStyles(getStyles("ParagraphStyles"));
+ uno::Reference<style::XStyle> xStyle(xParaStyles->getByName("Heading 1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL( OUString("Heading Base"), xStyle->getParentStyle() );
}
DECLARE_OOXMLEXPORT_TEST(testcolumnbreak, "columnbreak.docx")