From ac6a2038ac6eab37c8c0a7957a75c24baeeb66b2 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sat, 24 Aug 2013 12:20:04 +0200 Subject: [PATCH] ODF filter: handle draw:shadow-opacity for Writer frames Change-Id: I3ad39e5de5b6999d6c2182c1ec622ae7f873cafe --- .../data/textframe-transparent-shadow.odt | Bin 0 -> 9634 bytes sw/qa/extras/odfexport/odfexport.cxx | 11 +++++++++++ xmloff/source/text/txtprmap.cxx | 1 + 3 files changed, 12 insertions(+) create mode 100644 sw/qa/extras/odfexport/data/textframe-transparent-shadow.odt diff --git a/sw/qa/extras/odfexport/data/textframe-transparent-shadow.odt b/sw/qa/extras/odfexport/data/textframe-transparent-shadow.odt new file mode 100644 index 0000000000000000000000000000000000000000..508e853c9d7538e32f833ece230589ea71e59922 GIT binary patch literal 9634 zcmeHtWmH_tv+v;UPH=a(5Zv9}-C=MG5+o3upur)yCqN)L1a}$S-8BTa2RSGItb;VHI#UZhrc1&7>NO+}o@>WnG$>EQf;E}C`gq_g1 zp>m9SqSetWzeT~Mf)6vYfk zrTDAU4ogk-Rm?u8CZ3O1M~jVPu15>?V;rYy+x>D2^@83%b_Bgv{&?s4)#-Yo?`miB zM6qh21nBx~TN2dbdn*CzqR?HF@x(X<@bdNU)iu+sRRK=p9$ns?{hOI>Mmq&|frx2PkzpO=7Tx~g`PF{x!Q_c5>7#%TFaxh?hz4?TocjP0?#sJgNP%R`ILf{f(85 zfdP>`M&%4}zSf>Y{_Zf7-E#Qp>$;iB&49DB<(LA?5s886U-r=OC0d@aOq9FxY9;o& zvgcTAaI@u*U*MPHao*^)nrrkpw&Ha^n29950x5PFUZr2PT=5BTA^!9+HwBwDxbj@d zP@vUpjkSqR%IaZnmj46qI?OP>=CjZIbevjj>GFY4u4)6lzdcYrtB3opi`xP;K0Z#D zaqzcU%j9g%{rIW_zREniFI#a}SJw##7tL=uKZX7O=5MY3zfpug#6`&w%f7RS@Dp?b zq{S7)DnyI||AJ*$SlFK!|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?msDHN`x}vjJXF+$AS3-NQTw zX>7=_A@*D5ABT|tS!u4T$!BBEQaET9D-O-gOB;%nh(ziF+)K))AZNd zWVLaIXhAW5Peos9iH_G$&MVo=npm%pU|)`|Njo$q=#8iWMJyv5m7@W!<&&7rj*%q+b_EZ8(yY5sJi7qsk?Xytum>g@*VI$b7DFiK}T zQrv5N<@LDzz%=rRw^mu>E@me*oNIX#yIu30SY5L6S$#E^R^w1l@of;q|D?X>Jqn^g z2McRUH|L)_6I|GsjZIC>?aZHUfzHgPZqCksuWLa(g~~9`nKj^fOTjb!6*~Xg_VCxU zzgps_(?7*p+Z$UxB{d?}uJ*=`F3kTPcVj&<%ZsZCGfFE+F#pH4REfI|lfs`%wK ze1yIEyG8lnH8J_pibg5HH*24RAcMNdWgc31`a9G&OEgruSXdTbbMPhY2aU}VrE6l- ztBk(v1LT)u)na)qw`?I)84M*!WZSgC_~DsZ6W`csz2Aw|T}|AkLG&b|s3SD8H|Ka0 z;6JoYU1-Yzpy{(oTD-&0Csn*%JWW~@D?d{R))$}o&}%;@R4zsoO{ga3nxUZ*oX~xt z1;StS zb>`vd8+72;#+|e{Qr?rY4}}`TBjsN&(wwV3y%;jBN>kCc!_MI(ksg&Y&IsJjako#Z z3d%zJh(@qqOiFmfols(^1cqSh^q9FGZSVi!t~3-7BK|Cyt*rb~ZD%O?V7{{Y2J+c@ zKU&{b2s}B(C&*{(fq`QJ{(alZpZ5H{iRGVM|JOUF(tOq?q!Ed5?lJn=P!aq6x%*TIv^?z91(Vn{dclGF>Tz_Vc&$;?< zVtLZ!|54`tPtkwk-E->so0^_R#P3A(pL~A~^#7^?(xSet,"DropCapCharStyleName")); } +void Test::testTextframeTransparentShadow() +{ + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); + uno::Reference xPicture(xDrawPage->getByIndex(0), uno::UNO_QUERY); + // ODF stores opacity of 75%, that means 25% transparency. + CPPUNIT_ASSERT_EQUAL(sal_Int32(25), getProperty(xPicture, "ShadowTransparence")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 00be1ae86b7f..5ce058fff135 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -708,6 +708,7 @@ XMLPropertyMapEntry aXMLFramePropMap[] = MG_ED( "BottomBorder", FO, BORDER_BOTTOM, XML_TYPE_BORDER, CTF_BOTTOMBORDER ), // RES_SHADOW MG_E( "ShadowFormat", STYLE, SHADOW, XML_TYPE_TEXT_SHADOW, 0 ), + MG_E( "ShadowTransparence", DRAW, SHADOW_OPACITY, XML_TYPE_NEG_PERCENT, 0 ), // RES_FRMMACRO // TODO // RES_COL