From ac03883cd66a2d58c17c8dac555a053586e46625 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 6 Jan 2017 09:42:20 +0100 Subject: [PATCH] tdf#105127 VML import: handle I don't see an easy way to implement this via UNO, so use the internal API. As to the internal API usage, SdrEditView::MirrorMarkedObjVertical() (for UI) and SvxMSDffManager::ImportShape() (for WW8 import) are example client code. Change-Id: I9bf27788db32fd35d6b56e0f1a240c4b7abc5604 --- oox/source/vml/vmlshape.cxx | 22 +++++++++++++++++++ sw/qa/extras/ooxmlimport/data/tdf105127.docx | Bin 0 -> 10430 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 7 ++++++ 3 files changed, 29 insertions(+) create mode 100644 sw/qa/extras/ooxmlimport/data/tdf105127.docx diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index c978c3970480..0b68675ae72e 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -1058,6 +1058,28 @@ Reference< XShape > BezierShape::implConvertAndInsert( const Reference< XShapes aPropSet.setProperty( PROP_PolyPolygonBezier, aBezierCoords ); } + // Handle horizontal and vertical flip. + if (!maTypeModel.maFlip.isEmpty()) + { + if (SdrObject* pShape = GetSdrObjectFromXShape(xShape)) + { + if (maTypeModel.maFlip.startsWith("x")) + { + Point aCenter(pShape->GetSnapRect().Center()); + Point aPoint2(aCenter); + aPoint2.setY(aPoint2.getY() + 1); + pShape->NbcMirror(aCenter, aPoint2); + } + if (maTypeModel.maFlip.endsWith("y")) + { + Point aCenter(pShape->GetSnapRect().Center()); + Point aPoint2(aCenter); + aPoint2.setX(aPoint2.getX() + 1); + pShape->NbcMirror(aCenter, aPoint2); + } + } + } + // Hacky way of ensuring the shape is correctly sized/positioned xShape->setSize( awt::Size( rShapeRect.Width, rShapeRect.Height ) ); xShape->setPosition( awt::Point( rShapeRect.X, rShapeRect.Y ) ); diff --git a/sw/qa/extras/ooxmlimport/data/tdf105127.docx b/sw/qa/extras/ooxmlimport/data/tdf105127.docx new file mode 100644 index 0000000000000000000000000000000000000000..3cdfa7fb3a6ee4ea3210798e2b31ba7893eea557 GIT binary patch literal 10430 zcmeHt^;=xYwszyzxH}2%5<+lyXxt?@1cJM}OVAK31P>B|OK7YixNC5?-~{)tGxyAy zOwK&_`vdN&AF8XLz2CKWRlRF3D-{Jecsu|i02u%PJOM1;y?tQ`0{~DV006iEWLSL( z2YXiwdsib3FGmX(LpD!4TdF*GScV(`EcE{Ww*SK`P^&Ru-@$>^ti3BD*{T(l8&O({ zOm@RtFIz}yypOJPu5j_==GGooQWH&#X%mN0_h@i`|7*zDT!t+Qr}dHiG`lwo9DU2U zy;gO6pMw8Lb!Z2pNpnb&9aYuX@r@0~EW9kS8(5>7&(w28u#ZnC5tXuCweZInYQZ<& zb+KM$PB{Phy+x<*J6dM!S4?fjldDfMc%=uH5={sNo#INuv#8YLgTOv>FMW)(hNY^uC) zcefrHB+2T1oX(>JaJPe6V2a1eP)$HR68fNAf3$y8R2m6y=8^Ufy`AKzS{#0DX}8Pm z;LzIZWZ?%$?7f?+2c;~z!(qcJA(UB%z|V zv;VJJ{vX!GU#1?LG%pV)1`Iz!ST^bPdohptbbNM6HrM0n9$aYpK8y#(V8L8#OFmVT z%KXc%v+V)p>CBMKNr8`oh!rNfQ#mu4#xl#VJ?$D|kW_Sg^)rI4&}D`zt?eDA*##3* zas^{K%ktK0!o_HWpISbv%r^+@ZPjQ>Ad^E;k53#VJ&!GGYVA4GhRaAVn$tzMwmK56 z>(Svcn#M4ELE?{Uc{DQ+h2M*0;xNl*%493o?Hp&rc+Ns%%P~UxKGF0OD$j~_-qg9| zqfyM8Fcy?tl&FzYU$-ncy_cA-vw2=U6#|q`bXf@ed~PK|YS>>1Lk-n`>d3Ttjp_|_ zK{(+605SkFjE94>Is5-8in)WCn;q1e{WN2LDh&+OmO@h zSOxBLLwmoZh<+}=1w^+zqLMLl&u_caNwzU#oZ$@>7FgASXGc?aq*h5#J1{N3U55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R^w=!8yXW~>CI^cx>+40L}6pwA1t=F<5&&mS6CR+8(HFHC-RFx+oEaYZ}3 zz?59sp13-;cE=fd_ztj7k-A8~^*Rv#oPAD_CoaSO&LsR4R9qK^O5A4Q zn|2Zzs8Gd02y{_RlIa5-@trz;%9Q^93U>d%x=%>!pe$r92fHgA;;aov%xjH;gRcWT z1{(|jmALvI7N5WcZ6XtYO+CxOIC(!U0z21zXsr;Oplb7$Ax^*P$myNZCRK;)l2g*k z?uXNrWC6g$P6Xq*=Qes4MJWYg$GY6b3f7hNp@*ZnmG&V^!}LmEg3vcjGMEmRSA>pK z#k|vI0`o4yqga@l_zfqI^$7SPo#_pYwl2QD4~JdAdPpbkF#?F^eI(C{6uea-e-=Z1 z$L*qABX;Yd+JL{8>)vXm^ml_QhlkaJ{yLvppPC5=v&%@2t5~020W0=)I<_Sc(&`LB z)8uyUvO`$;5R((q*h;6AjRZ{3!*RfCwvChbj+U#}UlfzrVdKk*TV6Y4^wv2kE5E5y znpP~Y<@BCk66v(t*y(!$mq4OvwNOYd=`&n#dmwM=i1Eqnq0L6$=(u@q{i~aRsbS-N zKim;#MM=%WivBfY!0BJ1GYl*%G|u|xgI+(qnqS*L9Q#sH_`86=A4T~U`~g}({pDcF z@4&y;=YIuuLK9g3TebdoNxxTX|C03xJMq^t*`PQ*VEX zsKx!$DfuOw{T=>$2IDXICxU;$|CZ1A9shd>{TKc<(ZBG&1=PPw_(getShape(1), "PolyPolygonBezier"); + // This was 1910, the shape was rendered upside down. + CPPUNIT_ASSERT_EQUAL(static_cast(3257), aPolyPolygon.Coordinates[0][0].Y); +} + DECLARE_OOXMLIMPORT_TEST(testfdo76583, "fdo76583.docx") { // The problem was that the floating table was imported as a non-floating one.