diff options
-rw-r--r-- | jvmfwk/source/elements.cxx | 1 | ||||
-rw-r--r-- | l10ntools/inc/export.hxx | 4 | ||||
-rw-r--r-- | l10ntools/inc/po.hxx | 2 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 1 | ||||
-rw-r--r-- | l10ntools/source/po.cxx | 1 | ||||
-rw-r--r-- | linguistic/source/misc.cxx | 7 | ||||
-rw-r--r-- | oox/inc/drawingml/chart/datasourcecontext.hxx | 5 | ||||
-rw-r--r-- | oox/source/drawingml/chart/datasourcecontext.cxx | 7 | ||||
-rw-r--r-- | reportdesign/source/core/sdr/ModuleHelper.cxx | 7 | ||||
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 16 | ||||
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 11 |
11 files changed, 22 insertions, 40 deletions
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index 452ae3130c13..b5846f134cb4 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -174,7 +174,6 @@ VersionInfo::VersionInfo(): arVersions(nullptr) VersionInfo::~VersionInfo() { - delete [] arVersions; } void VersionInfo::addExcludeVersion(const OUString& sVersion) diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index 220259c02528..d04d85cf5a98 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -282,13 +282,13 @@ class MergeData public: OString sGID; OString sLID; - MergeEntrys* pMergeEntrys; + std::unique_ptr<MergeEntrys> pMergeEntrys; private: MergeDataHashMap::iterator m_aNextData; public: MergeData( const OString &rGID, const OString &rLID ); ~MergeData(); - MergeEntrys* GetMergeEntries() { return pMergeEntrys;} + MergeEntrys* GetMergeEntries() { return pMergeEntrys.get();} }; diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx index ce1443d26d14..52c644f176cb 100644 --- a/l10ntools/inc/po.hxx +++ b/l10ntools/inc/po.hxx @@ -78,7 +78,7 @@ class PoHeader { private: - GenPoEntry* m_pGenPo; + std::unique_ptr<GenPoEntry> m_pGenPo; bool m_bIsInitialized; public: diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 9d04e16f40e3..955fca630d2e 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -207,7 +207,6 @@ MergeData::MergeData(const OString &rGID, MergeData::~MergeData() { - delete pMergeEntrys; } diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 81ecdcd553d7..87b78dd72467 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -419,7 +419,6 @@ PoHeader::PoHeader( const OString& rExtSrc ) PoHeader::~PoHeader() { - delete m_pGenPo; } PoOfstream::PoOfstream() diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 6fe170c2800c..4ceb55b16bcb 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -124,8 +124,8 @@ static inline sal_Int32 Minimum( sal_Int32 n1, sal_Int32 n2, sal_Int32 n3 ) class IntArray2D { private: - sal_Int32 *pData; - int n1, n2; + std::unique_ptr<sal_Int32[]> pData; + int n1, n2; public: IntArray2D( int nDim1, int nDim2 ); @@ -138,12 +138,11 @@ IntArray2D::IntArray2D( int nDim1, int nDim2 ) { n1 = nDim1; n2 = nDim2; - pData = new sal_Int32[n1 * n2]; + pData.reset( new sal_Int32[n1 * n2] ); } IntArray2D::~IntArray2D() { - delete[] pData; } sal_Int32 & IntArray2D::Value( int i, int k ) diff --git a/oox/inc/drawingml/chart/datasourcecontext.hxx b/oox/inc/drawingml/chart/datasourcecontext.hxx index 5f4b7f7d6877..2704ccf33012 100644 --- a/oox/inc/drawingml/chart/datasourcecontext.hxx +++ b/oox/inc/drawingml/chart/datasourcecontext.hxx @@ -45,11 +45,12 @@ public: virtual void onCharacters( const OUString& rChars ) override; private: - SvNumberFormatter* getNumberFormatter(); + SvNumberFormatter* getNumberFormatter(); private: sal_Int32 mnPtIndex; /// Current data point index. - SvNumberFormatter* mpNumberFormatter; + std::unique_ptr<SvNumberFormatter> + mpNumberFormatter; }; diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx index f5854df6a86e..f54ba842eaa1 100644 --- a/oox/source/drawingml/chart/datasourcecontext.cxx +++ b/oox/source/drawingml/chart/datasourcecontext.cxx @@ -47,7 +47,6 @@ DoubleSequenceContext::DoubleSequenceContext( ContextHandler2Helper& rParent, Da DoubleSequenceContext::~DoubleSequenceContext() { - delete mpNumberFormatter; } ContextHandlerRef DoubleSequenceContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) @@ -157,10 +156,10 @@ SvNumberFormatter* DoubleSequenceContext::getNumberFormatter() { uno::Reference<uno::XComponentContext> rContext = this->getFilter().getComponentContext(); - mpNumberFormatter = - new SvNumberFormatter(rContext, LANGUAGE_DONTKNOW); + mpNumberFormatter.reset( + new SvNumberFormatter(rContext, LANGUAGE_DONTKNOW) ); } - return mpNumberFormatter; + return mpNumberFormatter.get(); } diff --git a/reportdesign/source/core/sdr/ModuleHelper.cxx b/reportdesign/source/core/sdr/ModuleHelper.cxx index d17998f5bb09..ca6d5a0c7e74 100644 --- a/reportdesign/source/core/sdr/ModuleHelper.cxx +++ b/reportdesign/source/core/sdr/ModuleHelper.cxx @@ -43,7 +43,7 @@ namespace rptui */ class OModuleImpl { - ResMgr* m_pResources; + std::unique_ptr<ResMgr> m_pResources; public: /// ctor @@ -63,7 +63,6 @@ OModuleImpl::OModuleImpl() OModuleImpl::~OModuleImpl() { - delete m_pResources; } @@ -74,9 +73,9 @@ ResMgr* OModuleImpl::getResManager() if (!m_pResources) { // create a manager with a fixed prefix - m_pResources = ResMgr::CreateResMgr("rptui"); + m_pResources.reset( ResMgr::CreateResMgr("rptui") ); } - return m_pResources; + return m_pResources.get(); } diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index ba87c6f9e146..9330749185f4 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -105,7 +105,6 @@ class SaxExpatParser public: SaxExpatParser(); - virtual ~SaxExpatParser() override; // css::lang::XInitialization: virtual void SAL_CALL initialize(css::uno::Sequence<css::uno::Any> const& rArguments) @@ -134,9 +133,7 @@ public: // XServiceInfo sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw (std::exception) override; private: - - SaxExpatParser_Impl *m_pImpl; - + std::unique_ptr<SaxExpatParser_Impl> m_pImpl; }; @@ -365,9 +362,9 @@ private: SaxExpatParser::SaxExpatParser( ) { - m_pImpl = new SaxExpatParser_Impl; + m_pImpl.reset( new SaxExpatParser_Impl ); - LocatorImpl *pLoc = new LocatorImpl( m_pImpl ); + LocatorImpl *pLoc = new LocatorImpl( m_pImpl.get() ); m_pImpl->rDocumentLocator.set( pLoc ); // Performance-improvement; handing out the same object with every call of @@ -378,11 +375,6 @@ SaxExpatParser::SaxExpatParser( ) m_pImpl->bRTExceptionWasThrown = false; } -SaxExpatParser::~SaxExpatParser() -{ - delete m_pImpl; -} - // css::lang::XInitialization: void SAL_CALL SaxExpatParser::initialize(css::uno::Sequence< css::uno::Any > const& rArguments) @@ -440,7 +432,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource) } // set all necessary C-Callbacks - XML_SetUserData( entity.pParser , m_pImpl ); + XML_SetUserData( entity.pParser, m_pImpl.get() ); XML_SetElementHandler( entity.pParser , call_callbackStartElement , call_callbackEndElement ); diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 9074688260e5..50deb1f04768 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -884,10 +884,6 @@ public: , m_nLevel(0) { } - virtual ~SAXWriter() override - { - delete m_pSaxWriterHelper; - } public: // XActiveDataSource virtual void SAL_CALL setOutputStream(const Reference< XOutputStream > & aStream) @@ -901,8 +897,7 @@ public: // XActiveDataSource else { m_out = aStream; - delete m_pSaxWriterHelper; - m_pSaxWriterHelper = new SaxWriterHelper(m_out); + m_pSaxWriterHelper.reset( new SaxWriterHelper(m_out) ); m_bDocStarted = false; m_nLevel = 0; m_bIsCDATA = false; @@ -965,8 +960,8 @@ public: // XServiceInfo private: sal_Int32 getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurrence ) throw(); - Reference< XOutputStream > m_out; - SaxWriterHelper* m_pSaxWriterHelper; + Reference< XOutputStream > m_out; + std::unique_ptr<SaxWriterHelper> m_pSaxWriterHelper; // Status information bool m_bDocStarted : 1; |