[Libreoffice-commits] core.git: 2 commits - sot/source vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 1 07:43:11 UTC 2021


 sot/source/sdstor/stgio.cxx      |    5 +++--
 sot/source/sdstor/ucbstorage.cxx |    3 ++-
 vcl/unx/gtk3/gtkinst.cxx         |    4 ----
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 23ad55d391b50ded2612316ff05ea9034e5dff33
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon May 31 17:38:38 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 1 09:42:33 2021 +0200

    gtk4: remove some unnecessary ifdefs
    
    Change-Id: Ie68b1c581979c32f83dcf0ca9a46c10b7afdec70
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116496
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 857c48563260..e31d7f915a90 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -20044,10 +20044,8 @@ bool custom_cell_renderer_surface_get_preferred_size(GtkCellRenderer *cell,
         ensure_device(cellsurface, pWidget);
         if (GtkInstanceTreeView* pTreeView = dynamic_cast<GtkInstanceTreeView*>(pWidget))
             aSize = pTreeView->call_signal_custom_get_size(*cellsurface->device, sId);
-#if !GTK_CHECK_VERSION(4, 0, 0)
         else if (GtkInstanceComboBox* pComboBox = dynamic_cast<GtkInstanceComboBox*>(pWidget))
             aSize = pComboBox->call_signal_custom_get_size(*cellsurface->device);
-#endif
     }
 
     if (orientation == GTK_ORIENTATION_HORIZONTAL)
@@ -20116,10 +20114,8 @@ void custom_cell_renderer_surface_render(GtkCellRenderer* cell,
 
     if (GtkInstanceTreeView* pTreeView = dynamic_cast<GtkInstanceTreeView*>(pWidget))
         pTreeView->call_signal_custom_render(*cellsurface->device, tools::Rectangle(Point(0, 0), aSize), flags & GTK_CELL_RENDERER_SELECTED, sId);
-#if !GTK_CHECK_VERSION(4, 0, 0)
     else if (GtkInstanceComboBox* pComboBox = dynamic_cast<GtkInstanceComboBox*>(pWidget))
         pComboBox->call_signal_custom_render(*cellsurface->device, tools::Rectangle(Point(0, 0), aSize), flags & GTK_CELL_RENDERER_SELECTED, sId);
-#endif
     cairo_surface_mark_dirty(pSurface);
 
     cairo_set_source_surface(cr, pSurface, cell_area->x, cell_area->y);
commit 6e1bdeed547fdc1ae70fa3614b4583d31d831998
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon May 31 10:18:18 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 1 09:42:24 2021 +0200

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

diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index 7d90c490c634..304be0e35d92 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -27,6 +27,7 @@
 #include <sal/log.hxx>
 
 #include <memory>
+#include <optional>
 
 ///////////////////////////// class StgIo
 
@@ -363,7 +364,7 @@ FatError StgIo::ValidateFATs()
 {
     if( m_bFile )
     {
-        std::unique_ptr<Validator> pV(new Validator( *this ));
+        std::optional<Validator> pV( *this );
         bool bRet1 = !pV->IsError(), bRet2 = true ;
         pV.reset();
 
@@ -376,7 +377,7 @@ FatError StgIo::ValidateFATs()
                       StreamMode::READ | StreamMode::SHARE_DENYNONE) &&
             aIo.Load() )
         {
-            pV.reset(new Validator( aIo ));
+            pV.emplace( aIo );
             bRet2 = !pV->IsError();
             pV.reset();
         }
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 7b26fa936db2..162748e5b5d2 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -42,6 +42,7 @@
 #include <com/sun/star/ucb/ContentCreationException.hpp>
 
 #include <memory>
+#include <optional>
 #include <osl/diagnose.h>
 #include <osl/file.hxx>
 #include <sal/log.hxx>
@@ -2120,7 +2121,7 @@ sal_Int16 UCBStorage_Impl::Commit()
                         {
                             // create a stream to write the manifest file - use a temp file
                             OUString aURL( aNewSubFolder.getURL() );
-                            std::unique_ptr< ::utl::TempFile> pTempFile(new ::utl::TempFile( &aURL ));
+                            std::optional< ::utl::TempFile> pTempFile(&aURL );
 
                             // get the stream from the temp file and create an output stream wrapper
                             SvStream* pStream = pTempFile->GetStream( StreamMode::STD_READWRITE );


More information about the Libreoffice-commits mailing list