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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jul 25 06:48:17 UTC 2018


 sw/source/uibase/inc/unomod.hxx |    2 +-
 sw/source/uibase/uno/unomod.cxx |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 187f29dfc8f03565b277ee163186a46a0b8ef0c5
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jul 24 12:45:00 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 25 08:47:51 2018 +0200

    loplugin:useuniqueptr in SwXViewSettings
    
    Change-Id: I29c70ad5b6d5e120d8dc709d279407d3100373b7
    Reviewed-on: https://gerrit.libreoffice.org/57948
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/uibase/inc/unomod.hxx b/sw/source/uibase/inc/unomod.hxx
index 3bdba7867954..5f385aaffbf1 100644
--- a/sw/source/uibase/inc/unomod.hxx
+++ b/sw/source/uibase/inc/unomod.hxx
@@ -102,7 +102,7 @@ class SwXViewSettings final : public comphelper::ChainablePropertySet
     friend class SwXDocumentSettings;
 
     SwView*                     pView;
-    SwViewOption*       mpViewOption;
+    std::unique_ptr<SwViewOption> mpViewOption;
     const SwViewOption*         mpConstViewOption;
     bool                    bObjectValid:1, mbApplyZoom;
 
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index f2a5456a4aa4..ff5ff9a0fd5c 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -552,7 +552,7 @@ void SwXViewSettings::_preSetValues ()
     else
         pVOpt = SW_MOD()->GetViewOption(false);
 
-    mpViewOption = new SwViewOption (*pVOpt);
+    mpViewOption.reset( new SwViewOption (*pVOpt) );
     mbApplyZoom = false;
     if(pView)
         mpViewOption->SetStarOneSetting(true);
@@ -782,8 +782,7 @@ void SwXViewSettings::_postSetValues()
     SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? SvViewOpt::DestViewOnly
                                                   : SvViewOpt::DestText );
 
-    delete mpViewOption;
-    mpViewOption = nullptr;
+    mpViewOption.reset();
 }
 
 void SwXViewSettings::_preGetValues ()


More information about the Libreoffice-commits mailing list