diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-24 12:45:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-25 08:47:51 +0200 |
commit | 187f29dfc8f03565b277ee163186a46a0b8ef0c5 (patch) | |
tree | 780fcfd26f7ace91d51e724626d9a15dc577626a /sw | |
parent | 36f8b5ec35440fa0b1dadadf28ce9d1a83f8dc50 (diff) |
loplugin:useuniqueptr in SwXViewSettings
Change-Id: I29c70ad5b6d5e120d8dc709d279407d3100373b7
Reviewed-on: https://gerrit.libreoffice.org/57948
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/inc/unomod.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 5 |
2 files changed, 3 insertions, 4 deletions
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 () |