[Libreoffice-commits] core.git: vcl/inc vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 10 14:05:41 UTC 2021


 vcl/inc/implimagetree.hxx          |    2 +-
 vcl/source/image/ImplImageTree.cxx |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 45aaabbdfb7968d222d88b1b56788c0bd4c5b27d
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Mon Aug 9 19:00:14 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 10 16:05:02 2021 +0200

    flatten ImplImageTree a little
    
    Change-Id: Ibf67c85f4af80e5420b017a1a1f89e3eac8a3118
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120219
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/inc/implimagetree.hxx b/vcl/inc/implimagetree.hxx
index 72cdd02d85cf..48773cc42c23 100644
--- a/vcl/inc/implimagetree.hxx
+++ b/vcl/inc/implimagetree.hxx
@@ -92,7 +92,7 @@ private:
     ImplImageTree& operator=(const ImplImageTree&) = delete;
 
     typedef std::unordered_map<OUString, std::pair<bool,BitmapEx>> IconCache;
-    typedef std::unordered_map<sal_Int32, std::unique_ptr<IconCache>> ScaledIconCache;
+    typedef std::unordered_map<sal_Int32, IconCache> ScaledIconCache;
     typedef std::unordered_map<OUString, OUString> IconLinkHash;
 
     struct IconSet
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 227b5981be52..263e63befef1 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -517,9 +517,9 @@ ImplImageTree::IconCache &ImplImageTree::getIconCache(const ImageRequestParamete
     IconSet &rSet = getCurrentIconSet();
     auto it = rSet.maScaledIconCaches.find(rParameters.mnScalePercentage);
     if ( it != rSet.maScaledIconCaches.end() )
-        return *it->second;
-    rSet.maScaledIconCaches[rParameters.mnScalePercentage] = std::make_unique<IconCache>();
-    return *rSet.maScaledIconCaches[rParameters.mnScalePercentage];
+        return it->second;
+    rSet.maScaledIconCaches.emplace(rParameters.mnScalePercentage, IconCache());
+    return rSet.maScaledIconCaches[rParameters.mnScalePercentage];
 }
 
 bool ImplImageTree::iconCacheLookup(ImageRequestParameters& rParameters)


More information about the Libreoffice-commits mailing list