sw/qa/extras/rtfimport/data/fdo51916.rtf | 319 +++++++++++++++++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 7 writerfilter/source/rtftok/rtfdocumentimpl.cxx | 21 + writerfilter/source/rtftok/rtfdocumentimpl.hxx | 3 4 files changed, 345 insertions(+), 5 deletions(-)
New commits: commit 008275d56f9ac5248f0e94f606671b4c1993ca20 Author: Miklos Vajna <vmik...@suse.cz> Date: Wed Apr 3 17:36:26 2013 +0200 fdo#51916 out of bounds substring access Change-Id: I7db46ef17b8aed443faa7eb0c13b6ba109242cc1 diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 0714b15..d10a5a0 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3940,11 +3940,14 @@ int RTFDocumentImpl::popState() // extract default text nLength = aStr.toChar(); aStr = aStr.copy(1); - OString aDefaultText = aStr.copy(0, nLength); RTFValue::Pointer_t pNValue(new RTFValue(OStringToOUString(aName, aState.nCurrentEncoding))); m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFData_name, pNValue); - RTFValue::Pointer_t pDValue(new RTFValue(OStringToOUString(aDefaultText, aState.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, aState.nCurrentEncoding))); + m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFTextInput_default, pDValue); + } m_bFormField = false; } commit 7006ef460bb68d27a74381fab7b8826b786b31c6 Author: Miklos Vajna <vmik...@suse.cz> Date: Wed Apr 3 17:28:42 2013 +0200 fdo#51916 testcase Change-Id: I27ffbab64cfb6763235d4dfd7fb47aa98235274d 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 b19bd4d..15c0e0e 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -148,6 +148,7 @@ public: void testFdo61909(); void testFdo62288(); void testFdo37716(); + void testFdo51916(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -269,6 +270,7 @@ void Test::run() {"fdo61909.rtf", &Test::testFdo61909}, {"fdo62288.rtf", &Test::testFdo62288}, {"fdo37716.rtf", &Test::testFdo37716}, + {"fdo51916.rtf", &Test::testFdo51916}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1208,6 +1210,11 @@ void Test::testFdo37716() 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(); commit 7a7d77f97b61ae7f602ed403ecfbbcdb03a06c00 Author: Miklos Vajna <vmik...@suse.cz> Date: Wed Apr 3 17:04:32 2013 +0200 fdo#51916 don't try to support nested tables having table styles for now Change-Id: I4350ce0b791b42ce3c21a61e37d61e3b2063cb6a diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 0afe427..0714b15 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1316,7 +1316,11 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) 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: @@ -3558,6 +3562,9 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) 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", "TODO handle value '" << lcl_RtfToString(nKeyword) << "'"); @@ -4686,7 +4693,8 @@ RTFParserState::RTFParserState(RTFDocumentImpl *pDocumentImpl) 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 b7f367b..f8e016e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -411,6 +411,9 @@ namespace writerfilter { /// 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits