Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3199
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/99/3199/1
fdo#51916 don't try to support nested tables having table styles for now
Also fix an out of bounds substring access, triggered by the same bugdoc.
(cherry picked from commits 7a7d77f97b61ae7f602ed403ecfbbcdb03a06c00,
7006ef460bb68d27a74381fab7b8826b786b31c6 and
008275d56f9ac5248f0e94f606671b4c1993ca20)
Change-Id: I7db46ef17b8aed443faa7eb0c13b6ba109242cc1
---
A sw/qa/extras/rtfimport/data/fdo51916.rtf
M sw/qa/extras/rtfimport/rtfimport.cxx
M writerfilter/source/rtftok/rtfdocumentimpl.cxx
M writerfilter/source/rtftok/rtfdocumentimpl.hxx
4 files changed, 345 insertions(+), 5 deletions(-)
diff --git a/sw/qa/extras/rtfimport/data/fdo51916.rtf b/sw/qa/extras/rtfimport/data/fdo51916.rtf
new file mode 100644
index 0000000..b2359c3
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo51916.rtf
@@ -0,0 +1,319 @@
+{\rtf1
+{\fonttbl
+{\f0\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\f34\fbidi \froman\fcharset238\fprq2
+{\*\panose 02040503050406030204}
+Cambria Math;}
+{\f37\fbidi \fswiss\fcharset238\fprq2
+{\*\panose 020f0502020204030204}
+Calibri
+{\*\falt Century Gothic}
+;}
+{\f38\fbidi \fswiss\fcharset238\fprq2
+{\*\panose 020b0604030504040204}
+Tahoma;}
+{\flomajor\f31500\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\fdbmajor\f31501\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\fhimajor\f31502\fbidi \froman\fcharset238\fprq2
+{\*\panose 02040503050406030204}
+Cambria;}
+{\fbimajor\f31503\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\flominor\f31504\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\fdbminor\f31505\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\fhiminor\f31506\fbidi \fswiss\fcharset238\fprq2
+{\*\panose 020f0502020204030204}
+Calibri
+{\*\falt Century Gothic}
+;}
+{\fbiminor\f31507\fbidi \froman\fcharset238\fprq2
+{\*\panose 02020603050405020304}
+Times New Roman;}
+{\f297\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\f296\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\f298\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\f299\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\f300\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\f301\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\f302\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\f303\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\f637\fbidi \froman\fcharset0\fprq2 Cambria Math;}
+{\f636\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}
+{\f638\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}
+{\f639\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
+{\f642\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
+{\f643\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}
+{\f667\fbidi \fswiss\fcharset0\fprq2 Calibri
+{\*\falt Century Gothic}
+;}
+{\f666\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr
+{\*\falt Century Gothic}
+;}
+{\f668\fbidi \fswiss\fcharset161\fprq2 Calibri Greek
+{\*\falt Century Gothic}
+;}
+{\f669\fbidi \fswiss\fcharset162\fprq2 Calibri Tur
+{\*\falt Century Gothic}
+;}
+{\f672\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic
+{\*\falt Century Gothic}
+;}
+{\f673\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese)
+{\*\falt Century Gothic}
+;}
+{\f677\fbidi \fswiss\fcharset0\fprq2 Tahoma;}
+{\f676\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}
+{\f679\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
+{\flomajor\f31510\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\fdbmajor\f31520\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\fhimajor\f31530\fbidi \froman\fcharset0\fprq2 Cambria;}
+{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}
+{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}
+{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
+{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}
+{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}
+{\fbimajor\f31540\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\flominor\f31550\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\fdbminor\f31560\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\fhiminor\f31570\fbidi \fswiss\fcharset0\fprq2 Calibri
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic
+{\*\falt Century Gothic}
+;}
+{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese)
+{\*\falt Century Gothic}
+;}
+{\fbiminor\f31580\fbidi \froman\fcharset0\fprq2 Times New Roman;}
+{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
+{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
+{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
+{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
+{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
+{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
+{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+}
+{\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;\red255\green255\blue255;}
+{\upr
+{\stylesheet
+{\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\rtlch\fcs1 \af37\afs22\alang1025
+\ltrch\fcs0 \f37\fs22\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \snext0 \sqformat
\spriority0 Normal;}
+{\*\cs10 \additive \ssemihidden Default Paragraph Font;}
+{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
\ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
\af0\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}
+{
+\s15\ql
\li0\ri0\sa160\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\rtlch\fcs1 \af37\afs28\alang1025 \ltrch\fcs0
\f37\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+\sbasedon0 \snext15 \sautoupd \styrsid4140469 ????;}
+{\s16\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
\f38\fs16\lang1049\langfe1049\cgrid\langnp1049\langfenp1049
+\sbasedon0 \snext16 \slink18 \ssemihidden \styrsid4282853 Balloon Text;}
+{\*\cs17 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 \sbasedon10 \styrsid11798718 Hyperlink;}
+{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
+\sbasedon10 \slink16 \slocked \ssemihidden \styrsid4282853 Balloon Text Char;}
+{\*\cs19 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \styrsid11798718 search_color;}
+{
+\s20\ql
\li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\rtlch\fcs1 \af37\afs24\alang1025 \ltrch\fcs0
\f37\fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049
+\sbasedon0 \snext20 \styrsid11798718 Normal (Web);}
+}
+{\*\ud\uc0
+{\stylesheet
+{\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0
+\f37\fs22\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \snext0 \sqformat \spriority0 Normal;}
+{\*\cs10 \additive \ssemihidden Default Paragraph Font;}
+{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
\ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
\af0\afs22\alang1025 \ltrch\fcs0 \f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}
+{
+\s15\ql
\li0\ri0\sa160\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\rtlch\fcs1 \af37\afs28\alang1025 \ltrch\fcs0
\f37\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+\sbasedon0 \snext15 \sautoupd \styrsid4140469
+{\uc1\u1047 ?\u1085 ?\u1072 ?\u1082 ?}
+;}
+{\s16\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
+\f38\fs16\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \sbasedon0 \snext16 \slink18
\ssemihidden \styrsid4282853 Balloon Text;}
+{\*\cs17 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 \sbasedon10 \styrsid11798718 Hyperlink;}
+{\*\cs18 \additive
+\rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink16 \slocked \ssemihidden
\styrsid4282853 Balloon Text Char;}
+{\*\cs19 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \styrsid11798718 search_color;}
+{
+\s20\ql
\li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\rtlch\fcs1 \af37\afs24\alang1025 \ltrch\fcs0
\f37\fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049
+\sbasedon0 \snext20 \styrsid11798718 Normal (Web);}
+}
+}
+}
+\ltrrow\trowd
\irow0\irowband0\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
+\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone
\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
+\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\pard\plain \ltrpar\ql
\li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 \rtlch\fcs1 \af37\afs22\alang1025
\ltrch\fcs0 \f37\fs22\lang1049\langfe1049\cgrid\langnp1049\langfenp1049
+{\rtlch\fcs1
+\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sb240\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17
+{\rtlch\fcs1 \ab\af296\afs20 \ltrch\fcs0 \b\f296\fs20\ul\insrsid14318737\charrsid14318737 K}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \trowd
\irow10\irowband10\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone
+\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sb240\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17
+{\rtlch\fcs1 \ab\ai\af296\afs20 \ltrch\fcs0 \b\i\f296\fs20\insrsid14318737\charrsid14318737 L}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar
+\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \trowd
\irow11\irowband11\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone
+\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar\qc \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sb14\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17
+{\rtlch\fcs1 \ai\af296\afs20
+\ltrch\fcs0 \i\f296\fs20\insrsid14318737\charrsid14318737 M}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737
+\trowd
\irow12\irowband12\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142
+\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0
+{\rtlch\fcs1 \af0\afs20
+\ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql
\li17\ri0\sb240\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\itap2\pararsid8008194
+{\rtlch\fcs1 \ab\ai\af296\afs20 \ltrch\fcs0
+\b\i\f296\fs20\insrsid4282853\charrsid4282853 N}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid4282853\charrsid4282853
+\nestcell
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap2
+{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid4282853
+{\*\nesttableprops\trowd \irow0\irowband0\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl
\cltxlrtb\clftsWidth3\clwWidth9662\clshdrawnil \cellx9662\nestrow}
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql \li17\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\itap2\pararsid1914047
+{\rtlch\fcs1 \af296\afs20 \ltrch\fcs0 \f296\fs20\insrsid4282853\charrsid4282853 O}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1914047
+\par }
+\pard \ltrpar\qj
\li0\ri0\sl129\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap2\pararsid8077423
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1914047\charrsid4282853 \nestcell
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap2
+{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid4282853
+{\*\nesttableprops\trowd \irow1\irowband1\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl
\cltxlrtb\clftsWidth3\clwWidth9662\clshdrawnil \cellx9662\nestrow}
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql
\li17\ri0\sb14\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\itap2\pararsid8008194
+{\rtlch\fcs1 \ai\af296\afs20 \ltrch\fcs0 \i\f296\fs20\insrsid4282853\charrsid4282853 P}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid4282853\charrsid4282853 \nestcell
+{\nonesttables
+\par }
+}
+\pard \ltrpar\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap2
+{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid4282853
+{\*\nesttableprops\trowd \irow2\irowband2\lastrow \ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl
\cltxlrtb\clftsWidth3\clwWidth9662\clshdrawnil \cellx9662\nestrow}
+{\nonesttables
+\par }
+\ltrrow}
+\trowd
\irow13\irowband13\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil
+\cellx142\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\pard \ltrpar\ql
\li17\ri0\sb240\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17
+{\rtlch\fcs1
+\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid4282853\charrsid14318737 \cell }
+\pard \ltrpar\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \trowd
\irow13\irowband13\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
+\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone
\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar
+\qc \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0\pararsid1914047
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar
+\ql \li17\ri0\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\pararsid1914047
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737 \trowd
\irow14\irowband14\ltrrow
+\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil \cellx142\clvertalt\clbrdrt\brdrnone
+\clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row \ltrrow}
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0\pararsid1914047
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql \li17\ri0\sa120\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin17\pararsid1914047
+{\rtlch\fcs1 \ab\ai\af296\afs20 \ltrch\fcs0 \b\i\f296\fs20\insrsid14318737\charrsid14318737 Q}
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
+\f0\fs20\insrsid14318737\charrsid14318737 \cell }
+\pard \ltrpar\ql
\li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0
+{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid14318737\charrsid14318737
+\trowd \irow15\irowband15\lastrow
\ltrrow\ts11\trleft0\trftsWidth3\trwWidth9662\trftsWidthB3\trftsWidthA3\tblind0\tblindtype3
\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth142\clshdrawnil
+\cellx142\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone
\cltxlrtb\clftsWidth3\clwWidth9520\clshdrawnil \cellx9662\row }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
+\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+{\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid14318737\charrsid14318737
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index ae13ca1..6a70ad7 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -144,6 +144,7 @@
void testFdo61909();
void testFdo62288();
void testFdo37716();
+ void testFdo51916();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -238,6 +239,7 @@
{"fdo61909.rtf", &Test::testFdo61909},
{"fdo62288.rtf", &Test::testFdo62288},
{"fdo37716.rtf", &Test::testFdo37716},
+ {"fdo51916.rtf", &Test::testFdo51916},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -1167,6 +1169,11 @@
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_NONE,
getProperty<text::WrapTextMode>(xFrames->getByIndex(0), "Surround"));
}
+void Test::testFdo51916()
+{
+ // Complex nested table caused a crash.
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 7969b98..954c08f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1294,7 +1294,11 @@
m_aStates.top().nDestinationState = DESTINATION_SKIP;
break;
case RTF_NESTTABLEPROPS:
- m_aStates.top().nDestinationState = DESTINATION_NESTEDTABLEPROPERTIES;
+ // Don't try to support nested tables having table styles for now.
+ if (!m_aStates.top().bHasTableStyle)
+ m_aStates.top().nDestinationState = DESTINATION_NESTEDTABLEPROPERTIES;
+ else
+ m_aStates.top().nDestinationState = DESTINATION_SKIP;
break;
case RTF_HEADER:
case RTF_FOOTER:
@@ -3444,6 +3448,9 @@
m_aStates.top().aCharacterAttributes.set(NS_rtf::LN_WR, RTFValue::Pointer_t(new
RTFValue(3)));
}
break;
+ case RTF_TS:
+ m_aStates.top().bHasTableStyle = true;
+ break;
default:
SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle value '" <<
lcl_RtfToString(nKeyword) << "'");
aSkip.setParsed(false);
@@ -3813,11 +3820,14 @@
// extract default text
nLength = aStr.toChar();
aStr = aStr.copy(1);
- OString aDefaultText = aStr.copy(0, nLength);
RTFValue::Pointer_t pNValue(new RTFValue(OStringToOUString(aName,
m_aStates.top().nCurrentEncoding)));
m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFData_name, pNValue);
- RTFValue::Pointer_t pDValue(new RTFValue(OStringToOUString(aDefaultText,
m_aStates.top().nCurrentEncoding)));
- m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFTextInput_default, pDValue);
+ if (nLength > 0)
+ {
+ OString aDefaultText = aStr.copy(0, nLength);
+ RTFValue::Pointer_t pDValue(new RTFValue(OStringToOUString(aDefaultText,
m_aStates.top().nCurrentEncoding)));
+ m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFTextInput_default, pDValue);
+ }
m_bFormField = false;
}
@@ -4407,7 +4417,8 @@
nHour(0),
nMinute(0),
nCurrentStyleIndex(-1),
- pCurrentBuffer(0)
+ pCurrentBuffer(0),
+ bHasTableStyle(false)
{
}
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index e3b8402..0e0c467 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -411,6 +411,9 @@
/// Points to the active buffer, if there is one.
RTFBuffer_t* pCurrentBuffer;
+
+ /// If a table style was requested to be used.
+ bool bHasTableStyle;
};
class RTFTokenizer;
--
To view, visit https://gerrit.libreoffice.org/3199
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7db46ef17b8aed443faa7eb0c13b6ba109242cc1
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Miklos Vajna <vmiklos@suse.cz>
Context
- [PATCH libreoffice-4-0] fdo#51916 don't try to support nested tables having table st... · Miklos Vajna (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.