diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-24 12:19:04 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-24 13:54:04 +0100 |
commit | da4b873245b9f5a096048e2370041c6278ebaf4a (patch) | |
tree | a5824464b45873f86e01374c8819d6e4cb2db525 /sw/qa | |
parent | 0b7974c4b3b90428d452505d1c8f7dd2ab68b727 (diff) |
tdf#114309: sw_rtfexport: Add unittest
Change-Id: I78d05afa5d7fb18a4728330b769bb5e96c2ffd62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125758
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf114309.rtf | 40 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 11 |
2 files changed, 51 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf114309.rtf b/sw/qa/extras/rtfexport/data/tdf114309.rtf new file mode 100644 index 000000000000..64c7827b7319 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf114309.rtf @@ -0,0 +1,40 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq2\fcharset0 Calibri;}{\f5\fnil\fprq2\fcharset0 SimSun;}{\f6\fnil\fprq2\fcharset0 Mangal;}{\f7\fnil\fprq2\fcharset0 Times New Roman;}{\f8\fnil\fprq2\fcharset0 Cordia New;}{\f9\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f10\fnil\fprq0\fcharset128 Lohit Devanagari;}{\f11\fnil\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;} +{\stylesheet{\s0\snext0\rtlch\af9\afs24\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\faauto\hyphpar0\ltrpar\f3\fs24\lang1033\kerning1\cf0\dbch\af6\langfe2052 Normal;} +{\*\cs15\snext15 Default Paragraph Font;} +{\*\cs16\sbasedon15\snext16\rtlch\af6\afs21 \ltrch\loch\fs21 Header Char;} +{\*\cs17\sbasedon15\snext17\rtlch\af6\afs21 \ltrch\loch\fs21 Footer Char;} +{\s18\sbasedon0\snext19\rtlch\af11\afs28\alang1025 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\faauto\sb240\sa120\keepn\f3\fs28\lang1033\kerning1\dbch\af7\langfe2052 Heading;} +{\s19\sbasedon0\snext19\rtlch\af7\afs24\alang1025 \ltrch\lang1033\langfe2052\hich\af3\loch\sl288\slmult1\ql\nowidctlpar\faauto\sb0\sa140\f3\fs24\lang1033\kerning1\dbch\af5\langfe2052 Text Body;} +{\s20\sbasedon19\snext20\rtlch\af7\afs24\alang1025 \ltrch\lang1033\langfe2052\hich\af3\loch\sl288\slmult1\ql\nowidctlpar\faauto\sb0\sa140\f3\fs24\lang1033\kerning1\dbch\af5\langfe2052 List;} +{\s21\sbasedon0\snext21\rtlch\af10\afs24\alang1081\ai \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\faauto\sb120\sa120\noline\f3\fs24\lang1033\i\kerning1\dbch\af6\langfe2052 Caption;} +{\s22\sbasedon0\snext22\rtlch\af7\afs24\alang1025 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052 Index;} +{\s23\snext23\rtlch\af8\afs28\alang1054 \ltrch\lang1033\langfe2052\hich\af4\loch\sl256\slmult1\ql\widctlpar\faauto\sb0\sa160\hyphpar0\ltrpar\f4\fs22\lang1033\cf0\kerning1\dbch\af5\langfe2052 Normal Table;} +{\s24\sbasedon0\snext24\rtlch\af7\afs24\alang1025\ai \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\faauto\sb120\sa120\f3\fs24\lang1033\i\kerning1\dbch\af6\langfe2052 caption;} +{\s25\sbasedon0\snext25\rtlch\af9\afs24\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052 Header and Footer;} +{\s26\sbasedon0\snext26\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052 Header;} +{\s27\sbasedon0\snext27\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052 Footer;} +}{\*\generator LibreOfficeDev/7.3.0.0.alpha1$Linux_X86_64 LibreOffice_project/5a00326951690d820d8ea5412a93aadf3da42dc1}{\info{\creatim\yr2014\mo10\dy4\hr1\min13}{\revtim\yr2021\mo11\dy24\hr11\min49}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops{\propname Operator}\proptype30{\staticval luke}}\deftab709\deftab709 +\hyphauto1\viewscale100 +{\*\pgdsctbl +{\pgdsc0\pgdscuse451\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\headery720\margbsxn1134\footery720{\header\pard\plain \s26\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\loch\fs24\lang1033\kerning1\dbch\langfe2052\loch + +\par }{\footer\pard\plain \s27\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\loch\fs24\lang1033\kerning1\dbch\langfe2052\loch + +\par }\pgdscnxt0 Default Page Style;} +{\pgdsc1\pgdscuse451\pgndec\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1417\headery1134\margbsxn1417\footery1134\titlepg{\headerf\pard\plain \s26\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\loch\fs24\lang1033\kerning1\dbch\langfe2052\loch + +\par }\titlepg{\footerf\pard\plain \s27\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\loch\fs24\lang1033\kerning1\dbch\langfe2052\loch + +\par }\pgdscnxt0 First Page;}} +\formshade\paperh15840\paperw12240\margl1134\margr1134\margt720\margb720\sectd\sbknone\pgndec\sftnnar\saftnnrlc\sectunlocked1\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\headery720\margbsxn1134\footery720{\header\pard\plain \s26\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\loch\fs24\lang1033\kerning1\dbch\langfe2052\loch + +\par }{\footer\pard\plain \s27\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\f3\fs24\lang1033\kerning1\dbch\af6\langfe2052\loch\ql\nowidctlpar\tqc\tx4680\tqr\tx9360\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\rtlch\af6\afs21\alang1081 \ltrch\lang1033\langfe2052\loch\fs24\lang1033\kerning1\dbch\langfe2052\loch + +\par }\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +{\*\ftnsep\chftnsep}\pgndec\sftnnar\saftnnrlc\sectunlocked1\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\headery720\margbsxn1134\footery720\cols2\colsx0\ltrsect\sbknone\pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\faauto\hyphpar0\ltrpar\f3\fs24\lang1033\kerning1\cf0\dbch\af6\langfe2052\loch\li0\ri0\lin0\rin0\fi0\ltrpar{\rtlch\af7 \ltrch\loch +X} +\par \pard\plain \s0\rtlch\af9\afs24\alang1081 \ltrch\lang1033\langfe2052\hich\af3\loch\ql\nowidctlpar\faauto\hyphpar0\ltrpar\f3\fs24\lang1033\kerning1\cf0\dbch\af6\langfe2052\loch\li0\ri0\lin0\rin0\fi0\ltrpar\loch + +\par }
\ No newline at end of file diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 81cbf9723794..e9ddfdd8a079 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -1033,6 +1033,17 @@ DECLARE_RTFEXPORT_TEST(testTdf92521, "tdf92521.odt") CPPUNIT_ASSERT_EQUAL(2, getPages()); } +DECLARE_RTFEXPORT_TEST(testTdf114309, "tdf114309.rtf") +{ + // Without the fix in place, this test would have failed with + // - the property is of unexpected type or void: TextSection + auto xTextSection + = getProperty<uno::Reference<beans::XPropertySet>>(getParagraph(1), "TextSection"); + auto xTextColumns + = getProperty<uno::Reference<text::XTextColumns>>(xTextSection, "TextColumns"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount()); +} + DECLARE_RTFEXPORT_TEST(testTdf94043, "tdf94043.rtf") { auto xTextSection |