summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-04-15 14:39:27 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-04-15 14:40:44 +0200
commit385017e0f2147d2a49e36d6c44ae76a1e7600668 (patch)
treeff1b895ef53215c7a726934de10013d629032d16 /sw
parent5187174cd4054486100ef29125ee4a36f7e3bee3 (diff)
testcase for fdo#39053
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtftok/data/fdo39053.rtfbin0 -> 22118 bytes
-rw-r--r--sw/qa/extras/rtftok/rtftok.cxx21
2 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo39053.rtf b/sw/qa/extras/rtftok/data/fdo39053.rtf
new file mode 100644
index 000000000000..71d26916fc99
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo39053.rtf
Binary files differ
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 9fbffca7d8a5..2b5146a16ad0 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -82,6 +82,7 @@ public:
void testFdo45182();
void testFdo44176();
void testZoom();
+ void testFdo39053();
CPPUNIT_TEST_SUITE(RtfModelTest);
#if !defined(MACOSX) && !defined(WNT)
@@ -105,6 +106,7 @@ public:
CPPUNIT_TEST(testFdo45182);
CPPUNIT_TEST(testFdo44176);
CPPUNIT_TEST(testZoom);
+ CPPUNIT_TEST(testFdo39053);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -548,6 +550,25 @@ void RtfModelTest::testZoom()
CPPUNIT_ASSERT_EQUAL(sal_Int16(42), nValue);
}
+void RtfModelTest::testFdo39053()
+{
+ load("fdo39053.rtf");
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ int nAsCharacter = 0;
+ for (int i = 0; i < xDraws->getCount(); ++i)
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY);
+ text::TextContentAnchorType eValue;
+ xPropertySet->getPropertyValue("AnchorType") >>= eValue;
+ if (eValue == text::TextContentAnchorType_AS_CHARACTER)
+ nAsCharacter++;
+ }
+ // The image in binary format was ignored.
+ CPPUNIT_ASSERT_EQUAL(1, nAsCharacter);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
CPPUNIT_PLUGIN_IMPLEMENT();