summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-10-10 07:58:26 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-10-17 20:20:59 +0200
commit8c71b0824c1f86d0966394b9e1ef4ebf7b6fa729 (patch)
tree25d3ce0473d9ae4c714e95f94062a351f1f31faf
parentd7b35fc5a86e398c3bb09a4f50ad2060dfcc6d83 (diff)
tdf#112211 RTF import: fix unwanted direct formatting for other indents
Commit 56a695fddb915bcba13b088b5b2b4e0841d4acbc (tdf#112211 RTF import: fix unwanted direct formatting for left indents, 2017-09-26) fixed left indents, and given that it was a regression fix, left the other indent types untouched. As it has been pointed out in the bug comment, the original bugdoc actually needs the other indent types removed as well, so let's do that. (cherry picked from commit 295cf49b81b8c008ec0ea2c92f7cf729d5523d4e) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Ia4ea7e2214b7df27536f46b046f90bd703c107be Reviewed-on: https://gerrit.libreoffice.org/43448 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sw/qa/extras/rtfimport/data/tdf112211-2.rtf43
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx9
-rw-r--r--writerfilter/source/rtftok/rtfsprm.cxx6
3 files changed, 52 insertions, 6 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf112211-2.rtf b/sw/qa/extras/rtfimport/data/tdf112211-2.rtf
new file mode 100644
index 000000000000..ed822e1f988b
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf112211-2.rtf
@@ -0,0 +1,43 @@
+{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs1025
+{\fonttbl
+{\f0\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\f3\fbidi \froman\fcharset2\fprq2 Symbol;}
+{\f39\fbidi \fswiss\fcharset0\fprq2 Verdana;}
+}
+\noqfpromote
+{\stylesheet
+{\ql \li0\ri0\sl240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f38\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+\snext0 \sqformat \spriority14 \styrsid11343869 Normal;}
+{\s59\ql \li720\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f39\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+\sbasedon0 \snext59 \sqformat \spriority34 \styrsid12276622 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\ls24}
+}
+\paperw12240\paperh15840\margl1440\margr1440\margt1800\margb1440\gutter0\ltrsect
+\facingp\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml1\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1
+\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace187\dgvspace187\dghorigin1440\dgvorigin1800\dghshow1\dgvshow1
+\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
+\asianbrkrule\rsidroot15035986\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0
+\pard\plain AB{\b C}D{\b E}FGHIJKL\par
+\pard\plain \ltrpar\s59\ql \fi-360\li720\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls24\adjustright\rin0\lin720\pararsid7821880\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f39\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\rtlch\fcs1 \afs16
+\ltrch\fcs0 \f39\fs16\insrsid16134103\charrsid16134103 Profile 1 \endash }
+{\rtlch\fcs1 \afs16 \ltrch\fcs0 \f39\fs16\insrsid5270339 A1}
+{\rtlch\fcs1 \afs16 \ltrch\fcs0 \f39\fs16\insrsid16134103\charrsid16134103
+\par
+}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index a69e8185fbeb..69390fbfae67 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -764,6 +764,15 @@ DECLARE_RTFIMPORT_TEST(testFdo36089, "fdo36089.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int16(-50), getProperty<sal_Int16>(getRun(getParagraph(1), 2), "CharEscapement"));
}
+DECLARE_RTFIMPORT_TEST(testTdf112211_2, "tdf112211-2.rtf")
+{
+ uno::Reference<beans::XPropertyState> xPropertyState(getParagraph(2), uno::UNO_QUERY);
+ beans::PropertyState ePropertyState = xPropertyState->getPropertyState("ParaLeftMargin");
+ // This was beans::PropertyState_DIRECT_VALUE -> direct formatting
+ // prevented inheritance from numbering definition.
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, ePropertyState);
+}
+
DECLARE_RTFIMPORT_TEST(testFdo49892, "fdo49892.rtf")
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index 5ff40c8cd9cc..f6301243de1a 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -163,12 +163,6 @@ static bool isSPRMDeduplicateBlacklist(Id nId)
case NS_ooxml::LN_CT_TabStop_val:
case NS_ooxml::LN_CT_TabStop_leader:
case NS_ooxml::LN_CT_TabStop_pos:
- // Erasing these just because they equal to the style one is
- // problematic, as then the used value won't be from the style, but
- // possibly from the numbering.
- case NS_ooxml::LN_CT_Ind_right:
- case NS_ooxml::LN_CT_Ind_firstLine:
- case NS_ooxml::LN_CT_Ind_hanging:
// \htmautsp arrives after the style table, so only the non-style value is
// correct, keep these.
case NS_ooxml::LN_CT_Spacing_beforeAutospacing: