sw/qa/core/data/ooxml/pass/fdo73608-1.docx |binary sw/qa/core/data/ooxml/pass/fdo73608-2.docx |binary writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 16 ++++++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-)
New commits: commit be18133e84120625734a09380594ee89b23c4322 Author: Caolán McNamara <caol...@redhat.com> Date: Sun Sep 28 17:00:50 2014 +0100 Resolves: fdo#73608 bail out on loop in style sheet hierarchy Change-Id: I03975d1ce8eaceceb4d5c263eb11c1521bcd57eb diff --git a/sw/qa/core/data/ooxml/pass/fdo73608-2.docx b/sw/qa/core/data/ooxml/pass/fdo73608-2.docx new file mode 100644 index 0000000..f558878 Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo73608-2.docx differ diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 91e3860..0287adf 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -90,6 +90,10 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr 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 commit 5fd7382651d64f77e8ad1d9a5c053f52f3641f9f Author: Caolán McNamara <caol...@redhat.com> Date: Sun Sep 28 16:47:13 2014 +0100 Related: fdo#73608 don't crash on missing table styles Change-Id: I340b43b7afc4c5c4d6dc8e4ed182279240306540 diff --git a/sw/qa/core/data/ooxml/pass/fdo73608-1.docx b/sw/qa/core/data/ooxml/pass/fdo73608-1.docx new file mode 100644 index 0000000..d3cc84a Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo73608-1.docx differ diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 7d2e4f3..91e3860 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 ) {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits