[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Dec 13 11:44:28 UTC 2016
sw/qa/extras/rtfexport/data/tdf104228.rtf | 37 ++++++++++++++++++++++++++++++
sw/qa/extras/rtfexport/rtfexport.cxx | 10 ++++++++
writerfilter/source/rtftok/rtfsprm.cxx | 2 +
3 files changed, 49 insertions(+)
New commits:
commit 657c6cc3acec0528209a8584b838cd6de581c437
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Dec 13 08:20:23 2016 +0100
tdf#104228 RTF import: fix override of style left/right para margin
See commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305:
writerfilter RTF import: override style properties like Word,
2014-06-17) for the details, this bug was about the same, just for two
more paragraph properties. Specify the default values for them, so
override of style value as direct formatting works as expected.
Change-Id: I353cc3ae8c35baf1b5ed5a83a8bd131c7bfbbe64
diff --git a/sw/qa/extras/rtfexport/data/tdf104228.rtf b/sw/qa/extras/rtfexport/data/tdf104228.rtf
new file mode 100644
index 0000000..4e5d7cf
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf104228.rtf
@@ -0,0 +1,37 @@
+{\rtf1\sste18000\ansi\deflang1040\ftnbj\uc1\deff0
+{\stylesheet
+{\f2\fs22\fi0\li0\ri0 Normal;}
+{\s2\snext0\outlinelevel1\f5\fs26\cf2\fi0\li0\ri0\sb40\sa0\sl0\outlinelevel1\keep\keepn heading 2;}
+{\s3\snext0\outlinelevel3\f5\fs22\i\cf2\fi0\li0\ri0\sb40\sa0\sl0\outlinelevel3\keep\keepn heading 4;}
+{\s4\snext4\outlinelevel1\f1\fs18\b\cf2\fi0\li0\ri0\outlinelevel1 MyTitolo 2
+;}
+{\s7\snext7\f1\fs19\fi0\li1192\ri0 Body Text;}
+{\s10\snext10\f2\fs22\tqc\tx4819\tqr\tx9638\fi0\li0\ri0 header;}
+{\s12\snext12\f2\fs22\tqc\tx4819\tqr\tx9638\fi0\li0\ri0 footer
+;}
+}
+\paperw11908\paperh16833\margl851\margr851\margt851\margb851\headery567\footery567\htmautsp1\nogrowautofit\deftab708\formshade\nofeaturethrottle1\fet4\aenddoc\aftnnrlc\pgbrdrhead\pgbrdrfoot
+\sectd\pgwsxn11908\pghsxn16833\marglsxn851\margrsxn851\margtsxn851\margbsxn851\headery567\footery567\sbkpage\pgncont\pgndec\ltrsect
+\plain\plain\f0\fs24
+\pard\ssparaaux0\s4\sb240\ltrpar\qj\outlinelevel1\lang1040\hich\f3\dbch\f3\loch\f3\fs18\expnd0\expndtw-2\ltrch\b Before\par
+\trowd\trgaph28\lastrow\trftsWidth3\trwWidth10010\trpaddl28\trpaddfl3\trpaddr28\trpaddfr3\trpaddt28\trpaddft3\trpaddb28\trpaddfb3\trleft-31\ltrrow
+\clvertalt\clbrdrt\brdrs\brdrw5\clbrdrb\brdrs\brdrw5\clbrdrl\brdrs\brdrw5\clbrdrr\brdrs\brdrw5\clpadl28\clpadfl3\clpadr28\clpadfr3\clpadt28\clpadft3\clpadb28\clpadfb3\cellx422
+\clvertalt\clbrdrt\brdrs\brdrw5\clbrdrb\brdrs\brdrw5\clbrdrl\brdrs\brdrw5\clbrdrr\brdrs\brdrw5\clpadl28\clpadfl3\clpadr28\clpadfr3\clpadt28\clpadft3\clpadb28\clpadfb3\cellx3853
+\clvertalt\clbrdrt\brdrs\brdrw5\clbrdrb\brdrs\brdrw5\clbrdrl\brdrs\brdrw5\clbrdrr\brdrs\brdrw5\clpadl28\clpadfl3\clpadr28\clpadfr3\clpadt28\clpadft3\clpadb28\clpadfb3\cellx4874
+\clvertalt\clbrdrt\brdrs\brdrw5\clbrdrb\brdrs\brdrw5\clbrdrl\brdrs\brdrw5\clbrdrr\brdrs\brdrw5\clpadl28\clpadfl3\clpadr28\clpadfr3\clpadt28\clpadft3\clpadb28\clpadfb3\cellx5895
+\clvertalt\clbrdrt\brdrs\brdrw5\clbrdrb\brdrs\brdrw5\clbrdrl\brdrs\brdrw5\clbrdrr\brdrs\brdrw5\clpadl28\clpadfl3\clpadr28\clpadfr3\clpadt28\clpadft3\clpadb28\clpadfb3\cellx6916
+\clvertalt\clbrdrt\brdrs\brdrw5\clbrdrb\brdrs\brdrw5\clbrdrl\brdrs\brdrw5\clbrdrr\brdrs\brdrw5\clpadl28\clpadfl3\clpadr28\clpadfr3\clpadt28\clpadft3\clpadb28\clpadfb3\cellx7937
+\clvertalt\clbrdrt\brdrs\brdrw5\clbrdrb\brdrs\brdrw5\clbrdrl\brdrs\brdrw5\clbrdrr\brdrs\brdrw5\clpadl28\clpadfl3\clpadr28\clpadfr3\clpadt28\clpadft3\clpadb28\clpadfb3\cellx8958
+\clvertalt\clbrdrt\brdrs\brdrw5\clbrdrb\brdrs\brdrw5\clbrdrl\brdrs\brdrw5\clbrdrr\brdrs\brdrw5\clpadl28\clpadfl3\clpadr28\clpadfr3\clpadt28\clpadft3\clpadb28\clpadfb3\cellx9979
+\pard\intbl\ssparaaux0\s7\ltrpar\ql\keep\keepn\widctlpar\plain\f0\fs24\lang1033\hich\f3\dbch\f3\loch\f3\fs16\ltrch\b A1\cell
+\pard\intbl\ssparaaux0\s7\ltrpar\ql\keep\keepn\widctlpar\plain\f0\fs24\lang1033\hich\f3\dbch\f3\loch\f3\fs16\ltrch\b B1\cell
+\pard\intbl\ssparaaux0\s7\ltrpar\qc\keep\keepn\widctlpar\plain\f0\fs24\lang1033\hich\f3\dbch\f3\loch\f3\fs16\ltrch\b C1\cell
+\pard\intbl\ssparaaux0\s7\ltrpar\qc\keep\keepn\widctlpar\plain\f0\fs24\lang1033\hich\f4\dbch\f4\loch\f4\fs16\ltrch\b D1\cell
+\pard\intbl\ssparaaux0\s7\ltrpar\qc\keep\keepn\widctlpar\plain\f0\fs24\lang1033\hich\f3\dbch\f3\loch\f3\fs16\ltrch\b E1\cell
+\pard\intbl\ssparaaux0\s7\ltrpar\qc\keep\keepn\widctlpar\plain\f0\fs24\lang1033\hich\f4\dbch\f4\loch\f4\fs16\ltrch\b F1\cell
+\pard\intbl\ssparaaux0\s7\ltrpar\qc\keep\keepn\widctlpar\plain\f0\fs24\lang1033\hich\f4\dbch\f4\loch\f4\fs16\ltrch\b G1\cell
+\pard\intbl\ssparaaux0\s7\ltrpar\qc\keep\keepn\widctlpar\plain\f0\fs24\lang1033\hich\f3\dbch\f3\loch\f3\fs16\ltrch\b H1\cell
+\hich\f2\dbch\f2\loch\f2\fs22\ltrch\b0\intbl\row
+\pard\par
+After\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 9ed2f52..1e353dc 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1132,6 +1132,16 @@ DECLARE_RTFEXPORT_TEST(testTdf103925, "tdf103925.rtf")
CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getRun(getParagraph(1), 1), "CharFlash"));
}
+DECLARE_RTFEXPORT_TEST(testTdf104228, "tdf104228.rtf")
+{
+ uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("C1"), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xCell->getText());
+ // This was 2103, implicit 0 as direct formatting was ignored on the
+ // paragraph (and the style had this larger value).
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xParagraph, "ParaLeftMargin"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index 2877dbf..c7096f1 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -144,6 +144,8 @@ static RTFValue::Pointer_t getDefaultSPRM(Id const id)
case NS_ooxml::LN_CT_Spacing_before:
case NS_ooxml::LN_CT_Spacing_after:
case NS_ooxml::LN_EG_RPrBase_b:
+ case NS_ooxml::LN_CT_Ind_left:
+ case NS_ooxml::LN_CT_Ind_right:
return std::make_shared<RTFValue>(0);
default:
More information about the Libreoffice-commits
mailing list