From cc9f7d7939dded87be745386e7e705f64f7f59c9 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Garcia Date: Thu, 16 Dec 1999 12:19:02 +0000 Subject: [PATCH] Changed stopat to stopafter in CountColours git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/image.h | 2 +- src/common/image.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/wx/image.h b/include/wx/image.h index 5b15d03af2..018d2932b5 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -185,7 +185,7 @@ public: static void InitStandardHandlers(); // GRG: Dic/99 - unsigned long CountColours( unsigned long stopat = -1 ); + unsigned long CountColours( unsigned long stopafter = -1 ); unsigned long ComputeHistogram( wxHashTable &h ); diff --git a/src/common/image.cpp b/src/common/image.cpp index 4a7a6a4a1a..f2407e0978 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -2303,12 +2303,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxImageModule, wxModule) // GRG, Dic/99 // Counts and returns the number of different colours. Optionally stops -// when it reaches 'stopat' different colours. This is useful, for example, -// to see if the image can be saved as 8-bit (256 colour or less, in this -// case it would be invoked as CountColours(257)). Default value for stopat -// is -1 (don't care). +// when it exceeds 'stopafter' different colours. This is useful, for +// example, to see if the image can be saved as 8-bit (256 colour or +// less, in this case it would be invoked as CountColours(256)). Default +// value for stopafter is -1 (don't care). // -unsigned long wxImage::CountColours( unsigned long stopat ) +unsigned long wxImage::CountColours( unsigned long stopafter ) { wxHashTable h; wxNode *node; @@ -2320,7 +2320,7 @@ unsigned long wxImage::CountColours( unsigned long stopat ) size = GetWidth() * GetHeight(); nentries = 0; - for (unsigned long j = 0; (j < size) && (nentries < stopat) ; j++) + for (unsigned long j = 0; (j < size) && (nentries <= stopafter) ; j++) { r = *(p++); g = *(p++);