From 71ccb4b03138cc72d3106694a8c2bed2a49fe17c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 29 Mar 2013 12:30:52 +0100 Subject: [PATCH] implement RtfAttributeOutput::PlaceholderField Change-Id: Ib6fd380736c5567a98317ec117969d8c76a31f02 --- sw/qa/extras/rtfexport/data/placeholder.odt | Bin 0 -> 8752 bytes sw/qa/extras/rtfexport/rtfexport.cxx | 11 +++++++++++ sw/source/filter/ww8/rtfattributeoutput.cxx | 7 +++++-- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 sw/qa/extras/rtfexport/data/placeholder.odt diff --git a/sw/qa/extras/rtfexport/data/placeholder.odt b/sw/qa/extras/rtfexport/data/placeholder.odt new file mode 100644 index 0000000000000000000000000000000000000000..5bc1097ded02fe46cd839b8c85c9d2aa3fbe5973 GIT binary patch literal 8752 zcmeHscUTkK+I{GugCGimfG8+Rk&g5#ouEjUB7{yt?@hX)O79)%(h-m%AWcB&0-=cX z-Vy>x`NFwBuHJJ!=XdYF-}AlCGtcZvX04govuD3+y&I&6g-rOEz2n7B?hQ|Lh{vZQ88nL_DSck{-N2G942BN$Oq~G7^3=%H~R;^p+YFM&5T@ySA zth>X+Xl6SsJGrJZ5B5AWFaGJYua3@2@|&E&Ts^D8vyIcL z8e*A(?H|hYHr0h>pDT&NM{%y6bn>PZK31^B<|QIwYr7Ffpqk8sWqTWw)>7rJP!2A@t0=)$d*U8->>zql01ZY615X^u7`Z!m6DL8 z#WlJTaOg|X(82S`9ud%sldmX68K5R!iN#ErPuV4?1B<}|T1?-;%jTXZ=|Ex0d-uUb zDa8(US{j3D8C(z#RIPCc^s4weiiN2U`65EThYOjaDjEcP@#r=si}d4jVWw}H-PhL zFy9J+QO)m>YO&WeL_&^vKGtcbTzv&iHi|RqKWZMZVxnS8=k<2xd1n}pDZdP}cbUk@ z3#>JoN)q<1h=kF4xjtN(nAJYP0x9AFo5pz62QdHuI2Hi#*TaAaJs=#wj*b=(Glz?z z(4;f#F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5HjMcxxy0Ta<#UmwIA9LDvEeq_XK{Z^k9AGJ(Wf+IK@9&TFW zPR9291a$S7mXlvDApOYo@LKuy8R>1E`a_^Op=_gkb|Y1CSp2q|7iB%ke1C}+!QCbpvw}KF z_H8yVJS~qjT85sCBYTquZEg(R+F42p1LFs=^`eNU&M_ryLNfWVR~`&8a0wfAc`v-H zPoJBGYs3zJq_z?zSaL{9{U)hYGWgAx^2_G*94(-OOdp5l<=t%tQCcmJ+^jE;=WnX^ zcx7|(5j2Rp1#i+_nO7%#5mJ_dd>0wqpj|$nimYyk;g1ZrczT`jyT;wpR!KfDvPXeC zD8yM;%?`x4O#)LjXkD=F(~X>&wjo0JD+8Yo|EQrFbog@7qNThjx?}@V#K5Ek{PkMx zg{=D-mn*lIs7nR;>pI;ZitwKhWpoR@+WW^6?VnM<)^ab_@P39mT2cPGqW5RyujQzV zTJO&=MPL4x%I_uc(yRQrTJ;k+jpq5Q+SMh?<>UV9h5q%%v&qnp`-^$JL|$J1=k)-9 z3$OGuX376uc>kMo`qy{$6Z{YF^z)eZ%DZJZt9`)bw{OYX!Q=YKj@cinu{+j2) zYyFImzu~d{7w7fYOcyTdXPo_p>8BI>Pg!^<{=J`nIiG ztqZUAGctd}@)yqSa#UWD{yN`YIJKXFLX-aVZGXo7I+0w=#y>+5{oZ~%H-i*${;0!{ P1IPik==rCJ?gI2bgbi_E literal 0 HcmV?d00001 diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index fffb9591af30..ec0ff695d526 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -72,6 +72,7 @@ public: void testFdo52286(); void testFdo61507(); void testFdo30983(); + void testPlaceholder(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -118,6 +119,7 @@ void Test::run() {"fdo52286.odt", &Test::testFdo52286}, {"fdo61507.rtf", &Test::testFdo61507}, {"fdo30983.rtf", &Test::testFdo30983}, + {"placeholder.odt", &Test::testPlaceholder}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -495,6 +497,15 @@ void Test::testFdo30983() CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xDraws->getByIndex(0), "VertOrientRelation")); } +void Test::testPlaceholder() +{ + // Only the field text was exported, make sure we still have a field with the correct Hint text. + uno::Reference xRun(getRun(getParagraph(1), 2)); + CPPUNIT_ASSERT_EQUAL(OUString("TextField"), getProperty(xRun, "TextPortionType")); + uno::Reference xField = getProperty< uno::Reference >(xRun, "TextField"); + CPPUNIT_ASSERT_EQUAL(OUString("place holder"), getProperty(xField, "Hint")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 47ad371d8d0a..9636254b19a3 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3074,9 +3074,12 @@ bool RtfAttributeOutput::DropdownField( const SwField* /*pFld*/ ) return true; } -bool RtfAttributeOutput::PlaceholderField( const SwField* ) +bool RtfAttributeOutput::PlaceholderField( const SwField* pField) { - return true; // expand to text? + m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST " MACROBUTTON None "); + RunText(pField->GetPar1()); + m_aRunText->append("}}"); + return false; // do not expand } RtfAttributeOutput::RtfAttributeOutput( RtfExport &rExport )