Tidied space and tabs in wxMac files

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-02-28 23:48:13 +00:00
parent 7de24929eb
commit e40298d54e
202 changed files with 17354 additions and 17176 deletions

View File

@@ -6,7 +6,7 @@
// Created: 1998-01-01
// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -30,8 +30,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
wxPaletteRefData::wxPaletteRefData()
{
m_palette = NULL ;
m_count = 0 ;
m_palette = NULL ;
m_count = 0 ;
}
wxPaletteRefData::~wxPaletteRefData()
@@ -57,41 +57,41 @@ wxPalette::~wxPalette()
bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
{
UnRef();
m_refData = new wxPaletteRefData;
M_PALETTEDATA->m_count = n ;
M_PALETTEDATA->m_palette = new wxColour[n] ;
for ( int i = 0 ; i < n ; ++i)
{
M_PALETTEDATA->m_palette[i].Set( red[i] , green[i] , blue[i] ) ;
}
return FALSE;
UnRef();
m_refData = new wxPaletteRefData;
M_PALETTEDATA->m_count = n ;
M_PALETTEDATA->m_palette = new wxColour[n] ;
for ( int i = 0 ; i < n ; ++i)
{
M_PALETTEDATA->m_palette[i].Set( red[i] , green[i] , blue[i] ) ;
}
return FALSE;
}
int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
{
if ( !m_refData )
return -1;
return -1;
long bestdiff = 3 * 256 ;
long bestpos = 0 ;
long currentdiff ;
for ( int i = 0 ; i < M_PALETTEDATA->m_count ; ++i )
{
const wxColour& col = &M_PALETTEDATA->m_palette[i] ;
currentdiff = abs ( col.Red() - red ) + abs( col.Green() - green ) + abs ( col.Blue() - blue ) ;
if ( currentdiff < bestdiff )
{
bestdiff = currentdiff ;
bestpos = i ;
if ( bestdiff == 0 )
break ;
}
const wxColour& col = &M_PALETTEDATA->m_palette[i] ;
currentdiff = abs ( col.Red() - red ) + abs( col.Green() - green ) + abs ( col.Blue() - blue ) ;
if ( currentdiff < bestdiff )
{
bestdiff = currentdiff ;
bestpos = i ;
if ( bestdiff == 0 )
break ;
}
}
return bestpos;
@@ -100,11 +100,11 @@ int wxPalette::GetPixel(const unsigned char red, const unsigned char green, cons
bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const
{
if ( !m_refData )
return FALSE;
return FALSE;
if (index < 0 || index >= M_PALETTEDATA->m_count)
return FALSE;
const wxColour& col = &M_PALETTEDATA->m_palette[index] ;
*red = col.Red() ;
*green = col.Green() ;
@@ -114,5 +114,5 @@ bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsi
}
#endif
// wxUSE_PALETTE
// wxUSE_PALETTE