diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-28 16:47:13 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-28 18:34:56 +0100 |
commit | 5fd7382651d64f77e8ad1d9a5c053f52f3641f9f (patch) | |
tree | 2356aaaadc1e3bdb634c6df2964721e1e06f8940 | |
parent | cadc2cbed1404b47fd2f73a7e0b6c2a3ee663e27 (diff) |
Related: fdo#73608 don't crash on missing table styles
Change-Id: I340b43b7afc4c5c4d6dc8e4ed182279240306540
-rw-r--r-- | sw/qa/core/data/ooxml/pass/fdo73608-1.docx | bin | 0 -> 11066 bytes | |||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 12 |
2 files changed, 11 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/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 7d2e4f3920ea..91e38609eb78 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -83,6 +83,10 @@ 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 ); @@ -93,7 +97,10 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr pRet.reset( new PropertyMap ); } - pRet->InsertProps(pStyleSheet->pProperties); + if (pRet) + { + pRet->InsertProps(pStyleSheet->pProperties); + } return pRet; } @@ -254,6 +261,9 @@ namespace bool lcl_extractTableBorderProperty(PropertyMapPtr pTableProperties, const PropertyIds nId, TableInfo& rInfo, table::BorderLine2& rLine) { + if (!pTableProperties) + return false; + const boost::optional<PropertyMap::Property> aTblBorder = pTableProperties->getProperty(nId); if( aTblBorder ) { |