summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfexport
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-02-24 18:06:21 +0100
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2020-02-24 21:03:30 +0100
commit74a25e38056a608f0a013b43689a3c03ee710837 (patch)
tree5b7cc701538141e647c405f350bf1d5b6e207868 /sw/qa/extras/rtfexport
parent911d6451730823aa15b0082eb94f1877755d6ca6 (diff)
tdf#130817: Add unittest
Change-Id: Icb7db08dc7884074f980ab101eac8a1998482ada Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89367 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf130817.rtf82
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx20
2 files changed, 102 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf130817.rtf b/sw/qa/extras/rtfexport/data/tdf130817.rtf
new file mode 100644
index 000000000000..8834fd336a35
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf130817.rtf
@@ -0,0 +1,82 @@
+{\rtf1\ansi\deff0\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Arial;}{\f4\froman\fprq2\fcharset0 Cambria;}{\f5\froman\fprq2\fcharset0 Calibri;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f7\fnil\fprq2\fcharset0 Cambria;}{\f8\fnil\fprq2\fcharset0 Times New Roman;}{\f9\fnil\fprq2\fcharset0 Lucida Sans;}{\f10\fswiss\fprq0\fcharset128 Lucida Sans;}}
+{\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\ql\nowidctlpar\hyphpar0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040 Normal;}
+{\s1\sbasedon38\snext1\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\langfe1081\dbch\af9\afs28\loch\f2\fs28\lang1040 Heading 1;}
+{\s2\sbasedon38\snext2\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\langfe1081\dbch\af9\afs28\loch\f2\fs28\lang1040 Heading 2;}
+{\*\cs15\snext15 Default Paragraph Font;}
+{\*\cs16\sbasedon15\snext16\cf1\b\kerning1\dbch\af8\langfe1081\loch\f4\fs29 Titolo 1 Carattere;}
+{\*\cs17\sbasedon15\snext17\cf1\i\b\kerning1\dbch\af8\langfe1081\loch\f4\fs25 Titolo 2 Carattere;}
+{\*\cs18\sbasedon15\snext18\cf1\b\kerning1\dbch\af8\langfe1081\loch\f4\fs23 Titolo 3 Carattere;}
+{\*\cs19\snext19\dbch\af8 Richiamo alla nota di chiusura;}
+{\*\cs20\snext20 Caratteri nota di chiusura;}
+{\*\cs21\snext21 Richiamo alla nota a pi\u232\'e8e8e8 di pagina;}
+{\*\cs22\snext22 Caratteri nota a pi\u232\'e8e8e8 di pagina;}
+{\*\cs23\sbasedon15\snext23\cf1\b\kerning1\dbch\af8\langfe1081\loch\f4\fs29 Titolo Carattere;}
+{\*\cs24\snext24 Caratteri nota a pi\u232\'e8e8 di pagina;}
+{\*\cs25\snext25 Richiamo alla nota a pi\u232\'e8e8 di pagina;}
+{\*\cs26\snext26 Carattere nota a pi\u232\'e8e8 di pagina;}
+{\*\cs27\snext27 Carattere nota di chiusura;}
+{\*\cs28\sbasedon15\snext28\cf1\b\kerning1\dbch\af8\langfe1081\loch\f4\fs29 Titolo Carattere1;}
+{\*\cs29\snext29 Carattere della nota;}
+{\*\cs30\snext30 Richiamo di nota di chiusura;}
+{\*\cs31\snext31 Richiamo di nota;}
+{\*\cs32\snext32 Caratteri nota a pi\u232\'e8 di pagina;}
+{\*\cs33\snext33\super Richiamo alla nota a pi\u232\'e8 di pagina;}
+{\*\cs34\snext34 Endnote Characters;}
+{\*\cs35\snext35\super Endnote Anchor;}
+{\*\cs36\snext36\super Footnote Anchor;}
+{\*\cs37\snext37 Footnote Characters;}
+{\s38\sbasedon0\snext39\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af6\langfe1081\dbch\af9\afs28\loch\f2\fs28\lang1040 Heading;}
+{\s39\sbasedon0\snext39\sl288\slmult1\ql\nowidctlpar\hyphpar0\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\loch\f0\fs24\lang1040 Text Body;}
+{\s40\sbasedon39\snext40\sl288\slmult1\ql\nowidctlpar\hyphpar0\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\loch\f0\fs24\lang1040 List;}
+{\s41\sbasedon0\snext41\ql\nowidctlpar\hyphpar0\sb120\sa120\noline\ltrpar\cf1\i\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\ai\loch\f0\fs24\lang1040 Caption;}
+{\s42\sbasedon0\snext42\ql\nowidctlpar\hyphpar0\noline\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\loch\f0\fs24\lang1040 Index;}
+{\s43\snext43\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\b\kerning1\dbch\af7\langfe1040\dbch\af9\afs24\alang1081\loch\f3\fs36\lang1040 Titolo 1;}
+{\s44\snext44\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb200\sa120\keepn\ltrpar\cf1\b\kerning1\dbch\af7\langfe1040\dbch\af9\afs24\alang1081\loch\f3\fs32\lang1040 Titolo 2;}
+{\s45\snext45\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af9\afs24\alang1081\loch\f3\fs28\lang1040 Titolo 3;}
+{\s46\sbasedon0\snext46\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f3\fs28\lang1040 Titolo;}
+{\s47\sbasedon0\snext47\sl288\slmult1\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs24\lang1040 Corpo del testo;}
+{\s48\sbasedon47\snext48\sl288\slmult1\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs24\lang1040 Elenco;}
+{\s49\sbasedon0\snext49\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb120\sa120\ltrpar\cf1\i\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs24\lang1040 Didascalia;}
+{\s50\sbasedon0\snext50\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs24\lang1040 Indice;}
+{\s51\snext51\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040 Predefinito;}
+{\s52\sbasedon51\snext52\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f3\fs28\lang1040 Intestazione;}
+{\s53\sbasedon51\snext53\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb0\sa120\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs24\lang1040 Corpo testo;}
+{\s54\sbasedon52\snext54\qc\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\i\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f3\fs28\lang1040 Sottotitolo;}
+{\s55\sbasedon51\snext55\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb120\sa120\ltrpar\cf1\i\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs24\lang1040 caption;}
+{\s56\snext56\sl276\slmult1\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb0\sa200\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f5\fs22\lang1040 DocumentMap;}
+{\s57\sbasedon51\snext57\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f3\fs28\lang1040 Titolo principale;}
+{\s58\sbasedon51\snext58\ql\nowidctlpar\hyphpar0\faauto\li339\ri0\lin339\rin0\fi-339\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs20\lang1040 Nota di chiusura;}
+{\s59\sbasedon48\snext59\sl288\slmult1\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs24\lang1040 Elenco 1;}
+{\s60\sbasedon48\snext60\sl288\slmult1\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe1040\dbch\af7\afs24\loch\f0\fs24\lang1040 Elenco 2;}
+{\s61\sbasedon0\snext61\ql\nowidctlpar\hyphpar0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\loch\f0\fs24\lang1040 Endnote;}
+}{\*\generator LibreOffice/5.3.3.2$Windows_x86 LibreOffice_project/3d9a8b4b4e538a85e0782bd6c2d430bafe583448}{\info{\author Marco}{\creatim\yr2017\mo5\dy29\hr9\min7}{\revtim\yr2017\mo5\dy31\hr15\min20}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab420\deftab420\deftab420\deftab420\deftab420\deftab420
+\hyphauto0\viewscale100
+{\*\pgdsctbl
+{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Default Style;}
+{\pgdsc1\pgdscuse451\pgndec\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt1 Endnote;}}
+\formshade{\*\pgdscno0}\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+{\*\ftnsep}\pgndec\pard\plain \s43\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\b\kerning1\dbch\af7\langfe1040\dbch\af9\afs24\alang1081\loch\f3\fs36\lang1040\sb240\sa120{{\super ${\*\footnote\ftnalt $\pard\plain \s61\ql\nowidctlpar\hyphpar0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\loch\f0\fs24\lang1040{\cf1\kerning1\dbch\af7\langfe1040\rtlch \ltrch\rtlch \ltrch\loch\fs20\lang1040
+\tab Titolo 1}
+}}
+}{\rtlch \ltrch\loch
+Titolo 1}
+\par \pard\plain \s51\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040{{\*\bkmkstart __DdeLink__0_1325855049}{\*\bkmkend __DdeLink__0_1325855049}\rtlch \ltrch\loch
+standard}
+\par \pard\plain \s51\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040{\rtlch \ltrch\loch
+standard}
+\par \pard\plain \s51\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040{\rtlch \ltrch\loch
+standard}
+\par \pard\plain \s51\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040\li0\ri0\lin0\rin0\fi0\rtlch \ltrch\loch
+
+\par \pard\plain \s44\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb200\sa120\keepn\ltrpar\cf1\b\kerning1\dbch\af7\langfe1040\dbch\af9\afs24\alang1081\loch\f3\fs32\lang1040{{\super ${\*\footnote\ftnalt $\pard\plain \s61\ql\nowidctlpar\hyphpar0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\loch\f0\fs24\lang1040{\cf1\kerning1\dbch\af7\langfe1040\rtlch \ltrch\rtlch \ltrch\loch\fs20\lang1040
+\tab Titolo 2}
+}}
+}{\rtlch \ltrch\loch
+Titolo 2}
+\par \pard\plain \s51\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040{\rtlch \ltrch\loch
+standard}
+\par \pard\plain \s51\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040{\rtlch \ltrch\loch
+standard}
+\par } \ No newline at end of file
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 901b7b5a4f7b..a6b501f3f683 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -55,6 +55,26 @@ DECLARE_RTFEXPORT_TEST(testTdf108949_footnote, "tdf108949_footnote.rtf")
getProperty<sal_Int32>(xFootnote->getAnchor(), "CharColor"));
}
+DECLARE_RTFEXPORT_TEST(testTdf130817, "tdf130817.rtf")
+{
+ uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xEndnotes = xEndnotesSupplier->getEndnotes();
+
+ uno::Reference<text::XFootnote> xEndnote1;
+ xEndnotes->getByIndex(0) >>= xEndnote1;
+ uno::Reference<text::XText> xEndnoteText1;
+ xEndnotes->getByIndex(0) >>= xEndnoteText1;
+ CPPUNIT_ASSERT_EQUAL(OUString("Titolo 1"), xEndnoteText1->getString().trim());
+ CPPUNIT_ASSERT_EQUAL(OUString("$"), xEndnote1->getAnchor()->getString());
+
+ uno::Reference<text::XFootnote> xEndnote2;
+ xEndnotes->getByIndex(1) >>= xEndnote2;
+ uno::Reference<text::XText> xEndnoteText2;
+ xEndnotes->getByIndex(1) >>= xEndnoteText2;
+ CPPUNIT_ASSERT_EQUAL(OUString("Titolo 2"), xEndnoteText2->getString().trim());
+ CPPUNIT_ASSERT_EQUAL(OUString("$"), xEndnote1->getAnchor()->getString());
+}
+
DECLARE_RTFEXPORT_TEST(testTdf116436_tableBackground, "tdf116436_tableBackground.odt")
{
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);