summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-06-11 17:55:21 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-06-11 17:57:42 +0200
commit26f4f5b94a7573132c456a302cdb92bc265541ab (patch)
tree9f8c375f31a4208879abb246338bb9ae19a992ad
parent4282865c517f8de814696fa75d0662aba73a4624 (diff)
fdo#49659 testcase
Change-Id: Ie9bb39713e485d5fb4eb93c718796a0bbd083481
-rw-r--r--sw/qa/extras/rtftok/data/fdo49659.rtf19
-rw-r--r--sw/qa/extras/rtftok/rtftok.cxx23
2 files changed, 42 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo49659.rtf b/sw/qa/extras/rtftok/data/fdo49659.rtf
new file mode 100644
index 000000000000..c908826a1015
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo49659.rtf
@@ -0,0 +1,19 @@
+{\rtf1
+\sectd
+{\header
+{\trowd\cellx4000\cellx9500\pard\plain\intbl
+{\pict{\pngblip\picwgoal2340\pichgoal1000\picscalex50\picscaley50\piccropl0\piccropr0\piccropt0\piccropb0}89504e470d0a1a0a0000000d49484452000000750000003201000000004a22a9c50000009249444154789c63fccf800c7e3231a00216065dd33fc10f155b2c52
+5905fdf303d1e547f9a37c6af219d1d2230b03c3df94f4d058bfeb9785e63c6060606260f87be4b4ee8ad3559ff90da0fa2518db2412db1812a0e631ff3539ef
+f08581e10b030303030b030333c399957baf21ecfbf5eb3fafc3110686170c0c0c0c0cffffff293ec6a1c0c420785efeffff1fe8f60300fbbc2d919818ba7900
+00000049454e44ae426082}
+header1
+\cell\pard\plain\intbl
+header2
+\cell\row}
+}
+{\trowd\cellx4000\cellx9500\pard\plain\intbl
+body1
+\cell\pard\plain\intbl
+body2
+\cell\row}
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 2555fb5df2c3..e1f4fa76064a 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -28,6 +28,7 @@
#include "../swmodeltestbase.hxx"
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/graphic/GraphicType.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
@@ -95,6 +96,7 @@ public:
void testFdo45190();
void testFdo50539();
void testFdo50665();
+ void testFdo49659();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -133,6 +135,7 @@ public:
CPPUNIT_TEST(testFdo45190);
CPPUNIT_TEST(testFdo50539);
CPPUNIT_TEST(testFdo50665);
+ CPPUNIT_TEST(testFdo49659);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -781,6 +784,26 @@ void Test::testFdo50665()
CPPUNIT_ASSERT_EQUAL(OUString("Book Antiqua"), aValue);
}
+void Test::testFdo49659()
+{
+ load("fdo49659.rtf");
+
+ // Both tables were ignored: 1) was in the header, 2) was ignored due to missing empty par at the end of the doc
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+
+ // The graphic was also empty
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xGraphic;
+ xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
+ sal_Int8 nValue = 0;
+ xGraphic->getPropertyValue("GraphicType") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, nValue);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();