summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-07-21 09:04:44 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-07-21 09:08:46 +0200
commitfc7c1a07d0d5e21a4e1533a0e5b0ac256763f973 (patch)
treeb3c97f19a5722c2e274547265e6c97da7584517c /sw/qa/extras/ooxmlimport
parenta781abe326b45573eb677030358c362394e2bc09 (diff)
tdf#89702 DOCX import: fix too large bullet character
Commit c1f8437dbed0e8b989e41a345ef7e658a6e8a4cd (fdo#83465 RTF import: handle font of numbering, 2014-09-25), changed the "get the me character style of the current numbering's current level" member function to be successfull even in case we're inside a DOCX run, not when we're inside a DOCX paragraph, but outside runs. While this is necessary for RTF, the side effect of this was that unwanted run properties started to affect the above mentioned character style in case of DOCX. Fix the problem by enabling the "in paragraph and run" looking for RTF only. Change-Id: I610bfce6cec15b918fe547402360f5a894401f7e
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf89702.docxbin0 -> 13147 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx14
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf89702.docx b/sw/qa/extras/ooxmlimport/data/tdf89702.docx
new file mode 100644
index 000000000000..5542d1cbe575
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf89702.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index afc1f0231e8e..6ae2e0bdf41a 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2734,6 +2734,20 @@ DECLARE_OOXMLIMPORT_TEST(testTdf90611, "tdf90611.docx")
CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(getParagraphOfText(1, xFootnoteText), "CharHeight"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf89702, "tdf89702.docx")
+{
+ // Get the first paragraph's numbering style's 2nd level's character style name.
+ uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
+ auto xLevels = getProperty< uno::Reference<container::XIndexAccess> >(xParagraph, "NumberingRules");
+ uno::Sequence<beans::PropertyValue> aLevel;
+ xLevels->getByIndex(1) >>= aLevel; // 2nd level
+ OUString aCharStyleName = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "CharStyleName"; })->Value.get<OUString>();
+
+ // Make sure that the font name is Arial, this was Verdana.
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xStyle, "CharFontName"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();