CppunitTest_sw_odfimport: add annotation formatting testcase

Most probably this was fixed by 0761f81643
(123792: complete annotations on text ranges feature, 2013-12-19).

Change-Id: Ic712c1a33271081205901ddbf5d629d6f2198126
This commit is contained in:
Miklos Vajna
2014-02-19 15:45:46 +01:00
parent 7f564cc75a
commit 1733b67841
2 changed files with 11 additions and 0 deletions

Binary file not shown.

View File

@@ -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();