ofz: fix Indirect leaks

Change-Id: Ib851012a0e3ad520a09c1e43e3f77417ab05f9c4
Reviewed-on: https://gerrit.libreoffice.org/42435
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2017-09-18 20:38:38 +01:00
parent dca94d10c8
commit 505a062b47

View File

@ -1592,11 +1592,15 @@ XMLEventImportHelper& SvXMLImport::GetEventImport()
void SvXMLImport::SetFontDecls( XMLFontStylesContext *pFontDecls )
{
if (mxFontDecls.is())
static_cast<SvXMLStylesContext*>(mxFontDecls.get())->Clear();
mxFontDecls = pFontDecls;
}
void SvXMLImport::SetStyles( SvXMLStylesContext *pStyles )
{
if (mxStyles.is())
static_cast<SvXMLStylesContext*>(mxStyles.get())->Clear();
mxStyles = pStyles;
}
@ -1628,6 +1632,8 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles )
}
}
}
if (mxAutoStyles.is())
static_cast<SvXMLStylesContext*>(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<SvXMLStylesContext*>(mxMasterStyles.get())->Clear();
mxMasterStyles = pMasterStyles;
}