summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilerplugins/clang/useuniqueptr.cxx3
-rw-r--r--sfx2/source/doc/guisaveas.cxx18
2 files changed, 10 insertions, 11 deletions
diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx
index 62d462d2d66d..56b669a5e1e1 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -235,6 +235,9 @@ void UseUniquePtr::CheckForForLoopDelete(const CXXDestructorDecl* destructorDecl
StringRef aFileName = compiler.getSourceManager().getFilename(compiler.getSourceManager().getSpellingLoc(fieldDecl->getLocStart()));
if (loplugin::hasPathnamePrefix(aFileName, WORKDIR))
continue;
+ // the std::vector is being passed to another class
+ if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sfx2/source/explorer/nochaos.cxx"))
+ return;
report(
DiagnosticsEngine::Warning,
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 4240f62f16e2..4f878d32f14d 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -275,8 +275,8 @@ class ModelData_Impl
uno::Reference< frame::XStorable2 > m_xStorable2;
OUString m_aModuleName;
- ::comphelper::SequenceAsHashMap* m_pDocumentPropsHM;
- ::comphelper::SequenceAsHashMap* m_pModulePropsHM;
+ std::unique_ptr<::comphelper::SequenceAsHashMap> m_pDocumentPropsHM;
+ std::unique_ptr<::comphelper::SequenceAsHashMap> m_pModulePropsHM;
::comphelper::SequenceAsHashMap m_aMediaDescrHM;
@@ -381,18 +381,14 @@ ModelData_Impl::ModelData_Impl( SfxStoringHelper& aOwner,
ModelData_Impl::~ModelData_Impl()
{
FreeDocumentProps();
- delete m_pDocumentPropsHM;
- delete m_pModulePropsHM;
+ m_pDocumentPropsHM.reset();
+ m_pModulePropsHM.reset();
}
void ModelData_Impl::FreeDocumentProps()
{
- if ( m_pDocumentPropsHM )
- {
- delete m_pDocumentPropsHM;
- m_pDocumentPropsHM = nullptr;
- }
+ m_pDocumentPropsHM.reset();
}
@@ -430,7 +426,7 @@ uno::Reference< frame::XStorable2 > const & ModelData_Impl::GetStorable2()
const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetDocProps()
{
if ( !m_pDocumentPropsHM )
- m_pDocumentPropsHM = new ::comphelper::SequenceAsHashMap( GetModel()->getArgs() );
+ m_pDocumentPropsHM.reset( new ::comphelper::SequenceAsHashMap( GetModel()->getArgs() ) );
return *m_pDocumentPropsHM;
}
@@ -457,7 +453,7 @@ const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetModuleProps()
m_pOwner->GetModuleManager()->getByName( GetModuleName() ) >>= aModuleProps;
if ( !aModuleProps.getLength() )
throw uno::RuntimeException(); // TODO;
- m_pModulePropsHM = new ::comphelper::SequenceAsHashMap( aModuleProps );
+ m_pModulePropsHM.reset( new ::comphelper::SequenceAsHashMap( aModuleProps ) );
}
return *m_pModulePropsHM;