removed hardcoded 48 (number of standard colours) from a few places -- still left in the others though

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-07-03 16:23:35 +00:00
parent 0af4b6e41d
commit 61138de075

View File

@ -58,8 +58,11 @@ END_EVENT_TABLE()
* Generic wxColourDialog
*/
#define NUM_COLS 48
static wxString wxColourDialogNames[NUM_COLS]={wxT("ORANGE"),
// don't change the number of elements (48) in this array, the code below is
// hardcoded to use it
static const wxChar *wxColourDialogNames[] =
{
wxT("ORANGE"),
wxT("GOLDENROD"),
wxT("WHEAT"),
wxT("SPRING GREEN"),
@ -112,7 +115,7 @@ static wxString wxColourDialogNames[NUM_COLS]={wxT("ORANGE"),
wxT("LIGHT GREY"),
wxT("MEDIUM SLATE BLUE"),
wxT("WHITE")
};
};
wxGenericColourDialog::wxGenericColourDialog()
{
@ -288,7 +291,7 @@ void wxGenericColourDialog::InitializeColours(void)
{
int i;
for (i = 0; i < 48; i++)
for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++)
{
wxColour *col = wxTheColourDatabase->FindColour(wxColourDialogNames[i]);
if (col)
@ -307,7 +310,7 @@ void wxGenericColourDialog::InitializeColours(void)
{
bool initColourFound = FALSE;
for (i = 0; i < 48; i++)
for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++)
{
if ( standardColours[i] == curr && !initColourFound )
{