]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/colrdlgg.cpp
do take the toolbar into account for Windows CE, otherwise the menus overlap with...
[wxWidgets.git] / src / generic / colrdlgg.cpp
index 494858f390672cc8e9112421cc6afb11eaf90e6d..38275f47bb551ba3eb286bc55e07c52ecc66ae50 100644 (file)
@@ -304,14 +304,14 @@ void wxGenericColourDialog::InitializeColours(void)
 
     for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++)
     {
-        wxColour *col = wxTheColourDatabase->FindColour(wxColourDialogNames[i]);
-        if (col)
-            standardColours[i].Set(col->Red(), col->Green(), col->Blue());
+        wxColour col = wxTheColourDatabase->Find(wxColourDialogNames[i]);
+        if (col.Ok())
+            standardColours[i].Set(col.Red(), col.Green(), col.Blue());
         else
             standardColours[i].Set(0, 0, 0);
     }
 
-    for (i = 0; i < 16; i++)
+    for (i = 0; i < WXSIZEOF(customColours); i++)
     {
         customColours[i] = colourData.GetCustomColour(i);
     }
@@ -333,13 +333,12 @@ void wxGenericColourDialog::InitializeColours(void)
         }
         if ( !initColourFound )
         {
-            for ( i = 0; i < 16; i++ )
+            for ( i = 0; i < WXSIZEOF(customColours); i++ )
             {
                 if ( customColours[i] == curr )
                 {
                     whichKind = 2;
                     colourSelection = i;
-                    initColourFound = TRUE;
                     break;
                 }
             }