diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2015-02-02 09:43:51 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-13 18:23:15 +0100 |
commit | 2c411e4487f24968d6a62958fec85e4e3e1fda93 (patch) | |
tree | 89774ed068920e8e8947e0447c668d0bbc643a26 /sw | |
parent | d1f38b47c29ef5e2db2cabeb657668637d97e13d (diff) |
tdf#49893 partial fix for blank rentangle problem in RTF
* pib structure in rtf shape is processed always, if exists, not only
for shape #75 (picture frame): it is possible for other shapes, at
least for #1 (rectangle)
* picture inside shape gets width and height from shape: this picture
looks like pib object and should fit shape frame
Conflicts:
sw/qa/extras/rtfimport/rtfimport.cxx
Reviewed on:
https://gerrit.libreoffice.org/14396
Change-Id: I5cf2e692940c4ddd8ab8b291ef65c0cc44c45f5d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/CppunitTest_sw_rtfexport.mk | 31 | ||||
-rwxr-xr-x | sw/qa/extras/rtfimport/data/fdo49893.rtf | 14 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 9 |
3 files changed, 24 insertions, 30 deletions
diff --git a/sw/CppunitTest_sw_rtfexport.mk b/sw/CppunitTest_sw_rtfexport.mk index 33f366b16ff1..48c87589d5ac 100644 --- a/sw/CppunitTest_sw_rtfexport.mk +++ b/sw/CppunitTest_sw_rtfexport.mk @@ -48,36 +48,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_rtfexport,\ $(eval $(call gb_CppunitTest_use_ure,sw_rtfexport)) $(eval $(call gb_CppunitTest_use_vcl,sw_rtfexport)) -$(eval $(call gb_CppunitTest_use_components,sw_rtfexport,\ - basic/util/sb \ - comphelper/util/comphelp \ - configmgr/source/configmgr \ - embeddedobj/util/embobj \ - filter/source/config/cache/filterconfig1 \ - filter/source/storagefilterdetect/storagefd \ - framework/util/fwk \ - i18npool/util/i18npool \ - linguistic/source/lng \ - package/source/xstor/xstor \ - package/util/package2 \ - sax/source/expatwrap/expwrap \ - sfx2/util/sfx \ - starmath/util/sm \ - svl/source/fsstor/fsstorage \ - svtools/util/svt \ - sw/util/msword \ - sw/util/sw \ - sw/util/swd \ - toolkit/util/tk \ - ucb/source/core/ucb1 \ - ucb/source/ucp/file/ucpfile1 \ - unotools/util/utl \ - unoxml/source/service/unoxml \ - uui/util/uui \ - writerfilter/util/writerfilter \ - xmloff/util/xo \ - oox/util/oox \ -)) +$(eval $(call gb_CppunitTest_use_rdb,sw_rtfexport,services)) $(eval $(call gb_CppunitTest_use_configuration,sw_rtfexport)) diff --git a/sw/qa/extras/rtfimport/data/fdo49893.rtf b/sw/qa/extras/rtfimport/data/fdo49893.rtf new file mode 100755 index 000000000000..05eedcb23e5f --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo49893.rtf @@ -0,0 +1,14 @@ +{\rtf1
+{\shp{\*\shpinst\shplid1{\sp{\sn ShapeType}{\sv 75}}\shpleft0\shptop144
+\shpbottom576\shpright1296\shpbxcolumn\shpbypara\shpwr3\shpwrk0{\sp{\sn dxWrapDistLeft}{\sv 0}}{\sp{\sn dxWrapDistRight}{\sv 0}}
+{\sp{\sn dxWrapDistTop}{\sv 0}}{\sp{\sn dxWrapDistBottom}{\sv 0}}{\sp{\sn fFilled}{\sv 1}}{\sp{\sn fillType}{\sv 3}}{\sp{\sn fillType}
+{\sv 3}}{\sp{\sn fillColor}{\sv 0}}{\sp{\sn fillBackColor}{\sv 0}}{\sp{\sn fillToTop}{\sv 65536}}{\sp{\sn fillToLeft}{\sv 65536}
+}{\sp{\sn fillToRight}{\sv 0}}{\sp{\sn fillToBottom}{\sv 0}}{\sp{\sn pib}{\sv
+{\pict\pngblip
+47494638396110001000d5ff00000000ffffffc0c0c0555f00ffffaafcfcfcf6f6f6eaeaeae6e6e6e4e4e4e3e3e3c2c2c2c1c1c1bcbcbcb5b5b5b3b3b3b0b0b0adadada5a5a5a2a2a2a1a1a19f9f9f9494948a8a8a8888888686867b7b7b6c6c6c5c5c5c4e4e4e4b4b4b4747474646463d3d3d3c3c3c2e2e2e2525251b1b1b18181810101009090906060603030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000002002c0000000010001000000684408170482c0a06c8a4728924389f506833b281302a8e6b164b18103024c52111504cca67332102e0042e9a40d9319f8300a343c1200f54e47f7e2a00001e0b0a7d0d728a010d838400261a7c0d94947784252700127e9d159f6c8411140019080ea7a9a85f842122281612b1b3b25d6b1f29291d0fbbbdbc5d5e51c34e4cc64a46c94341003b}}}
+{\sp{\sn lTxid}{\sv 1}}{\sp{\sn dxTextLeft}{\sv 91440}}{\sp{\sn dxTextRight}
+{\sv 91440}}{\sp{\sn dxTextTop}{\sv 45720}}{\sp{\sn dxTextBottom}{\sv 45720}}{\sp{\sn txflTextFlow}{\sv 0}
+}
+}
+}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 39c105409038..90ef8d3bbf9d 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2256,6 +2256,15 @@ DECLARE_RTFIMPORT_TEST(testTdf88811, "tdf88811.rtf") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), xDrawPage->getCount()); } +DECLARE_RTFIMPORT_TEST(testFdo49893, "fdo49893.rtf") +{ + // Image from shape was not loaded, invalid size of image after load + uno::Reference<drawing::XShape> xShape(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShape.is()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(432)), xShape->getSize().Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(1296)), xShape->getSize().Width); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |