diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-07-08 21:25:44 +0200 |
---|---|---|
committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | 2019-07-09 12:53:12 +0200 |
commit | 0e6fdee15df8928c33308b353a7b80de150aca6b (patch) | |
tree | 25b845086ace1d09bff0a65fff76f21690d13f70 /sw | |
parent | fe34686967e6dd94b9d76bca94a1efe99f5888a0 (diff) |
tdf#126173 RTF import: fix lost SHAPE fields
Commit 5a5d55a8a0f82406a8001015a723596f21d3562c (fdo#82860 RTF import:
fix handling of SHAPE fields, 2014-10-15) already tried to handle this,
but aCode is the shape command + its parameters (SHAPE \* MERGEFORMAT)
for the bugdoc, while what we want is just the shape command.
The field variable already contains a tokenized version, which was used
previously only to decide if a field is unhandled or not.
Reuse that for the shape comparison, so bugdoc's shape with parameters
also appears.
Change-Id: I7e044b94bcfab490c956b33c11dd6c69443939f5
Reviewed-on: https://gerrit.libreoffice.org/75243
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 9a15a75dfa7ab8c5d51c411e0e39d68d22b7587a)
Reviewed-on: https://gerrit.libreoffice.org/75288
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf126173.rtf | 85 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 7 |
2 files changed, 92 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf126173.rtf b/sw/qa/extras/rtfimport/data/tdf126173.rtf new file mode 100644 index 000000000000..f4990516c1d5 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf126173.rtf @@ -0,0 +1,85 @@ +{\rtf1 +\pard\plain +{\field\fldlock +{\*\fldinst +{\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid6882621 \hich\af31506\dbch\af31505\loch\f31506 SHAPE \\* MERGEFORMAT } +} +{\fldrslt +{ +\rtlch\fcs1 \af1 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid11561886 +{\shp +{\*\shpinst\shpleft0\shptop0\shpright2565\shpbottom1380\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplockanchor\shplid1026 +{\sp +{\sn shapeType} +{\sv 202} +} +{\sp +{\sn fillColor} +{\sv 16777215} +} +{\sp +{\sn fRecolorFillAsPicture} +{\sv 0} +} +{\sp +{\sn fUseShapeAnchor} +{\sv 0} +} +{\sp +{\sn fFilled} +{\sv 1} +} +{\sp +{\sn lineWidth} +{\sv 6350} +} +{\sp +{\sn fLine} +{\sv 1} +} +{\sp +{\sn wzName} +{\sv Text Box 1} +} +{\sp +{\sn posrelh} +{\sv 3} +} +{\sp +{\sn posrelv} +{\sv 3} +} +{\sp +{\sn fLayoutInCell} +{\sv 1} +} +{\sp +{\sn fAllowOverlap} +{\sv 1} +} +{\sp +{\sn fBehindDocument} +{\sv 0} +} +{\sp +{\sn fHidden} +{\sv 0} +} +{\sp +{\sn fPseudoInline} +{\sv 1} +} +{\shptxt +\ltrpar \pard\plain \ltrpar\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af1\afs22\alang1025 \ltrch\fcs0 +\fs22\lang1033\langfe2052\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 +{\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid3175535 \hich\af31506\dbch\af31505\loch\f31506 test +\par } +} +} +} +} +{\rtlch\fcs1 \af1 \ltrch\fcs0 \insrsid6882621 +} +} +} +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 92ef3de21d9d..45a54092454e 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -933,6 +933,13 @@ DECLARE_RTFIMPORT_TEST(testUnbalancedColumns, "unbalanced-columns.rtf") getProperty<bool>(xTextSections->getByIndex(0), "DontBalanceTextColumns")); } +DECLARE_RTFIMPORT_TEST(testTdf126173, "tdf126173.rtf") +{ + // Without the accompanying fix in place, this test would have failed, as the TextFrame was lost + // on import. + CPPUNIT_ASSERT(getShape(1).is()); +} + DECLARE_RTFIMPORT_TEST(testFdo84685, "fdo84685.rtf") { // index mark was not imported |