lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] wxART_* icons not found


From: Vadim Zeitlin
Subject: Re: [lmi] wxART_* icons not found
Date: Tue, 17 Nov 2015 03:34:13 +0100

On Mon, 16 Nov 2015 03:02:34 +0000 Greg Chicares <address@hidden> wrote:

GC> In the process of testing some incomplete changes to PNG filenames,
GC> I got the following messages. I'm surprised because I thought these
GC> icons were built in and always available. I've never seen these
GC> errors before. I guess these icons would have been used by wx to
GC> report the errors in my local tree; if I fix my errors, these
GC> messages disappear. Does this indicate some underlying problem?
GC> I'm using msw-xp with a "classic" theme.
GC> 
GC> Unable to find icon 'wxART_ERROR' for current theme. Please report this 
problem.
GC> A blank icon will be used instead.
GC> [file /lmi/src/lmi/icon_monger.cpp, line 192]

 I can reproduce this and I think the code in icon_monger.cpp is just
wrong: the comment there implies that it should do nothing for a standard
icon if it's not found in the map containing lmi-specific overrides, but it
actually does do something, namely proceeds with the rest of the function
execution and so generates the (wrong) warning above. The minimal change to
fix this would be:
---------------------------------- >8 --------------------------------------
diff --git a/icon_monger.cpp b/icon_monger.cpp
index e8355f6..8929d9a 100644
--- a/icon_monger.cpp
+++ b/icon_monger.cpp
@@ -167,7 +167,9 @@
             }
         catch(...)
             {
-            ; // Do nothing. Not all wxART id's have lmi overrides.
+            // Not all wxART id's have lmi overrides, so just let the next art
+            // provider deal with it.
+            return wxNullBitmap;
             }
         }
---------------------------------- >8 --------------------------------------

 Personally I'd also get rid of the ugly "catch(...)" and apply a more
extensive patch in the attachment which gets rid of map_lookup() too.

 Regards,
VZ

Attachment: 0001-Avoid-warnings-when-loading-standard-wx-icons-in-ico.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]