[haiku-commits] r40007 - haiku/trunk/src/apps/showimage

Author: leavengood
Date: 2010-12-29 05:15:14 +0100 (Wed, 29 Dec 2010)
New Revision: 40007
Changeset: http://dev.haiku-os.org/changeset/40007

Modified:
   haiku/trunk/src/apps/showimage/ProgressWindow.cpp
Log:
CID 2393: Check the return value of GetDecoratorSettings (though this is
probably not needed.)

Another problem fixed here is that the border width value is in "border width"
not "border" so this code wasn't really working before.


Modified: haiku/trunk/src/apps/showimage/ProgressWindow.cpp
===================================================================
--- haiku/trunk/src/apps/showimage/ProgressWindow.cpp   2010-12-29 04:00:25 UTC 
(rev 40006)
+++ haiku/trunk/src/apps/showimage/ProgressWindow.cpp   2010-12-29 04:15:14 UTC 
(rev 40007)
@@ -69,12 +69,12 @@
        BScreen screen(referenceWindow);
        if (!center) {
                BMessage settings;
-               GetDecoratorSettings(&settings);
+               int32 borderWidth = 5;
+               if (GetDecoratorSettings(&settings) == B_OK) {
+                       if (settings.FindInt32("border width", &borderWidth) != 
B_OK)
+                               borderWidth = 5;
+               }
 
-               int32 borderWidth;
-               if (settings.FindInt32("border", &borderWidth) != B_OK)
-                       borderWidth = 5;
-
                MoveTo(screen.Frame().left + borderWidth,
                        screen.Frame().bottom - Bounds().Height() - 
borderWidth);
        } else


Other related posts: