summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-02-19 15:45:46 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-19 15:50:32 +0100
commit1733b678417085f17f07e0018fda08fc70b84621 (patch)
tree332f0a91301b60878280c2eedf348e910c8b58c5 /sw/qa/extras/odfimport
parent7f564cc75a412eede121bbc9595202255474917b (diff)
CppunitTest_sw_odfimport: add annotation formatting testcase
Most probably this was fixed by 0761f81643a6890457e9ef7d913ab5c88c2593a4 (123792: complete annotations on text ranges feature, 2013-12-19). Change-Id: Ic712c1a33271081205901ddbf5d629d6f2198126
Diffstat (limited to 'sw/qa/extras/odfimport')
-rw-r--r--sw/qa/extras/odfimport/data/annotation-formatting.odtbin0 -> 11215 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx11
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/annotation-formatting.odt b/sw/qa/extras/odfimport/data/annotation-formatting.odt
new file mode 100644
index 000000000000..ce8d98f40c89
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/annotation-formatting.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 8f7f8a72bfae..8fa14b45581a 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -10,6 +10,7 @@
#if !defined(MACOSX) && !defined(WNT)
+#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/style/PageStyleLayout.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/table/BorderLine.hpp>
@@ -437,6 +438,16 @@ DECLARE_ODFIMPORT_TEST(testSpellmenuRedline, "spellmenu-redline.odt")
CPPUNIT_ASSERT_EQUAL(sal_uInt16(FN_REDLINE_PREV_CHANGE), aPopup.GetItemId(aPopup.GetItemCount() - 1));
}
+DECLARE_ODFIMPORT_TEST(testAnnotationFormatting, "annotation-formatting.odt")
+{
+ uno::Reference<beans::XPropertySet> xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 1), "TextField");
+ uno::Reference<text::XText> xText = getProperty< uno::Reference<text::XText> >(xTextField, "TextRange");
+ // Make sure we test the right annotation.
+ uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText, "Looses: bold");
+ // Formatting was lost: the second text portion was NORMAL, not BOLD.
+ CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(xParagraph, 2), "CharWeight"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();