summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-04-15 00:52:12 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-04-15 01:19:47 +0200
commitecbea5fac49fe63280627ff215c0c7854d7ba953 (patch)
treee47d0143f6e254563a0fc9872f2de31f4ccdc5ab /sw
parent69805b85f2643d3df4266a30f019e5f90c9a0826 (diff)
implement RTF import of zoom level
Diffstat (limited to 'sw')
-rw-r--r--sw/CppunitTest_sw_subsequent_rtftok.mk1
-rw-r--r--sw/qa/extras/rtftok/data/zoom.rtf1
-rw-r--r--sw/qa/extras/rtftok/rtftok.cxx15
3 files changed, 17 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_subsequent_rtftok.mk b/sw/CppunitTest_sw_subsequent_rtftok.mk
index 50ee0d66dbba..f8b243931cd8 100644
--- a/sw/CppunitTest_sw_subsequent_rtftok.mk
+++ b/sw/CppunitTest_sw_subsequent_rtftok.mk
@@ -51,6 +51,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_rtftok,\
$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_rtftok))
$(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtftok,\
+ comphelper/util/comphelp \
configmgr/source/configmgr \
fileaccess/source/fileacc \
filter/source/config/cache/filterconfig1 \
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();