Kaydet (Commit) 187f29df authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwXViewSettings

Change-Id: I29c70ad5b6d5e120d8dc709d279407d3100373b7
Reviewed-on: https://gerrit.libreoffice.org/57948
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 36f8b5ec
...@@ -102,7 +102,7 @@ class SwXViewSettings final : public comphelper::ChainablePropertySet ...@@ -102,7 +102,7 @@ class SwXViewSettings final : public comphelper::ChainablePropertySet
friend class SwXDocumentSettings; friend class SwXDocumentSettings;
SwView* pView; SwView* pView;
SwViewOption* mpViewOption; std::unique_ptr<SwViewOption> mpViewOption;
const SwViewOption* mpConstViewOption; const SwViewOption* mpConstViewOption;
bool bObjectValid:1, mbApplyZoom; bool bObjectValid:1, mbApplyZoom;
......
...@@ -552,7 +552,7 @@ void SwXViewSettings::_preSetValues () ...@@ -552,7 +552,7 @@ void SwXViewSettings::_preSetValues ()
else else
pVOpt = SW_MOD()->GetViewOption(false); pVOpt = SW_MOD()->GetViewOption(false);
mpViewOption = new SwViewOption (*pVOpt); mpViewOption.reset( new SwViewOption (*pVOpt) );
mbApplyZoom = false; mbApplyZoom = false;
if(pView) if(pView)
mpViewOption->SetStarOneSetting(true); mpViewOption->SetStarOneSetting(true);
...@@ -782,8 +782,7 @@ void SwXViewSettings::_postSetValues() ...@@ -782,8 +782,7 @@ void SwXViewSettings::_postSetValues()
SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? SvViewOpt::DestViewOnly SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? SvViewOpt::DestViewOnly
: SvViewOpt::DestText ); : SvViewOpt::DestText );
delete mpViewOption; mpViewOption.reset();
mpViewOption = nullptr;
} }
void SwXViewSettings::_preGetValues () void SwXViewSettings::_preGetValues ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment