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

Noel Grandin noel.grandin at collabora.co.uk
Wed Jun 20 06:34:35 UTC 2018


 cui/source/dialogs/cuicharmap.cxx |    5 ++---
 cui/source/inc/cuicharmap.hxx     |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 317e053344e618b3b92457c8d6103a77eaa9d3ec
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jun 11 15:04:51 2018 +0200

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

diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index d236d812d603..e5b68de80117 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -657,8 +657,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl, weld::ComboBoxText&, void)
     // setup unicode subset listbar with font specific subsets,
     // hide unicode subset listbar for symbol fonts
     // TODO: get info from the Font once it provides it
-    delete pSubsetMap;
-    pSubsetMap = nullptr;
+    pSubsetMap.reset();
     m_xSubsetLB->clear();
 
     bool bNeedSubset = (aFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL);
@@ -666,7 +665,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl, weld::ComboBoxText&, void)
     {
         FontCharMapRef xFontCharMap( new FontCharMap() );
         m_xShowSet->GetFontCharMap( xFontCharMap );
-        pSubsetMap = new SubsetMap( xFontCharMap );
+        pSubsetMap.reset(new SubsetMap( xFontCharMap ));
 
         // update subset listbox for new font's unicode subsets
         bool bFirst = true;
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index 9e926f20484b..cd47e7edaf0a 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -76,7 +76,7 @@ private:
 
     VclPtr<VirtualDevice> m_xVirDev;
     vcl::Font           aFont;
-    const SubsetMap*    pSubsetMap;
+    std::unique_ptr<const SubsetMap> pSubsetMap;
     bool                isSearchMode;
     bool                m_bHasInsert;
     std::deque<OUString> maRecentCharList;


More information about the Libreoffice-commits mailing list