sd/source/ui/annotations/annotationmanager.cxx | 22 ++++++++++----------- sd/source/ui/docshell/docshel2.cxx | 4 +-- sd/source/ui/framework/tools/FrameworkHelper.cxx | 24 +++++++++++------------ sd/source/ui/inc/framework/FrameworkHelper.hxx | 2 - 4 files changed, 26 insertions(+), 26 deletions(-)
New commits: commit 0fa764925185a8a7836967b62ea89b17e60cf45c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon May 31 11:06:39 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon May 31 21:03:02 2021 +0200 no need to allocate these on the heap Change-Id: I05c00d0a4f077594d91b05698a1c04922f06a1cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116478 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index d1986d4309c1..95e7bfb4b901 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -560,10 +560,10 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) if( !pTextApi ) return; - std::unique_ptr< ::Outliner > pOutliner( new ::Outliner(GetAnnotationPool(),OutlinerMode::TextObject) ); + ::Outliner aOutliner( GetAnnotationPool(),OutlinerMode::TextObject ); - SdDrawDocument::SetCalcFieldValueHdl( pOutliner.get() ); - pOutliner->SetUpdateMode( true ); + SdDrawDocument::SetCalcFieldValueHdl( &aOutliner ); + aOutliner.SetUpdateMode( true ); OUString aStr(SdResId(STR_ANNOTATION_REPLY)); OUString sAuthor( xAnnotation->getAuthor() ); @@ -580,24 +580,24 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) aStr += sQuote + "\"\n"; for( sal_Int32 nIdx = 0; nIdx >= 0; ) - pOutliner->Insert( aStr.getToken( 0, '\n', nIdx ), EE_PARA_APPEND, -1 ); + aOutliner.Insert( aStr.getToken( 0, '\n', nIdx ), EE_PARA_APPEND, -1 ); - if( pOutliner->GetParagraphCount() > 1 ) + if( aOutliner.GetParagraphCount() > 1 ) { - SfxItemSet aAnswerSet( pOutliner->GetEmptyItemSet() ); + SfxItemSet aAnswerSet( aOutliner.GetEmptyItemSet() ); aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC)); ESelection aSel; - aSel.nEndPara = pOutliner->GetParagraphCount()-2; - aSel.nEndPos = pOutliner->GetText( pOutliner->GetParagraph( aSel.nEndPara ) ).getLength(); + aSel.nEndPara = aOutliner.GetParagraphCount()-2; + aSel.nEndPos = aOutliner.GetText( aOutliner.GetParagraph( aSel.nEndPara ) ).getLength(); - pOutliner->QuickSetAttribs( aAnswerSet, aSel ); + aOutliner.QuickSetAttribs( aAnswerSet, aSel ); } if (!sReplyText.isEmpty()) - pOutliner->Insert(sReplyText); + aOutliner.Insert(sReplyText); - std::unique_ptr< OutlinerParaObject > pOPO( pOutliner->CreateParaObject() ); + std::unique_ptr< OutlinerParaObject > pOPO( aOutliner.CreateParaObject() ); pTextApi->SetText(*pOPO); OUString sReplyAuthor; diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index 28f8ca7b91e9..2610e3ce60fe 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -50,7 +50,7 @@ void DrawDocShell::Draw(OutputDevice* pOut, const JobSetup&, sal_uInt16 nAspect) // THUMBNAIL: here we may can set the draft mode } - std::unique_ptr<ClientView> pView( new ClientView(this, pOut) ); + std::optional<ClientView> pView( std::in_place, this, pOut ); pView->SetHlplVisible(false); pView->SetGridVisible(false); @@ -202,7 +202,7 @@ BitmapEx DrawDocShell::GetPagePreviewBitmap(SdPage* pPage) aMapMode.SetScaleY( aFrac ); pVDev->SetMapMode( aMapMode ); - std::unique_ptr<ClientView> pView(new ClientView( this, pVDev )); + std::optional<ClientView> pView( std::in_place, this, pVDev ); FrameView* pFrameView = GetFrameView(); pView->ShowSdrPage( pPage ); diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index 362e80795e5f..985c72d6d576 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -285,7 +285,7 @@ public: //----- FrameworkHelper ------------------------------------------------------- -std::unique_ptr<FrameworkHelper::ViewURLMap> FrameworkHelper::mpViewURLMap(new ViewURLMap()); +FrameworkHelper::ViewURLMap FrameworkHelper::maViewURLMap; FrameworkHelper::InstanceMap FrameworkHelper::maInstanceMap; @@ -447,19 +447,19 @@ Reference<XResourceId> FrameworkHelper::RequestView ( ViewShell::ShellType FrameworkHelper::GetViewId (const OUString& rsViewURL) { - if (mpViewURLMap->empty()) + if (maViewURLMap.empty()) { - (*mpViewURLMap)[msImpressViewURL] = ViewShell::ST_IMPRESS; - (*mpViewURLMap)[msDrawViewURL] = ViewShell::ST_DRAW; - (*mpViewURLMap)[msOutlineViewURL] = ViewShell::ST_OUTLINE; - (*mpViewURLMap)[msNotesViewURL] = ViewShell::ST_NOTES; - (*mpViewURLMap)[msHandoutViewURL] = ViewShell::ST_HANDOUT; - (*mpViewURLMap)[msSlideSorterURL] = ViewShell::ST_SLIDE_SORTER; - (*mpViewURLMap)[msPresentationViewURL] = ViewShell::ST_PRESENTATION; - (*mpViewURLMap)[msSidebarViewURL] = ViewShell::ST_SIDEBAR; + maViewURLMap[msImpressViewURL] = ViewShell::ST_IMPRESS; + maViewURLMap[msDrawViewURL] = ViewShell::ST_DRAW; + maViewURLMap[msOutlineViewURL] = ViewShell::ST_OUTLINE; + maViewURLMap[msNotesViewURL] = ViewShell::ST_NOTES; + maViewURLMap[msHandoutViewURL] = ViewShell::ST_HANDOUT; + maViewURLMap[msSlideSorterURL] = ViewShell::ST_SLIDE_SORTER; + maViewURLMap[msPresentationViewURL] = ViewShell::ST_PRESENTATION; + maViewURLMap[msSidebarViewURL] = ViewShell::ST_SIDEBAR; } - ViewURLMap::const_iterator iView (mpViewURLMap->find(rsViewURL)); - if (iView != mpViewURLMap->end()) + ViewURLMap::const_iterator iView (maViewURLMap.find(rsViewURL)); + if (iView != maViewURLMap.end()) return iView->second; else return ViewShell::ST_NONE; diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx index f86d3f1edb35..e86e9efe18b1 100644 --- a/sd/source/ui/inc/framework/FrameworkHelper.hxx +++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx @@ -292,7 +292,7 @@ private: */ static InstanceMap maInstanceMap; class ViewURLMap; - static std::unique_ptr<ViewURLMap> mpViewURLMap; + static ViewURLMap maViewURLMap; ViewShellBase& mrBase; css::uno::Reference<css::drawing::framework::XConfigurationController> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits