diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-28 16:47:13 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-10-01 07:37:48 +0000 |
commit | dea3d98936aad30a7d6804c76e502c9fc9603985 (patch) | |
tree | f770b97ea1359acf3ce8b97c6dc0cd251afb947a | |
parent | 3ebb09e0e7a0ca78e535d3c6721c2b87da37bd9d (diff) |
Related: fdo#73608 don't crash on missing table styles
(cherry picked from commit 5fd7382651d64f77e8ad1d9a5c053f52f3641f9f)
Conflicts:
writerfilter/source/dmapper/DomainMapperTableHandler.cxx
Change-Id: I340b43b7afc4c5c4d6dc8e4ed182279240306540
Resolves: fdo#73608 bail out on loop in style sheet hierarchy
Change-Id: I03975d1ce8eaceceb4d5c263eb11c1521bcd57eb
(cherry picked from commit be18133e84120625734a09380594ee89b23c4322)
Reviewed-on: https://gerrit.libreoffice.org/11679
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/qa/core/data/ooxml/pass/fdo73608-1.docx | bin | 0 -> 11066 bytes | |||
-rw-r--r-- | sw/qa/core/data/ooxml/pass/fdo73608-2.docx | bin | 0 -> 11064 bytes | |||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 16 |
3 files changed, 15 insertions, 1 deletions
diff --git a/sw/qa/core/data/ooxml/pass/fdo73608-1.docx b/sw/qa/core/data/ooxml/pass/fdo73608-1.docx Binary files differnew file mode 100644 index 000000000000..d3cc84a6edb9 --- /dev/null +++ b/sw/qa/core/data/ooxml/pass/fdo73608-1.docx diff --git a/sw/qa/core/data/ooxml/pass/fdo73608-2.docx b/sw/qa/core/data/ooxml/pass/fdo73608-2.docx Binary files differnew file mode 100644 index 000000000000..f5588782cd22 --- /dev/null +++ b/sw/qa/core/data/ooxml/pass/fdo73608-2.docx diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 33f70cc9cbd0..b8193c733a3a 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -119,9 +119,17 @@ void DomainMapperTableHandler::startTable(unsigned int nRows, PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntryPtr pStyleSheet, StyleSheetTablePtr pStyleSheetTable) { PropertyMapPtr pRet; + + if (!pStyleSheet) + return pRet; + if(!pStyleSheet->sBaseStyleIdentifier.isEmpty()) { const StyleSheetEntryPtr pParentStyleSheet = pStyleSheetTable->FindStyleSheetByISTD( pStyleSheet->sBaseStyleIdentifier ); + //a loop in the style hierarchy, bail out + if (pParentStyleSheet == pStyleSheet) + return pRet; + pRet = lcl_SearchParentStyleSheetAndMergeProperties( pParentStyleSheet, pStyleSheetTable ); } else @@ -129,7 +137,10 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr pRet.reset( new PropertyMap ); } - pRet->InsertProps(pStyleSheet->pProperties); + if (pRet) + { + pRet->InsertProps(pStyleSheet->pProperties); + } return pRet; } @@ -294,6 +305,9 @@ namespace bool lcl_extractTableBorderProperty(PropertyMapPtr pTableProperties, const PropertyIds nId, TableInfo& rInfo, table::BorderLine2& rLine) { + if (!pTableProperties) + return false; + PropertyMap::iterator aTblBorderIter = pTableProperties->find(nId); if( aTblBorderIter != pTableProperties->end() ) { |