From 2660d24a07866e083c5135ea263030f3e3a2e729 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 13 Jul 2015 16:17:00 +0200 Subject: new loplugin: refcounting This was a feature requested by mmeeks, as a result of tdf#92611. It validates that things that extend XInterface are not directly heap/stack-allocated, but have their lifecycle managed via css::uno::Reference or rtl::Reference. Change-Id: I28e3b8b236f6a4a56d0a6d6f26ad54e44b36e692 Reviewed-on: https://gerrit.libreoffice.org/16924 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- sw/source/core/swg/SwXMLTextBlocks1.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sw/source/core/swg') diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx index cd52f44b1707..f6fc59973d26 100644 --- a/sw/source/core/swg/SwXMLTextBlocks1.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx @@ -376,9 +376,9 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const OUString& rShort, const OUString& uno::Reference xHandler(xWriter, uno::UNO_QUERY); - SwXMLTextBlockExport aExp( xContext, *this, GetXMLToken ( XML_UNFORMATTED_TEXT ), xHandler); + uno::Reference xExp( new SwXMLTextBlockExport( xContext, *this, GetXMLToken ( XML_UNFORMATTED_TEXT ), xHandler) ); - aExp.exportDoc( rText ); + xExp->exportDoc( rText ); uno::Reference < embed::XTransactedObject > xTrans( xRoot, uno::UNO_QUERY ); if ( xTrans.is() ) @@ -497,9 +497,9 @@ void SwXMLTextBlocks::WriteInfo() uno::Reference xHandler(xWriter, uno::UNO_QUERY); - SwXMLBlockListExport aExp( xContext, *this, OUString(XMLN_BLOCKLIST), xHandler); + uno::Reference xExp(new SwXMLBlockListExport( xContext, *this, OUString(XMLN_BLOCKLIST), xHandler) ); - aExp.exportDoc( XML_BLOCK_LIST ); + xExp->exportDoc( XML_BLOCK_LIST ); uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY ); if ( xTrans.is() ) -- cgit v1.2.3