summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-02-20 18:25:26 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-20 18:39:23 +0100
commitdeabda6b38417e4c7037c0d0274a4f81b338e552 (patch)
treec33273665daac1d6d34154427f219d8a2df03e58 /sw/qa/extras/ooxmlimport
parent6e157dc78d495d94948e33822405addb48467e74 (diff)
DOCX import: fix missing underline in comment text
Regression from fb5ee5c9953635a423d3102b901e409d15800096 (sw: Add support for different grab bags at PropertyMap., 2013-11-29), PropertyMap::GetPropertyValues() assumed all XTextRange implementations support the new property, which is not true for at least editeng. Change-Id: Ib5657be522d30f203cecbbbae74d6594cef984fb
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/annotation-formatting.docxbin0 -> 14298 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/annotation-formatting.docx b/sw/qa/extras/ooxmlimport/data/annotation-formatting.docx
new file mode 100755
index 000000000000..87af02b780e5
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/annotation-formatting.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 7436e58dd212..acfe4ea44bb8 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -13,6 +13,7 @@
#if !defined(WNT)
#include <com/sun/star/awt/XBitmap.hpp>
+#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp>
@@ -1869,6 +1870,17 @@ DECLARE_OOXMLIMPORT_TEST(testFloatingTablesAnchor, "floating-tables-anchor.docx"
xText.set(xRange->getText(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("Anchor point"), xText->getString());
}
+
+DECLARE_OOXMLIMPORT_TEST(testAnnotationFormatting, "annotation-formatting.docx")
+{
+ uno::Reference<beans::XPropertySet> xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(2), 2), "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, "days");
+ // Formatting was lost: the second text portion was NONE, not SINGLE.
+ CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty<sal_Int16>(getRun(xParagraph, 1), "CharUnderline"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();