summaryrefslogtreecommitdiff
path: root/sd/source/ui/tools/SdGlobalResourceContainer.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-07 15:47:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-08 08:45:41 +0200
commit7764ae70b04058a64a3999529e98d1115ba59d1c (patch)
tree23a78251b97610b7a948ef776dfbcbc48aefbd8d /sd/source/ui/tools/SdGlobalResourceContainer.cxx
parent37d5bf82eae7e6d611879d1132b1f6fdafdeb9ed (diff)
clang bugprone-unused-return-value
most of these changes just make the change of ownership when using std::unique_ptr clearer, but there is one definite leak fix in PlainTextFilterDetect::detect Change-Id: I8282a68007222a4fee84004f394bde0cca8569e9 Reviewed-on: https://gerrit.libreoffice.org/60159 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/tools/SdGlobalResourceContainer.cxx')
-rw-r--r--sd/source/ui/tools/SdGlobalResourceContainer.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/sd/source/ui/tools/SdGlobalResourceContainer.cxx b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
index b6408cdf04be..26ec1df742db 100644
--- a/sd/source/ui/tools/SdGlobalResourceContainer.cxx
+++ b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
@@ -99,7 +99,7 @@ void SdGlobalResourceContainer::AddResource (
mpImpl->maResources.end(),
pResource.get());
if (iResource == mpImpl->maResources.end())
- mpImpl->maResources.push_back(pResource.get());
+ mpImpl->maResources.push_back(pResource.release());
else
{
// Because the given resource is a unique_ptr it is highly unlikely
@@ -107,9 +107,6 @@ void SdGlobalResourceContainer::AddResource (
SAL_WARN ( "sd.tools",
"SdGlobalResourceContainer:AddResource(): Resource added twice.");
}
- // We can not put the unique_ptr into the vector so we release the
- // unique_ptr and document that we take ownership explicitly.
- pResource.release();
}
void SdGlobalResourceContainer::AddResource (