From f8b5ecc622e2b3e82576b27bf0ded9c8eac21cae Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 24 Oct 2017 09:27:19 +0200 Subject: tdf#113202 RTF import: fix lack of expected contextual spacing Upper, lower and contextual spacing are all stored in SvxULSpaceItem, so if after spacing is set as direct formatting, contextual spacing has to be set directly as well (having it in the paragraph style has no effect). Change-Id: Ie331c7561de7f2f16776a1613717e38fa083a541 Reviewed-on: https://gerrit.libreoffice.org/43735 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sw/qa/extras/rtfexport/data/tdf113202.rtf | 42 +++++++++++++++++++++++++++++++ sw/qa/extras/rtfexport/rtfexport.cxx | 6 +++++ 2 files changed, 48 insertions(+) create mode 100644 sw/qa/extras/rtfexport/data/tdf113202.rtf (limited to 'sw/qa/extras/rtfexport') diff --git a/sw/qa/extras/rtfexport/data/tdf113202.rtf b/sw/qa/extras/rtfexport/data/tdf113202.rtf new file mode 100644 index 000000000000..43860bf0becf --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf113202.rtf @@ -0,0 +1,42 @@ +{\rtf1\adeflang1037\ansi\ansicpg1252\uc1\adeff1\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0 +{\fonttbl +{\f0\fbidi \froman\fcharset238\fprq2 Times New Roman;} +{\f3\fbidi \froman\fcharset2\fprq2 Symbol;} +{\f40\fbidi \fswiss\fcharset238\fprq2 Verdana;} +} +\noqfpromote +{\stylesheet +{\s15\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af1\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext15 \sqformat \spriority34 List Paragraph;} +} +{\*\listtable +{\list\listtemplateid1644085804\listhybrid +{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext +\leveltemplateid67698689\'01\u-3913 ?;} +{\levelnumbers;} +\f3\fbias0 \fi-360\li720\lin720 } +{\listname ;} +\listid2028170298} +} +{\*\listoverridetable +{\listoverride\listid2028170298\listoverridecount0\ls1} +} +\paperw12240\paperh15840\margl1417\margr1417\margt1417\margb1417 +\pard\plain \ltrpar +\s15\ql \fi-360\li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af1\afs22\alang1025 \ltrch\fcs0 +\f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 +{\rtlch\fcs1 \af37\afs16 \ltrch\fcs0 \f40\fs16 Profile 1 \endash A1\par} +{\rtlch\fcs1 \af37\afs16 \ltrch\fcs0 \f40\fs16 Profile 1 \endash A2\par} +{\rtlch\fcs1 \af37\afs16 \ltrch\fcs0 \f40\fs16 Profile 1 \endash A3\par} +\pard \ltrpar\s15\ql \fi-360\li720\ri0\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0\contextualspace +{\rtlch\fcs1 \af37\afs16 \ltrch\fcs0 \f40\fs16 Profile 4 } +{\rtlch\fcs1 \af37\afs16 \ltrch\fcs0 +\f40\fs16 \endash } +{\rtlch\fcs1 \af37\afs16 \ltrch\fcs0 \f40\fs16 } +{\rtlch\fcs1 \af37\afs16 \ltrch\fcs0 \f40\fs16 A4} +{\rtlch\fcs1 \af37\afs16 \ltrch\fcs0 +\f40\fs16 +\par } +\pard\plain\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 5664cc8872f6..5923007b8d3a 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -1307,6 +1307,12 @@ DECLARE_RTFEXPORT_TEST(testTdf112211, "tdf112211.rtf") CPPUNIT_ASSERT_EQUAL(static_cast(-635), aRule["FirstLineIndent"].get()); } +DECLARE_RTFEXPORT_TEST(testTdf113202, "tdf113202.rtf") +{ + // This failed, contextual spacing in 4th paragraph was lost. + CPPUNIT_ASSERT(getProperty(getParagraph(4), "ParaContextMargin")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit