diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-04-15 00:52:12 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-04-15 01:19:47 +0200 |
commit | ecbea5fac49fe63280627ff215c0c7854d7ba953 (patch) | |
tree | e47d0143f6e254563a0fc9872f2de31f4ccdc5ab /sw/qa | |
parent | 69805b85f2643d3df4266a30f019e5f90c9a0826 (diff) |
implement RTF import of zoom level
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtftok/data/zoom.rtf | 1 | ||||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/zoom.rtf b/sw/qa/extras/rtftok/data/zoom.rtf new file mode 100644 index 000000000000..c7fd19b20b33 --- /dev/null +++ b/sw/qa/extras/rtftok/data/zoom.rtf @@ -0,0 +1 @@ +{\rtf1\viewscale42 Hello world!\par} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index e81fa3a02440..9fbffca7d8a5 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/text/XTextFramesSupplier.hpp> #include <com/sun/star/text/XTextTablesSupplier.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/view/XViewSettingsSupplier.hpp> #include <rtl/oustringostreaminserter.hxx> #include <test/bootstrapfixture.hxx> @@ -80,6 +81,7 @@ public: void testFdo47107(); void testFdo45182(); void testFdo44176(); + void testZoom(); CPPUNIT_TEST_SUITE(RtfModelTest); #if !defined(MACOSX) && !defined(WNT) @@ -102,6 +104,7 @@ public: CPPUNIT_TEST(testFdo47107); CPPUNIT_TEST(testFdo45182); CPPUNIT_TEST(testFdo44176); + CPPUNIT_TEST(testZoom); #endif CPPUNIT_TEST_SUITE_END(); @@ -533,6 +536,18 @@ void RtfModelTest::testFdo44176() CPPUNIT_ASSERT_EQUAL(nFirstTop, nDefaultTop + nDefaultHeader); } +void RtfModelTest::testZoom() +{ + load("zoom.rtf"); + + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<view::XViewSettingsSupplier> xViewSettingsSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xViewSettingsSupplier->getViewSettings()); + sal_Int16 nValue = 0; + xPropertySet->getPropertyValue("ZoomValue") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(42), nValue); +} + CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest); CPPUNIT_PLUGIN_IMPLEMENT(); |