diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-10 12:30:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-10 13:07:41 +0100 |
commit | 175a2063effa1c5a3eab896c6c4b0d07f3588edb (patch) | |
tree | 4a252a7e9e6e714343e9ff21c3d78c8e41086009 /sd/qa | |
parent | ddf901664d3dd12191f98b77182652a6889f2b26 (diff) |
use more std::make_shared
found using 'git grep', I tried using clang-tidy, but it only
successfully found a tiny fraction of these
Change-Id: I61c7d85105ff7a911722750e759d6641d578da33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/filters-test.cxx | 6 | ||||
-rw-r--r-- | sd/qa/unit/sdmodeltestbase.hxx | 24 |
2 files changed, 15 insertions, 15 deletions
diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx index 52fc6f9d7050..707f8c85110e 100644 --- a/sd/qa/unit/filters-test.cxx +++ b/sd/qa/unit/filters-test.cxx @@ -51,11 +51,11 @@ bool SdFiltersTest::load(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) { - std::shared_ptr<const SfxFilter> pFilter(new SfxFilter( + auto pFilter = std::make_shared<SfxFilter>( rFilter, OUString(), nFilterFlags, nClipboardID, OUString(), OUString(), - rUserData, OUString() )); - const_cast<SfxFilter*>(pFilter.get())->SetVersion(nFilterVersion); + rUserData, OUString() ); + pFilter->SetVersion(nFilterVersion); ::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress); SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 8fef3182ee3e..bdb800953e01 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -207,15 +207,15 @@ protected: SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODG_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARDRAW_8; - std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared<SfxFilter>( OUString::createFromAscii(pFormat->pFilterName), OUString(), pFormat->nFormatType, nExportFormat, OUString::createFromAscii(pFormat->pTypeName), OUString(), OUString::createFromAscii(pFormat->pUserData), - "private:factory/sdraw*" )); + "private:factory/sdraw*" ); - const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); } else // Impress @@ -223,15 +223,15 @@ protected: SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODP_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARIMPRESS_8; - std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared<SfxFilter>( OUString::createFromAscii(pFormat->pFilterName), OUString(), pFormat->nFormatType, nExportFormat, OUString::createFromAscii(pFormat->pTypeName), OUString(), OUString::createFromAscii(pFormat->pUserData), - "private:factory/simpress*" )); + "private:factory/simpress*" ); - const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); } pShell->ConvertTo(aStoreMedium); @@ -247,14 +247,14 @@ protected: SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODG_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARDRAW_8; - std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared<SfxFilter>( OUString::createFromAscii(pFormat->pFilterName), OUString(), pFormat->nFormatType, nExportFormat, OUString::createFromAscii(pFormat->pTypeName), OUString(), OUString::createFromAscii(pFormat->pUserData), - "private:factory/sdraw*" )); - const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + "private:factory/sdraw*" ); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); } else // Impress @@ -262,14 +262,14 @@ protected: SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODP_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCHART_8; - std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared<SfxFilter>( OUString::createFromAscii(pFormat->pFilterName), OUString(), pFormat->nFormatType, nExportFormat, OUString::createFromAscii(pFormat->pTypeName), OUString(), OUString::createFromAscii(pFormat->pUserData), - "private:factory/simpress*" )); - const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + "private:factory/simpress*" ); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); } pShell->DoSaveAs(aStoreMedium); |