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 | |
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')
24 files changed, 64 insertions, 79 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); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index f4de034d7877..32c8a3e1d1df 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1636,7 +1636,7 @@ void CustomAnimationPane::showOptions(const OString& rPage) { std::unique_ptr<STLPropertySet> xSet = createSelectionSet(); - std::shared_ptr<CustomAnimationDialog> xDlg(new CustomAnimationDialog(GetFrameWeld(), std::move(xSet), rPage)); + auto xDlg = std::make_shared<CustomAnimationDialog>(GetFrameWeld(), std::move(xSet), rPage); weld::DialogController::runAsync(xDlg, [xDlg, this](sal_Int32 nResult){ if (nResult ) diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 6cd3de93bfa7..a60238eb9273 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -275,7 +275,7 @@ std::shared_ptr<BasicViewFactory::ViewDescriptor> BasicViewFactory::CreateView ( FrameView* pFrameView, const bool bIsCenterPane) { - std::shared_ptr<ViewDescriptor> pDescriptor (new ViewDescriptor); + auto pDescriptor = std::make_shared<ViewDescriptor>(); pDescriptor->mpViewShell = CreateViewShell( rxViewId, diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index 96a805040cb9..4984c675ec4c 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -109,7 +109,7 @@ void FuTransform::DoExecute( SfxRequest& rReq ) if (!pDlg) return; - std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq)); + auto pRequest = std::make_shared<SfxRequest>(rReq); rReq.Ignore(); // the 'old' request is not relevant any more pDlg->StartExecuteAsync([bWelded, pDlg, pRequest, this](sal_Int32 nResult){ diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx index 42617e9bd133..b62794a7e929 100644 --- a/sd/source/ui/presenter/PresenterPreviewCache.cxx +++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx @@ -277,7 +277,7 @@ const SdrPage* PresenterPreviewCache::PresenterCacheContext::GetPage (CacheKey a std::shared_ptr<std::vector<CacheKey> > PresenterPreviewCache::PresenterCacheContext::GetEntryList (bool bVisible) { - std::shared_ptr<std::vector<CacheKey> > pKeys (new std::vector<CacheKey>); + auto pKeys = std::make_shared<std::vector<CacheKey>>(); if ( ! mxSlides.is()) return pKeys; diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index bf5d0fdc5392..1828b72960b5 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -128,10 +128,10 @@ void RemoteServer::execute() pSocket->getPeerAddr( aClientAddr ); MutexGuard aGuard( sDataMutex ); - std::shared_ptr< ClientInfoInternal > pClient( - new ClientInfoInternal( + std::shared_ptr< ClientInfoInternal > pClient = + std::make_shared<ClientInfoInternal>( OStringToOUString( aName, RTL_TEXTENCODING_UTF8 ), - pSocket, OStringToOUString( aPin, RTL_TEXTENCODING_UTF8 ) ) ); + pSocket, OStringToOUString( aPin, RTL_TEXTENCODING_UTF8 ) ); mAvailableClients.push_back( pClient ); // Read off any additional non-empty lines diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx index 1020cde8a4e8..725cc61a6dad 100644 --- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx @@ -83,7 +83,7 @@ VclPtr<vcl::Window> AllMasterPagesSelector::Create ( if (pDocument == nullptr) return nullptr; - std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer()); + auto pContainer = std::make_shared<MasterPageContainer>(); VclPtrInstance<AllMasterPagesSelector> pSelector( pParent, diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx index 835a4532a294..013f84516ebe 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx @@ -46,7 +46,7 @@ VclPtr<vcl::Window> CurrentMasterPagesSelector::Create ( if (pDocument == nullptr) return nullptr; - std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer()); + auto pContainer = std::make_shared<MasterPageContainer>(); VclPtrInstance<CurrentMasterPagesSelector> pSelector( pParent, @@ -137,8 +137,8 @@ void CurrentMasterPagesSelector::Fill (ItemList& rItemList) pMasterPage->GetName(), OUString(), pMasterPage->IsPrecious(), - std::shared_ptr<PageObjectProvider>(new ExistingPageProvider(pMasterPage)), - std::shared_ptr<PreviewProvider>(new PagePreviewProvider()))); + std::make_shared<ExistingPageProvider>(pMasterPage), + std::make_shared<PagePreviewProvider>())); aToken = mpContainer->PutMasterPage(pDescriptor); } diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 18ad57d14a3c..95f68f316ca6 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -521,7 +521,7 @@ void MasterPageContainer::Implementation::LateInit() std::shared_ptr<MasterPageContainerQueue::ContainerAdapter>(Instance()))); mpFillerTask = ::sd::tools::TimerBasedTaskExecution::Create( - std::shared_ptr<tools::AsynchronousTask>(new MasterPageContainerFiller(*this)), + std::make_shared<MasterPageContainerFiller>(*this), 5, 50); diff --git a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx index d007e524f969..5dc90ac29491 100644 --- a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx @@ -46,8 +46,8 @@ MasterPageContainerFiller::MasterPageContainerFiller (ContainerAdapter& rpAdapte OUString(), OUString(), false, - std::shared_ptr<PageObjectProvider>(new DefaultPageObjectProvider()), - std::shared_ptr<PreviewProvider>(new PagePreviewProvider()))); + std::make_shared<DefaultPageObjectProvider>(), + std::make_shared<PagePreviewProvider>())); mrContainerAdapter.PutMasterPage(pDescriptor); } @@ -147,18 +147,15 @@ MasterPageContainerFiller::State MasterPageContainerFiller::AddTemplate() mpLastAddedEntry->msTitle, OUString(), false, - std::shared_ptr<PageObjectProvider>( - new TemplatePageObjectProvider(mpLastAddedEntry->msPath)), - std::shared_ptr<PreviewProvider>( - new TemplatePreviewProvider(mpLastAddedEntry->msPath)))); + std::make_shared<TemplatePageObjectProvider>(mpLastAddedEntry->msPath), + std::make_shared<TemplatePreviewProvider>(mpLastAddedEntry->msPath))); // For user supplied templates we use a different preview provider: // The preview in the document shows not only shapes on the master // page but also shapes on the foreground. This is misleading and // therefore these previews are discarded and created directly from // the page objects. if (pDescriptor->GetURLClassification() == MasterPageDescriptor::URLCLASS_USER) - pDescriptor->mpPreviewProvider = std::shared_ptr<PreviewProvider>( - new PagePreviewProvider()); + pDescriptor->mpPreviewProvider = std::make_shared<PagePreviewProvider>(); mrContainerAdapter.PutMasterPage(pDescriptor); ++mnIndex; diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx index 0f9d21a81c2c..2d77511f067e 100644 --- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx +++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx @@ -176,7 +176,7 @@ int MasterPageDescriptor::UpdatePageObject ( // will create the real one. maSmallPreview = Image(); maLargePreview = Image(); - mpPreviewProvider = std::shared_ptr<PreviewProvider>(new PagePreviewProvider()); + mpPreviewProvider = std::make_shared<PagePreviewProvider>(); } else { diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx index 4e846dad20aa..7a2568375f99 100644 --- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx @@ -37,7 +37,7 @@ VclPtr<vcl::Window> RecentMasterPagesSelector::Create ( if (pDocument == nullptr) return nullptr; - std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer()); + auto pContainer = std::make_shared<MasterPageContainer>(); VclPtrInstance<RecentMasterPagesSelector> pSelector( pParent, diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx index c6f0b02b07a4..d1f4ab532d82 100644 --- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx +++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx @@ -144,10 +144,8 @@ void RecentlyUsedMasterPages::LoadPersistentValues() OUString(), sName, false, - std::shared_ptr<PageObjectProvider>( - new TemplatePageObjectProvider(sURL)), - std::shared_ptr<PreviewProvider>( - new TemplatePreviewProvider(sURL)))); + std::make_shared<TemplatePageObjectProvider>(sURL), + std::make_shared<TemplatePreviewProvider>(sURL))); // For user supplied templates we use a different // preview provider: The preview in the document shows // not only shapes on the master page but also shapes on @@ -155,8 +153,7 @@ void RecentlyUsedMasterPages::LoadPersistentValues() // these previews are discarded and created directly // from the page objects. if (pDescriptor->GetURLClassification() == MasterPageDescriptor::URLCLASS_USER) - pDescriptor->mpPreviewProvider = std::shared_ptr<PreviewProvider>( - new PagePreviewProvider()); + pDescriptor->mpPreviewProvider = std::make_shared<PagePreviewProvider>(); MasterPageContainer::Token aToken (mpContainer->PutMasterPage(pDescriptor)); mvMasterPages.emplace_back(aToken,sURL,sName); } diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx index d276384985c9..a117b33e0ecc 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx @@ -44,7 +44,7 @@ public: std::shared_ptr<BitmapReplacement> NoBitmapCompression::Compress (const BitmapEx& rBitmap) const { - return std::shared_ptr<BitmapReplacement>(new DummyReplacement(rBitmap)); + return std::make_shared<DummyReplacement>(rBitmap); } BitmapEx NoBitmapCompression::Decompress (const BitmapReplacement& rBitmapData) const diff --git a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx index d6ed54ad5d33..ce7d0533085e 100644 --- a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx +++ b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx @@ -104,14 +104,14 @@ Animator::AnimationId Animator::AddAnimation ( if (mbIsDisposed) return -1; - std::shared_ptr<Animation> pAnimation ( - new Animation( + std::shared_ptr<Animation> pAnimation = + std::make_shared<Animation>( rAnimation, 0, 300 / 1000.0, maElapsedTime.getElapsedTime(), ++mnNextAnimationId, - rFinishFunctor)); + rFinishFunctor); maAnimations.push_back(pAnimation); RequestNextFrame(); diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 94a17a4dd903..133be4020ec7 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -539,10 +539,10 @@ std::shared_ptr<SdTransferable::UserData> Clipboard::CreateTransferableUserData rOtherClipboard.maPagesToRemove.push_back(pDescriptor->GetPage()); // Create the new transferable. - std::shared_ptr<SdTransferable::UserData> pNewTransferable ( - new TransferableData( + std::shared_ptr<SdTransferable::UserData> pNewTransferable = + std::make_shared<TransferableData>( pSlideSorterViewShell, - aRepresentatives)); + aRepresentatives); pTransferable->SetWorkDocument(pTreeListBoxTransferable->GetSourceDoc()->AllocSdDrawDocument()); // pTransferable->SetView(&mrSlideSorter.GetView()); diff --git a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx index f169c205f810..26498f913979 100644 --- a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx +++ b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx @@ -263,7 +263,7 @@ void PageSelector::DisableBroadcasting() std::shared_ptr<PageSelector::PageSelection> PageSelector::GetPageSelection() const { - std::shared_ptr<PageSelection> pSelection (new PageSelection); + auto pSelection = std::make_shared<PageSelection>(); pSelection->reserve(GetSelectedPageCount()); int nPageCount = GetPageCount(); diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index d54b09a91a90..162053697bf5 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -655,8 +655,7 @@ static bool Match ( void SelectionFunction::SwitchToNormalMode() { if (mpModeHandler->GetMode() != NormalMode) - SwitchMode(std::shared_ptr<ModeHandler>( - new NormalModeHandler(mrSlideSorter, *this))); + SwitchMode(std::make_shared<NormalModeHandler>(mrSlideSorter, *this)); } void SelectionFunction::SwitchToDragAndDropMode (const Point& rMousePosition) @@ -664,8 +663,7 @@ void SelectionFunction::SwitchToDragAndDropMode (const Point& rMousePosition) if (mpModeHandler->GetMode() == DragAndDropMode) return; - SwitchMode(std::shared_ptr<ModeHandler>( - new DragAndDropModeHandler(mrSlideSorter, *this, rMousePosition, mpWindow))); + SwitchMode(std::make_shared<DragAndDropModeHandler>(mrSlideSorter, *this, rMousePosition, mpWindow)); } void SelectionFunction::SwitchToMultiSelectionMode ( @@ -673,8 +671,7 @@ void SelectionFunction::SwitchToMultiSelectionMode ( const sal_uInt32 nEventCode) { if (mpModeHandler->GetMode() != MultiSelectionMode) - SwitchMode(std::shared_ptr<ModeHandler>( - new MultiSelectionModeHandler(mrSlideSorter, *this, rMousePosition, nEventCode))); + SwitchMode(std::make_shared<MultiSelectionModeHandler>(mrSlideSorter, *this, rMousePosition, nEventCode)); } void SelectionFunction::SwitchMode (const std::shared_ptr<ModeHandler>& rpHandler) diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx index 5017cf9b5bec..14762979466f 100644 --- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx +++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx @@ -29,7 +29,7 @@ SdTransferable* TransferableData::CreateTransferable ( const ::std::vector<Representative>& rRepresentatives) { SdTransferable* pTransferable = new SdTransferable (pSrcDoc, nullptr, false/*bInitOnGetData*/); - std::shared_ptr<TransferableData> pData (new TransferableData(pViewShell, rRepresentatives)); + auto pData = std::make_shared<TransferableData>(pViewShell, rRepresentatives); pTransferable->AddUserData(pData); return pTransferable; } diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx index 0202b4d8b798..578a611a8f2c 100644 --- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx +++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx @@ -77,7 +77,7 @@ const SdrPage* ViewCacheContext::GetPage (cache::CacheKey aKey) std::shared_ptr<std::vector<cache::CacheKey> > ViewCacheContext::GetEntryList (bool bVisible) { - std::shared_ptr<std::vector<cache::CacheKey> > pKeys (new std::vector<cache::CacheKey>); + auto pKeys = std::make_shared<std::vector<cache::CacheKey>>(); model::PageEnumeration aPageEnumeration ( bVisible diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 17e225e7c1c8..b649c4c22484 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1745,15 +1745,14 @@ private: if ( CheckForFrontBackPages( nIndex ) ) { maPrinterPages.push_back( - std::shared_ptr<PrinterPage>( - new OutlinerPrinterPage( + std::make_shared<OutlinerPrinterPage>( pOutliner->CreateParaObject(), aMap, rInfo.msTimeDate, aPageOfs, rInfo.mnDrawMode, rInfo.meOrientation, - rInfo.mpPrinter->GetPaperBin()))); + rInfo.mpPrinter->GetPaperBin())); } } @@ -1863,8 +1862,7 @@ private: && (aPageIndices.size() == nShapeCount || bLastLoop) ) { maPrinterPages.push_back( - std::shared_ptr<PrinterPage>( - new HandoutPrinterPage( + std::make_shared<HandoutPrinterPage>( nPrinterPageIndex++, aPageIndices, aMap, @@ -1872,7 +1870,7 @@ private: aPageOfs, rInfo.mnDrawMode, rInfo.meOrientation, - nPaperBin))); + nPaperBin)); aPageIndices.clear(); } } @@ -2090,8 +2088,7 @@ private: else aSecondOffset.AdjustY( aAdjustedPrintSize.Height() / 2 ); maPrinterPages.push_back( - std::shared_ptr<PrinterPage>( - new BookletPrinterPage( + std::make_shared<BookletPrinterPage>( aPair.first, aPair.second, aOffset, @@ -2101,7 +2098,7 @@ private: rInfo.mbPrintMarkedOnly, rInfo.mnDrawMode, rInfo.meOrientation, - rInfo.mpPrinter->GetPaperBin()))); + rInfo.mpPrinter->GetPaperBin())); } } @@ -2126,8 +2123,7 @@ private: return; maPrinterPages.push_back( - std::shared_ptr<PrinterPage>( - new TiledPrinterPage( + std::make_shared<TiledPrinterPage>( sal::static_int_cast<sal_uInt16>(nPageIndex), ePageKind, rInfo.mbPrintMarkedOnly, @@ -2135,7 +2131,7 @@ private: rInfo.mpPrinter->GetPageOffset(), rInfo.mnDrawMode, rInfo.meOrientation, - nPaperBin))); + nPaperBin)); } /** Print one standard slide or notes page on one to many printer @@ -2173,8 +2169,7 @@ private: // if CutPage is set then do not move it, otherwise move the // scaled page to printable area maPrinterPages.push_back( - std::shared_ptr<PrinterPage>( - new RegularPrinterPage( + std::make_shared<RegularPrinterPage>( sal::static_int_cast<sal_uInt16>(nPageIndex), ePageKind, aMap, @@ -2183,7 +2178,7 @@ private: aPageOffset, rInfo.mnDrawMode, rInfo.meOrientation, - nPaperBin))); + nPaperBin)); } else { @@ -2211,8 +2206,7 @@ private: { aMap.SetOrigin(aPageOrigin); maPrinterPages.push_back( - std::shared_ptr<PrinterPage>( - new RegularPrinterPage( + std::make_shared<RegularPrinterPage>( sal::static_int_cast<sal_uInt16>(nPageIndex), ePageKind, aMap, @@ -2221,7 +2215,7 @@ private: aPageOffset, rInfo.mnDrawMode, rInfo.meOrientation, - nPaperBin))); + nPaperBin)); } } } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 6970fe0aeb28..248092c06416 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1608,7 +1608,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_CLASSIFICATION_DIALOG: { - std::shared_ptr<svx::ClassificationDialog> xDialog(new svx::ClassificationDialog(GetFrameWeld(), false, [](){} )); + auto xDialog = std::make_shared<svx::ClassificationDialog>(GetFrameWeld(), false, [](){} ); ClassificationCollector aCollector(*this); aCollector.collect(); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index c5e1450f70e2..6f1607aefc10 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -294,7 +294,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); vcl::Window* pWin = GetActiveWindow(); VclPtr<AbstractHeaderFooterDialog> pDlg(pFact->CreateHeaderFooterDialog(this, pWin ? pWin->GetFrameWeld() : nullptr, GetDoc(), mpActualPage)); - std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq)); + auto xRequest = std::make_shared<SfxRequest>(rReq); rReq.Ignore(); // the 'old' request is not relevant any more pDlg->StartExecuteAsync([this, pDlg, xRequest](sal_Int32 /*nResult*/){ GetActiveWindow()->Invalidate(); |