diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-14 12:45:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-04-14 12:47:23 +0100 |
commit | 234f150f30d881b2691288c5f5581306bd4d3d18 (patch) | |
tree | d4e64acf3ed2df17ae0674903ea6aabae7ccf2e1 /writerfilter | |
parent | optimize: traverse children with WINDOW_FIRSTCHILD/WINDOW_NEXT (diff) | |
download | core-234f150f30d881b2691288c5f5581306bd4d3d18.tar.gz core-234f150f30d881b2691288c5f5581306bd4d3d18.zip |
Resolves: fdo#48640 handle various busted rtf docs without hanging
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtftokenizer.cxx | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 17b48da7cf1e..89a71f1d2ede 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -442,7 +442,7 @@ void DomainMapperTableManager::endOfRowAction() double nFullWidth = m_nTableWidth; //the positions have to be distibuted in a range of 10000 const double nFullWidthRelative = 10000.; - if( pTableGrid->size() == nGrids ) + if( pTableGrid->size() == nGrids && m_nCell > 0 ) { uno::Sequence< text::TableColumnSeparator > aSeparators( m_nCell - 1 ); text::TableColumnSeparator* pSeparators = aSeparators.getArray(); diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx index d6dc3ca1027d..125319e6deeb 100644 --- a/writerfilter/source/rtftok/rtftokenizer.cxx +++ b/writerfilter/source/rtftok/rtftokenizer.cxx @@ -213,6 +213,11 @@ int RTFTokenizer::resolveKeyword() { aBuf.append(ch); Strm() >> ch; + if (Strm().IsEof()) + { + ch = ' '; + break; + } } if (aBuf.getLength() > 32) // See RTF spec v1.9.1, page 7 @@ -237,6 +242,11 @@ int RTFTokenizer::resolveKeyword() { aParameter.append(ch); Strm() >> ch; + if (Strm().IsEof()) + { + ch = ' '; + break; + } } nParam = aParameter.makeStringAndClear().toInt32(); if (bNeg) |