diff options
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 8 | ||||
-rw-r--r-- | svtools/source/svrtf/parrtf.cxx | 21 | ||||
-rw-r--r-- | xmloff/source/style/styleexp.cxx | 4 |
3 files changed, 30 insertions, 3 deletions
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 56ef7368e8fc..ec633c8c3fa3 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -300,6 +300,7 @@ void SvxRTFParser::ReadStyleTable() { int nToken, bSaveChkStyleAttr = bChkStyleAttr ? 1 : 0; sal_uInt16 nStyleNo = 0; + bool bHasStyleNo = false; int _nOpenBrakets = 1; // the first was already detected earlier!! SvxRTFStyleType* pStyle = new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] ); pStyle->aAttrSet.Put( GetRTFDefaults() ); @@ -340,12 +341,16 @@ void SvxRTFParser::ReadStyleTable() case RTF_SNEXT: pStyle->nNext = sal_uInt16(nTokenValue); break; case RTF_OUTLINELEVEL: case RTF_SOUTLVL: pStyle->nOutlineNo = sal_uInt8(nTokenValue); break; - case RTF_S: nStyleNo = (short)nTokenValue; break; + case RTF_S: nStyleNo = (short)nTokenValue; + bHasStyleNo = true; + break; case RTF_CS: nStyleNo = (short)nTokenValue; + bHasStyleNo = true; pStyle->bIsCharFmt = true; break; case RTF_TEXTTOKEN: + if (bHasStyleNo) { pStyle->sName = DelCharAtEnd( aToken, ';' ); @@ -358,6 +363,7 @@ void SvxRTFParser::ReadStyleTable() pStyle = new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] ); pStyle->aAttrSet.Put( GetRTFDefaults() ); nStyleNo = 0; + bHasStyleNo = false; } break; default: diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index fc98b8781e60..e7be520573c0 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -431,6 +431,24 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) aToken = sSave; bRTF_InTextRead = false; } + else if ( 'c' == nNextCh ) + { + // Prevent text breaking into multiple tokens. + rInput.SeekRel( 2 ); + nNextCh = GetNextChar(); + if (RTF_ISDIGIT( nNextCh )) + { + sal_uInt8 nNewOverread = 0 ; + do { + nNewOverread *= 10; + nNewOverread += nNextCh - '0'; + nNextCh = GetNextChar(); + } while ( RTF_ISDIGIT( nNextCh ) ); + nUCharOverread = nNewOverread; + aParserStates.top().nUCharOverread = nNewOverread; + } + bNextCh = 0x20 == nNextCh; + } else { nNextCh = '\\'; @@ -448,8 +466,7 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) } break; - case sal_Unicode(EOF): - eState = SVPAR_ERROR; + case sal_Unicode(EOF): eState = SVPAR_ERROR; // continue case '{': case '}': diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index 0ab12cce8c5e..8ca89b6f6507 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -419,6 +419,10 @@ void XMLStyleExport::exportStyleFamily( // not export them here and remain silent. continue; } + catch(css::container::NoSuchElementException&) + { + continue; + } assert(xStyle.is()); if (!bUsed || xStyle->isInUse()) |