From 505a062b47f01f7bc68d8450397f7cc6d818c80c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 18 Sep 2017 20:38:38 +0100 Subject: ofz: fix Indirect leaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib851012a0e3ad520a09c1e43e3f77417ab05f9c4 Reviewed-on: https://gerrit.libreoffice.org/42435 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- xmloff/source/core/xmlimp.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 1da5e8212615..724dd5c88e80 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1592,11 +1592,15 @@ XMLEventImportHelper& SvXMLImport::GetEventImport() void SvXMLImport::SetFontDecls( XMLFontStylesContext *pFontDecls ) { + if (mxFontDecls.is()) + static_cast(mxFontDecls.get())->Clear(); mxFontDecls = pFontDecls; } void SvXMLImport::SetStyles( SvXMLStylesContext *pStyles ) { + if (mxStyles.is()) + static_cast(mxStyles.get())->Clear(); mxStyles = pStyles; } @@ -1628,6 +1632,8 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) } } } + if (mxAutoStyles.is()) + static_cast(mxAutoStyles.get())->Clear(); mxAutoStyles = pAutoStyles; GetTextImport()->SetAutoStyles( pAutoStyles ); GetShapeImport()->SetAutoStylesContext( pAutoStyles ); @@ -1637,6 +1643,8 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) void SvXMLImport::SetMasterStyles( SvXMLStylesContext *pMasterStyles ) { + if (mxMasterStyles.is()) + static_cast(mxMasterStyles.get())->Clear(); mxMasterStyles = pMasterStyles; } -- cgit