From a22ef599bd3fdcf0bd5c3616aa566a5922624ff3 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 7 Jun 2013 11:49:10 +0200 Subject: [PATCH] bnc#820788 VML import of v:textbox's mso-fit-shape-to-text style property Change-Id: I74a0ecd50ca61a4f5bf7ebdbf12743dc1fd9368a --- oox/source/vml/vmltextboxcontext.cxx | 4 ++++ sw/qa/extras/ooxmlimport/data/n820788.docx | Bin 0 -> 10267 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100755 sw/qa/extras/ooxmlimport/data/n820788.docx diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx index ca124bcb4d18..0adf9431ff03 100644 --- a/oox/source/vml/vmltextboxcontext.cxx +++ b/oox/source/vml/vmltextboxcontext.cxx @@ -187,6 +187,10 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBo if( ConversionHelper::separatePair( aName, aValue, sStyle.getToken( 0, ';', nIndex ), ':' ) ) { if( aName == "layout-flow" ) rTextBox.maLayoutFlow = aValue; + else if (aName == "mso-fit-shape-to-text") + rTextBox.mrTypeModel.mbAutoHeight = true; + else + SAL_WARN("oox", "unhandled style property: " << aName); } } } diff --git a/sw/qa/extras/ooxmlimport/data/n820788.docx b/sw/qa/extras/ooxmlimport/data/n820788.docx new file mode 100755 index 0000000000000000000000000000000000000000..759c4085d6e48e54d954bd2a6ae184b9f249c09b GIT binary patch literal 10267 zcmeHNWmH_tvL4(uxCeI&uECu^a0~7X?gR<$4k17$xP~Bu1Pea66Wl#Wa0~V(dF#A$ zPVRYcz5n;lTGP8{?Oiq9y}#6W4RBl9B z88X=qfqMBuN|OT&-3z75(;v5vu+my+63kn;OnOH{2M66D=@#7zMoOAH<#2(F>HG*c|t0Mh^x=E;%?dpZ6sq5g>whc>R}|qfBrIDH@RMKP5+D$EL$7Fc}M7 zgwU;U;Z4nDE4Yz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Ck>JfDWjmr1*&!Qf6BLf)1plk^BgTv0Lf}NUs&9Ukw~log8C#D+ zq~zC?G(MW&0kZN-<#Ue{S+&0LQslB3LHHQ59Mr)W{$PZg34<0KD(|gEs)1Oj#_pfZ z|4Z#b((h`a;1*HWo*g@oVp$t zwl%Nk&RcqVgf~vi_(0ihBc$2w7E4h!_AQahm6|b6Zq&U4g-|d%b&Tu;IItW=`RwsV zwsy8D+deJ&y-;<^G_b-Ty_>#_^^O^J4sY?efc5U_Y5tyLy8!#PN#uN|Vink`YDklL zv&LPQ%LxoT4zy?AJP~!X8a_h<(HaxiR@gQ=1@Nws9)eUMY78tz(=Y8C?I}KVaJe3D zX25{EEv**|-%Fp(7e_2*S{Gq`w7hRqFfh(BKD1qLdQ#247_dWp^t7_N{9)JNBt__! z@(=$B1Iq@bS^s=m>Q_+nm*yYNPN^yVUBTbabNodX@Bvy?{LAT%-v$3(H*7qr^) zf0ev{YNCMqNfrO8YX8ospHS}=KFZthi_U{`0 zPFMew2LM3Ob^e{a{x1D@9`RRcDQGe6f299l6~BxB9^L(^;DG#()%%}VPfZB{3Y(v2 QiqHUaP~O5y_w(0(0fFuGasU7T literal 0 HcmV?d00001 diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index b30ebd6f465e..b1fc3d5c4ba2 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -118,6 +118,7 @@ public: void testPageBorderShadow(); void testN816593(); void testN820509(); + void testN820788(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -203,6 +204,7 @@ void Test::run() {"page-border-shadow.docx", &Test::testPageBorderShadow}, {"n816593.docx", &Test::testN816593}, {"n820509.docx", &Test::testN820509}, + {"n820788.docx", &Test::testN820788}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1451,6 +1453,16 @@ void Test::testN820509() CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty(xPropertySet, "DateFormat")); } +void Test::testN820788() +{ + // The problem was that AutoSize was not enabled for the text frame. + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + // This was text::SizeType::FIX. + CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty(xFrame, "SizeType")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT();