summaryrefslogtreecommitdiff
path: root/writerperfect/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-21 07:51:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-01 08:26:24 +0200
commited8152b1ed9baf859966fd21d6641dfba9c4467c (patch)
treeb4f7b372433c5da3b8df41d026ff95fecece9ce6 /writerperfect/source
parent6cb9b06432434fb3257118743780828b3b57326a (diff)
improve loplugin:makeshared
to find places where we are converting stuff to unique_ptr instead of using std::make_shared. As a bonus, this tends to find places where we are using shared_ptr where we can instead be using unique_ptr avoiding the locking overhead. Change-Id: I1b57bbc4a6c766b48bba8e25a55161800e149f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerperfect/source')
-rw-r--r--writerperfect/source/impress/KeynoteImportFilter.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx b/writerperfect/source/impress/KeynoteImportFilter.cxx
index 1e69e85dc883..c212c5ab85d0 100644
--- a/writerperfect/source/impress/KeynoteImportFilter.cxx
+++ b/writerperfect/source/impress/KeynoteImportFilter.cxx
@@ -97,8 +97,8 @@ KeynoteImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& Descr
if (!xInputStream.is())
return OUString();
- std::shared_ptr<librevenge::RVNGInputStream> input
- = std::make_shared<WPXSvInputStream>(xInputStream);
+ std::unique_ptr<librevenge::RVNGInputStream> input
+ = std::make_unique<WPXSvInputStream>(xInputStream);
/* Apple Keynote documents come in two variants:
* * actual files (zip), only produced by Keynote 5 (at least with
@@ -121,7 +121,7 @@ KeynoteImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& Descr
{
if (aContent.isFolder())
{
- input = std::make_shared<writerperfect::DirectoryStream>(xContent);
+ input = std::make_unique<writerperfect::DirectoryStream>(xContent);
bIsPackage = true;
}
}
@@ -143,9 +143,10 @@ KeynoteImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& Descr
if (bIsPackage) // we passed a directory stream, but the filter claims it's APXL file?
return OUString();
- const std::shared_ptr<writerperfect::DirectoryStream> pDir
+ std::unique_ptr<writerperfect::DirectoryStream> xDir
= writerperfect::DirectoryStream::createForParent(xContent);
- input = pDir;
+ auto pDir = xDir.get();
+ input = std::move(xDir);
if (bool(input))
{
if (libetonyek::EtonyekDocument::CONFIDENCE_EXCELLENT