diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-09 12:57:01 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 16:16:45 +0200 |
commit | bbb017f95ec70c8d10dc6e1473f14eeda9ff6144 (patch) | |
tree | 00ff0ed59371610ff8d539e7a4ed86b0e7e8cde5 /xmloff/source/text/XMLTextFrameContext.cxx | |
parent | 66e6278e9ad0537843cfecbfee9bcf808702a141 (diff) |
use std::unique_ptr
Change-Id: I52713ea0015a5f0118c337279f37bc38b1121f1e
Diffstat (limited to 'xmloff/source/text/XMLTextFrameContext.cxx')
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index bb6ae183b45e..d49df3c237a9 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <o3tl/make_unique.hxx> #include <tools/debug.hxx> #include <osl/diagnose.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -1341,7 +1342,6 @@ XMLTextFrameContext::XMLTextFrameContext( : SvXMLImportContext( rImport, nPrfx, rLName ) , MultiImageImportHelper() , m_xAttrList( new SvXMLAttributeList( xAttrList ) ) -, m_pHyperlink( nullptr ) // Implement Title/Description Elements UI (#i73249#) , m_sTitle() , m_sDesc() @@ -1391,11 +1391,6 @@ XMLTextFrameContext::XMLTextFrameContext( } } -XMLTextFrameContext::~XMLTextFrameContext() -{ - delete m_pHyperlink; -} - void XMLTextFrameContext::EndElement() { /// solve if multiple image child contexts were imported @@ -1429,8 +1424,7 @@ void XMLTextFrameContext::EndElement() { pImpl->SetHyperlink( m_pHyperlink->GetHRef(), m_pHyperlink->GetName(), m_pHyperlink->GetTargetFrameName(), m_pHyperlink->GetMap() ); - delete m_pHyperlink; - m_pHyperlink = nullptr; + m_pHyperlink.reset(); } } @@ -1651,8 +1645,7 @@ void XMLTextFrameContext::SetHyperlink( const OUString& rHRef, bool bMap ) { OSL_ENSURE( !m_pHyperlink, "recursive SetHyperlink call" ); - delete m_pHyperlink; - m_pHyperlink = new XMLTextFrameContextHyperlink_Impl( + m_pHyperlink = o3tl::make_unique<XMLTextFrameContextHyperlink_Impl>( rHRef, rName, rTargetFrameName, bMap ); } |