[Libreoffice-commits] core.git: svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat May 29 10:41:35 UTC 2021


 svx/source/dialog/dlgctrl.cxx             |    4 ++--
 svx/source/tbxctrls/fontworkgallery.cxx   |    8 ++++----
 svx/source/tbxctrls/tbunocontroller.cxx   |    6 +++---
 svx/source/unodraw/UnoGraphicExporter.cxx |   16 ++++++++--------
 svx/source/xml/xmlgrhlp.cxx               |   10 +++++-----
 5 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit e4c365618fca79aeb6f3c87bb1cd47b1809dfbc6
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri May 28 13:46:22 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat May 29 12:40:53 2021 +0200

    no need to allocate these on the heap
    
    Change-Id: Ia839a25cb75782b7b92372d876a41a7fd2e830d1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116370
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 043ce60afbd5..5978430b6ce0 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1445,9 +1445,9 @@ void padWidthForSidebar(weld::Toolbar& rToolbar, const css::uno::Reference<css::
         // of a "standard" column in a two column panel
         std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(&rToolbar, "svx/ui/measurewidthbar.ui"));
         std::unique_ptr<weld::Toolbar> xToolbar1(xBuilder->weld_toolbar("measurewidth1"));
-        std::unique_ptr<ToolbarUnoDispatcher> xDispatcher1(new ToolbarUnoDispatcher(*xToolbar1, *xBuilder, rFrame));
+        ToolbarUnoDispatcher aDispatcher1(*xToolbar1, *xBuilder, rFrame);
         std::unique_ptr<weld::Toolbar> xToolbar2(xBuilder->weld_toolbar("measurewidth2"));
-        std::unique_ptr<ToolbarUnoDispatcher> xDispatcher2(new ToolbarUnoDispatcher(*xToolbar2, *xBuilder, rFrame));
+        ToolbarUnoDispatcher aDispatcher2(*xToolbar2, *xBuilder, rFrame);
         nColumnWidth = std::max(xToolbar1->get_preferred_size().Width(), xToolbar2->get_preferred_size().Width());
         eSize = rToolbar.get_icon_size();
     }
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 341ad3957151..a5c812c03b63 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -154,13 +154,13 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
     if (nItemId == 0)
         return;
 
-    std::unique_ptr<FmFormModel> pModel(new FmFormModel());
-    pModel->GetItemPool().FreezeIdRanges();
+    FmFormModel aModel;
+    aModel.GetItemPool().FreezeIdRanges();
 
-    if( !GalleryExplorer::GetSdrObj( mnThemeId, nItemId-1, pModel.get() ) )
+    if( !GalleryExplorer::GetSdrObj( mnThemeId, nItemId-1, &aModel ) )
         return;
 
-    SdrPage* pPage = pModel->GetPage(0);
+    SdrPage* pPage = aModel.GetPage(0);
     if( !(pPage && pPage->GetObjCount()) )
         return;
 
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index 18916ff9dc2d..ac6c8a71ce7d 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -255,7 +255,7 @@ void SvxFontSizeBox_Base::UpdateFont(const css::awt::FontDescriptor& rCurrentFon
 {
     // filling up the sizes list
     auto nOldVal = m_xWidget->get_value(); // memorize old value
-    std::unique_ptr<FontList> xFontList(new FontList(Application::GetDefaultDevice()));
+    FontList aFontList(Application::GetDefaultDevice());
 
     if (!rCurrentFont.Name.isEmpty())
     {
@@ -263,11 +263,11 @@ void SvxFontSizeBox_Base::UpdateFont(const css::awt::FontDescriptor& rCurrentFon
         aFontMetric.SetFamilyName(rCurrentFont.Name);
         aFontMetric.SetStyleName(rCurrentFont.StyleName);
         aFontMetric.SetFontHeight(rCurrentFont.Height);
-        m_xWidget->Fill(&aFontMetric, xFontList.get());
+        m_xWidget->Fill(&aFontMetric, &aFontList);
     }
     else
     {
-        m_xWidget->Fill(nullptr, xFontList.get());
+        m_xWidget->Fill(nullptr, &aFontList);
     }
     m_xWidget->set_value(nOldVal); // restore old value
     m_aCurText = m_xWidget->get_active_text(); // memorize to reset at ESC
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index a177b84e214c..8785b910a0e6 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -420,20 +420,20 @@ VclPtr<VirtualDevice> GraphicExporter::CreatePageVDev( SdrPage* pPage, tools::Lo
 
     if(bSuccess)
     {
-        std::unique_ptr<SdrView> pView(new SdrView(*mpDoc, pVDev));
+        SdrView aView(*mpDoc, pVDev);
 
-        pView->SetPageVisible( false );
-        pView->SetBordVisible( false );
-        pView->SetGridVisible( false );
-        pView->SetHlplVisible( false );
-        pView->SetGlueVisible( false );
-        pView->ShowSdrPage(pPage);
+        aView.SetPageVisible( false );
+        aView.SetBordVisible( false );
+        aView.SetGridVisible( false );
+        aView.SetHlplVisible( false );
+        aView.SetGlueVisible( false );
+        aView.ShowSdrPage(pPage);
 
         vcl::Region aRegion (tools::Rectangle( aPoint, aPageSize ) );
 
         ImplExportCheckVisisbilityRedirector aRedirector( mpCurrentPage );
 
-        pView->CompleteRedraw(pVDev, aRegion, &aRedirector);
+        aView.CompleteRedraw(pVDev, aRegion, &aRedirector);
     }
     else
     {
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 3573a21349cf..29ea67e50781 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -319,19 +319,19 @@ Graphic SvXMLGraphicOutputStream::GetGraphic()
 
                 if( sFirstBytes[0] == 0x1f && sFirstBytes[1] == 0x8b )
                 {
-                    std::unique_ptr<SvMemoryStream> pDest(new SvMemoryStream);
+                    SvMemoryStream aDest;
                     ZCodec aZCodec( 0x8000, 0x8000 );
                     aZCodec.BeginCompression(ZCODEC_DEFAULT_COMPRESSION, /*gzLib*/true);
                     mpOStm->Seek( 0 );
-                    aZCodec.Decompress( *mpOStm, *pDest );
+                    aZCodec.Decompress( *mpOStm, aDest );
 
                     if (aZCodec.EndCompression())
                     {
-                        sal_uInt64 nStreamLen_ = pDest->TellEnd();
+                        sal_uInt64 nStreamLen_ = aDest.TellEnd();
                         if (nStreamLen_ > 0)
                         {
-                            pDest->Seek(0);
-                            GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *pDest ,nFormat,&nDeterminedFormat );
+                            aDest.Seek(0);
+                            GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", aDest ,nFormat,&nDeterminedFormat );
                         }
                     }
                 }


More information about the Libreoffice-commits mailing list