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

Maxim Monastirsky (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 19 22:20:40 UTC 2020


 framework/source/fwe/classes/addonsoptions.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c87da6596334866499e1aff3959abc025d05f75f
Author:     Maxim Monastirsky <momonasmon at gmail.com>
AuthorDate: Wed Aug 19 21:39:44 2020 +0300
Commit:     Maxim Monastirsky <momonasmon at gmail.com>
CommitDate: Thu Aug 20 00:19:54 2020 +0200

    tdf#107548 Use ImageSmallURL for small icons
    
    Started as a copy-paste error introduced in commit
    a2f4aed32257e183339a3513339bc59009c88527 ("fdo#66524 - defer
    loading and scaling AddOns images until necessary."), which
    was removed later in 9a65df25138750915f9c6e1e1fa09988a2d11434
    ("coverity#1078526 Logically dead code").
    
    Also, the high contrast properties are no longer supported,
    but they still read and were overwriting the big image property.
    
    Change-Id: I005bf5873fe821896c143d8fb513b2f73f05bba1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101028
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index faa8ffdc5713..4201a6a5f4f7 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -129,7 +129,7 @@ using namespace ::com::sun::star;
 
 // The following order is mandatory. Please add properties at the end!
 #define PROPERTYCOUNT_IMAGES                            8
-#define PROPERTYCOUNT_EMBEDDED_IMAGES                   4
+#define PROPERTYCOUNT_EMBEDDED_IMAGES                   2
 #define OFFSET_IMAGES_SMALL                             0
 #define OFFSET_IMAGES_BIG                               1
 #define OFFSET_IMAGES_SMALLHC                           2
@@ -1642,7 +1642,7 @@ std::unique_ptr<AddonsOptions_Impl::ImageEntry> AddonsOptions_Impl::ReadImageDat
                 pEntry->addImage(i == OFFSET_IMAGES_SMALL ? IMGSIZE_SMALL : IMGSIZE_BIG, aImage, "");
             }
         }
-        else
+        else if ( i == OFFSET_IMAGES_SMALL_URL || i == OFFSET_IMAGES_BIG_URL )
         {
             if(!pEntry)
                 pEntry.reset(new ImageEntry());
@@ -1653,7 +1653,7 @@ std::unique_ptr<AddonsOptions_Impl::ImageEntry> AddonsOptions_Impl::ReadImageDat
 
             SubstituteVariables( aImageURL );
 
-            pEntry->addImage(IMGSIZE_BIG, BitmapEx(), aImageURL);
+            pEntry->addImage(i == OFFSET_IMAGES_SMALL_URL ? IMGSIZE_SMALL : IMGSIZE_BIG, BitmapEx(), aImageURL);
         }
     }
 


More information about the Libreoffice-commits mailing list