'[1219035] cleanup: miscellaneous' and minor source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-06-13 12:19:33 +00:00
parent 490120b404
commit d0ee33f5c6
31 changed files with 598 additions and 597 deletions

View File

@@ -215,13 +215,13 @@ public:
// shifts // shifts
// left shift // left shift
wxLongLongNative operator<<(int shift) const wxLongLongNative operator<<(int shift) const
{ return wxLongLongNative(m_ll << shift);; } { return wxLongLongNative(m_ll << shift); }
wxLongLongNative& operator<<=(int shift) wxLongLongNative& operator<<=(int shift)
{ m_ll <<= shift; return *this; } { m_ll <<= shift; return *this; }
// right shift // right shift
wxLongLongNative operator>>(int shift) const wxLongLongNative operator>>(int shift) const
{ return wxLongLongNative(m_ll >> shift);; } { return wxLongLongNative(m_ll >> shift); }
wxLongLongNative& operator>>=(int shift) wxLongLongNative& operator>>=(int shift)
{ m_ll >>= shift; return *this; } { m_ll >>= shift; return *this; }
@@ -402,13 +402,13 @@ public:
// shifts // shifts
// left shift // left shift
wxULongLongNative operator<<(int shift) const wxULongLongNative operator<<(int shift) const
{ return wxULongLongNative(m_ll << shift);; } { return wxULongLongNative(m_ll << shift); }
wxULongLongNative& operator<<=(int shift) wxULongLongNative& operator<<=(int shift)
{ m_ll <<= shift; return *this; } { m_ll <<= shift; return *this; }
// right shift // right shift
wxULongLongNative operator>>(int shift) const wxULongLongNative operator>>(int shift) const
{ return wxULongLongNative(m_ll >> shift);; } { return wxULongLongNative(m_ll >> shift); }
wxULongLongNative& operator>>=(int shift) wxULongLongNative& operator>>=(int shift)
{ m_ll >>= shift; return *this; } { m_ll >>= shift; return *this; }

View File

@@ -376,8 +376,8 @@ private:
#define wxPREVIEW_LAST 32 #define wxPREVIEW_LAST 32
#define wxPREVIEW_GOTO 64 #define wxPREVIEW_GOTO 64
#define wxPREVIEW_DEFAULT wxPREVIEW_PREVIOUS|wxPREVIEW_NEXT|wxPREVIEW_ZOOM\ #define wxPREVIEW_DEFAULT (wxPREVIEW_PREVIOUS|wxPREVIEW_NEXT|wxPREVIEW_ZOOM\
|wxPREVIEW_FIRST|wxPREVIEW_GOTO|wxPREVIEW_LAST |wxPREVIEW_FIRST|wxPREVIEW_GOTO|wxPREVIEW_LAST)
// Ids for controls // Ids for controls
#define wxID_PREVIEW_CLOSE 1 #define wxID_PREVIEW_CLOSE 1

View File

@@ -139,7 +139,7 @@ name::~name() \
// define the scoped pointer at the same time and want to use the standard // define the scoped pointer at the same time and want to use the standard
// naming convention: auto pointer to Foo is called FooPtr // naming convention: auto pointer to Foo is called FooPtr
#define wxDEFINE_SCOPED_PTR_TYPE(T) \ #define wxDEFINE_SCOPED_PTR_TYPE(T) \
wxDECLARE_SCOPED_PTR(T, T ## Ptr); \ wxDECLARE_SCOPED_PTR(T, T ## Ptr) \
wxDEFINE_SCOPED_PTR(T, T ## Ptr) wxDEFINE_SCOPED_PTR(T, T ## Ptr)
// the same but for arrays instead of simple pointers // the same but for arrays instead of simple pointers

View File

@@ -713,7 +713,7 @@ typedef wxPixelData<wxBitmap, wxAlphaPixelFormat> wxAlphaPixelData;
partial template specialization then and neither VC6 nor VC7 provide it. partial template specialization then and neither VC6 nor VC7 provide it.
*/ */
template < class Image, class PixelFormat = wxPixelFormatFor<Image> > template < class Image, class PixelFormat = wxPixelFormatFor<Image> >
struct wxPixelIterator : wxPixelData<Image, PixelFormat>::Iterator struct wxPixelIterator : public wxPixelData<Image, PixelFormat>::Iterator
{ {
}; };

View File

@@ -175,7 +175,8 @@ enum wxTextAttrAlignment
#define wxTEXT_ATTR_FONT_ITALIC 0x0020 #define wxTEXT_ATTR_FONT_ITALIC 0x0020
#define wxTEXT_ATTR_FONT_UNDERLINE 0x0040 #define wxTEXT_ATTR_FONT_UNDERLINE 0x0040
#define wxTEXT_ATTR_FONT \ #define wxTEXT_ATTR_FONT \
wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE ( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \
wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE )
#define wxTEXT_ATTR_ALIGNMENT 0x0080 #define wxTEXT_ATTR_ALIGNMENT 0x0080
#define wxTEXT_ATTR_LEFT_INDENT 0x0100 #define wxTEXT_ATTR_LEFT_INDENT 0x0100
#define wxTEXT_ATTR_RIGHT_INDENT 0x0200 #define wxTEXT_ATTR_RIGHT_INDENT 0x0200

View File

@@ -42,9 +42,9 @@
wxMAKE_VERSION_DOT_STRING(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) wxMAKE_VERSION_DOT_STRING(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
/* some more defines, not really sure if they're [still] useful */ /* some more defines, not really sure if they're [still] useful */
#define wxVERSION_NUMBER (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER #define wxVERSION_NUMBER ( (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER )
#define wxBETA_NUMBER 0 #define wxBETA_NUMBER 0
#define wxVERSION_FLOAT wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0) #define wxVERSION_FLOAT ( wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0) )
/* check if the current version is at least major.minor.release */ /* check if the current version is at least major.minor.release */
#define wxCHECK_VERSION(major,minor,release) \ #define wxCHECK_VERSION(major,minor,release) \
@@ -54,11 +54,11 @@
/* the same but check the subrelease also */ /* the same but check the subrelease also */
#define wxCHECK_VERSION_FULL(major,minor,release,subrel) \ #define wxCHECK_VERSION_FULL(major,minor,release,subrel) \
wxCHECK_VERSION(major, minor, release) && \ (wxCHECK_VERSION(major, minor, release) && \
((major) != wxMAJOR_VERSION || \ ((major) != wxMAJOR_VERSION || \
(minor) != wxMINOR_VERSION || \ (minor) != wxMINOR_VERSION || \
(release) != wxRELEASE_NUMBER || \ (release) != wxRELEASE_NUMBER || \
(subrel) <= wxSUBRELEASE_NUMBER) (subrel) <= wxSUBRELEASE_NUMBER))
#endif /* _WX_VERSION_H_ */ #endif /* _WX_VERSION_H_ */

View File

@@ -216,7 +216,7 @@ public:
cmap[i] = (unsigned char)i; cmap[i] = (unsigned char)i;
image.SetPalette(wxPalette(256, cmap, cmap, cmap)); image.SetPalette(wxPalette(256, cmap, cmap, cmap));
delete cmap; delete[] cmap;
} }
} }
} }

View File

@@ -584,7 +584,7 @@ wxPageSetupDialogData& wxPageSetupDialogData::operator=(const wxPageSetupDialogD
m_enableOrientation = data.m_enableOrientation; m_enableOrientation = data.m_enableOrientation;
m_enablePaper = data.m_enablePaper; m_enablePaper = data.m_enablePaper;
m_enablePrinter = data.m_enablePrinter; m_enablePrinter = data.m_enablePrinter;
m_getDefaultInfo = data.m_getDefaultInfo;; m_getDefaultInfo = data.m_getDefaultInfo;
m_enableHelp = data.m_enableHelp; m_enableHelp = data.m_enableHelp;
m_printData = data.m_printData; m_printData = data.m_printData;

View File

@@ -70,8 +70,8 @@ public:
// we need a special kind of auto pointer to wxApp which not only deletes the // we need a special kind of auto pointer to wxApp which not only deletes the
// pointer it holds in its dtor but also resets the global application pointer // pointer it holds in its dtor but also resets the global application pointer
wxDECLARE_SCOPED_PTR(wxAppConsole, wxAppPtrBase); wxDECLARE_SCOPED_PTR(wxAppConsole, wxAppPtrBase)
wxDEFINE_SCOPED_PTR(wxAppConsole, wxAppPtrBase); wxDEFINE_SCOPED_PTR(wxAppConsole, wxAppPtrBase)
class wxAppPtr : public wxAppPtrBase class wxAppPtr : public wxAppPtrBase
{ {

View File

@@ -77,7 +77,7 @@ void wxTransformMatrix::operator = (const wxTransformMatrix& mat)
bool wxTransformMatrix::operator == (const wxTransformMatrix& mat) bool wxTransformMatrix::operator == (const wxTransformMatrix& mat)
{ {
if (m_isIdentity==true && mat.m_isIdentity==true) if (m_isIdentity && mat.m_isIdentity)
return true; return true;
int i, j; int i, j;

View File

@@ -42,8 +42,8 @@
// wxRendererPtr: auto pointer holding the global renderer // wxRendererPtr: auto pointer holding the global renderer
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxDECLARE_SCOPED_PTR(wxRendererNative, wxRendererPtrBase); wxDECLARE_SCOPED_PTR(wxRendererNative, wxRendererPtrBase)
wxDEFINE_SCOPED_PTR(wxRendererNative, wxRendererPtrBase); wxDEFINE_SCOPED_PTR(wxRendererNative, wxRendererPtrBase)
class wxRendererPtr : public wxRendererPtrBase class wxRendererPtr : public wxRendererPtrBase
{ {

View File

@@ -90,7 +90,7 @@ bool wxIsStockID(wxWindowID id)
default: default:
return false; return false;
}; }
} }
wxString wxGetStockLabel(wxWindowID id, bool withCodes, wxString accelerator) wxString wxGetStockLabel(wxWindowID id, bool withCodes, wxString accelerator)

View File

@@ -2513,7 +2513,7 @@ wxMBConv *wxCSConv::DoCreate() const
#if wxUSE_FONTMAP #if wxUSE_FONTMAP
if ( name.empty() ) if ( name.empty() )
name = wxFontMapperBase::Get()->GetEncodingName(m_encoding); name = wxFontMapperBase::GetEncodingName(m_encoding);
#endif // wxUSE_FONTMAP #endif // wxUSE_FONTMAP
wxMBConv_iconv *conv = new wxMBConv_iconv(name); wxMBConv_iconv *conv = new wxMBConv_iconv(name);

View File

@@ -474,7 +474,7 @@ wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight,
if (!pixval) if (!pixval)
{ {
char bit=1; char bit=1;
char shift = bit << w % 8; char shift = bit << (w % 8);
outbyte |= shift; outbyte |= shift;
} }
@@ -537,7 +537,7 @@ wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight,
if (pixval) if (pixval)
{ {
char bit=1; char bit=1;
char shift = bit << w % 8; char shift = bit << (w % 8);
outbyte |= shift; outbyte |= shift;
} }

View File

@@ -77,7 +77,7 @@ int wxColourDialog::ShowModal()
case GTK_RESPONSE_OK: case GTK_RESPONSE_OK:
DialogToColourData(); DialogToColourData();
return wxID_OK; return wxID_OK;
}; }
} }
void wxColourDialog::ColourDataToDialog() void wxColourDialog::ColourDataToDialog()

View File

@@ -474,7 +474,7 @@ wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight,
if (!pixval) if (!pixval)
{ {
char bit=1; char bit=1;
char shift = bit << w % 8; char shift = bit << (w % 8);
outbyte |= shift; outbyte |= shift;
} }
@@ -537,7 +537,7 @@ wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight,
if (pixval) if (pixval)
{ {
char bit=1; char bit=1;
char shift = bit << w % 8; char shift = bit << (w % 8);
outbyte |= shift; outbyte |= shift;
} }

View File

@@ -77,7 +77,7 @@ int wxColourDialog::ShowModal()
case GTK_RESPONSE_OK: case GTK_RESPONSE_OK:
DialogToColourData(); DialogToColourData();
return wxID_OK; return wxID_OK;
}; }
} }
void wxColourDialog::ColourDataToDialog() void wxColourDialog::ColourDataToDialog()

View File

@@ -964,7 +964,7 @@ wxBitmap::wxBitmap(const wxImage& image, int depth)
int width = image.GetWidth(); int width = image.GetWidth();
int height = image.GetHeight(); int height = image.GetHeight();
m_refData = new wxBitmapRefData( width , height , depth ) ;; m_refData = new wxBitmapRefData( width , height , depth ) ;
// Create picture // Create picture

View File

@@ -486,7 +486,7 @@ wxVideoMode wxDisplay::GetCurrentMode() const
err = DMGetIndexedDisplayModeFromList(pModes, i, NULL, uppMLI, &sModeInfo); err = DMGetIndexedDisplayModeFromList(pModes, i, NULL, uppMLI, &sModeInfo);
wxASSERT(err == noErr); wxASSERT(err == noErr);
if ( sModeInfo.bMatched == true ) if ( sModeInfo.bMatched )
{ {
RetMode = sModeInfo.Mode; RetMode = sModeInfo.Mode;
break; break;
@@ -570,7 +570,7 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode)
err = DMGetIndexedDisplayModeFromList(pModes, i, NULL, uppMLI, &sModeInfo); err = DMGetIndexedDisplayModeFromList(pModes, i, NULL, uppMLI, &sModeInfo);
wxASSERT(err == noErr); wxASSERT(err == noErr);
if (sModeInfo.bMatched == true) if (sModeInfo.bMatched)
{ {
sMode = sModeInfo.sMode; sMode = sModeInfo.sMode;
break; break;

View File

@@ -127,7 +127,7 @@ public:
bool m_bVideo; //Whether or not we have video bool m_bVideo; //Whether or not we have video
class _wxQTTimer* m_timer; //Timer for streaming the movie class _wxQTTimer* m_timer; //Timer for streaming the movie
DECLARE_DYNAMIC_CLASS(wxQTMediaBackend); DECLARE_DYNAMIC_CLASS(wxQTMediaBackend)
}; };
@@ -262,11 +262,11 @@ bool wxQTMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent,
#if wxUSE_CREATEMOVIECONTROL #if wxUSE_CREATEMOVIECONTROL
ctrl->wxWindow::Create(parent, id, pos, size, ctrl->wxWindow::Create(parent, id, pos, size,
m_ctrl->MacRemoveBordersFromStyle(style), wxWindow::MacRemoveBordersFromStyle(style),
name) name)
#else #else
ctrl->wxControl::Create(parent, id, pos, size, ctrl->wxControl::Create(parent, id, pos, size,
m_ctrl->MacRemoveBordersFromStyle(style), wxWindow::MacRemoveBordersFromStyle(style),
validator, name) validator, name)
#endif #endif
) )
@@ -597,7 +597,7 @@ wxMediaState wxQTMediaBackend::GetState()
m_timer->GetPaused() == false) ) m_timer->GetPaused() == false) )
return wxMEDIASTATE_STOPPED; return wxMEDIASTATE_STOPPED;
if( m_timer->IsRunning() == true ) if( m_timer->IsRunning() )
return wxMEDIASTATE_PLAYING; return wxMEDIASTATE_PLAYING;
else else
return wxMEDIASTATE_PAUSED; return wxMEDIASTATE_PAUSED;

View File

@@ -906,7 +906,7 @@ public:
bool Exists(CFTypeRef cftKey) const bool Exists(CFTypeRef cftKey) const
{ {
wxASSERT(IsValid()); wxASSERT(IsValid());
return CFDictionaryContainsKey((CFDictionaryRef)m_cfmdRef, cftKey) == true; return CFDictionaryContainsKey((CFDictionaryRef)m_cfmdRef, cftKey);
} }
bool IsOk() const {return m_cfmdRef != NULL; } bool IsOk() const {return m_cfmdRef != NULL; }
@@ -1359,9 +1359,9 @@ void wxCFDictionary::MakeValidXML()
cfdCurrent.MakeValidXML(); cfdCurrent.MakeValidXML();
Set(pKeys[i], cfdCurrent); Set(pKeys[i], cfdCurrent);
} }
else if( ( CFGetTypeID(cfRef) == CFStringGetTypeID() || else if ( CFGetTypeID(cfRef) != CFStringGetTypeID() &&
CFGetTypeID(cfRef) == CFNumberGetTypeID() || CFGetTypeID(cfRef) != CFNumberGetTypeID() &&
CFGetTypeID(cfRef) == CFBooleanGetTypeID() ) == false ) CFGetTypeID(cfRef) != CFBooleanGetTypeID() )
{ {
Remove(pKeys[i]); Remove(pKeys[i]);
--i; --i;
@@ -1406,9 +1406,9 @@ void wxCFArray::MakeValidXML()
cfdCurrent.MakeValidXML(); cfdCurrent.MakeValidXML();
Set(i, cfdCurrent); Set(i, cfdCurrent);
} }
else if( ( CFGetTypeID(cfRef) == CFStringGetTypeID() || else if ( CFGetTypeID(cfRef) != CFStringGetTypeID() &&
CFGetTypeID(cfRef) == CFNumberGetTypeID() || CFGetTypeID(cfRef) != CFNumberGetTypeID() &&
CFGetTypeID(cfRef) == CFBooleanGetTypeID() ) == false ) CFGetTypeID(cfRef) != CFBooleanGetTypeID() )
{ {
Remove(i); Remove(i);
--i; --i;

View File

@@ -32,7 +32,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler)
#if wxMAC_USE_CARBON_TIMER #if wxMAC_USE_CARBON_TIMER
typedef struct MacTimerInfo struct MacTimerInfo
{ {
wxTimer* m_timer ; wxTimer* m_timer ;
EventLoopTimerUPP m_proc ; EventLoopTimerUPP m_proc ;
@@ -79,8 +79,8 @@ bool wxTimer::Start(int milliseconds,bool mode)
{ {
(void)wxTimerBase::Start(milliseconds, mode); (void)wxTimerBase::Start(milliseconds, mode);
wxCHECK_MSG( m_milli > 0, FALSE, wxT("invalid value for timer timeout") ); wxCHECK_MSG( m_milli > 0, false, wxT("invalid value for timer timeout") );
wxCHECK_MSG( m_info->m_timerRef == NULL , FALSE, wxT("attempting to restart a timer") ); wxCHECK_MSG( m_info->m_timerRef == NULL , false, wxT("attempting to restart a timer") );
m_info->m_timer = this ; m_info->m_timer = this ;
m_info->m_proc = NewEventLoopTimerUPP( &wxProcessTimer); m_info->m_proc = NewEventLoopTimerUPP( &wxProcessTimer);
@@ -91,7 +91,7 @@ bool wxTimer::Start(int milliseconds,bool mode)
m_info->m_proc, m_info->m_proc,
this, this,
&m_info->m_timerRef) ) ; &m_info->m_timerRef) ) ;
return TRUE; return true;
} }
void wxTimer::Stop() void wxTimer::Stop()
@@ -189,8 +189,8 @@ bool wxTimer::Start(int milliseconds,bool mode)
{ {
(void)wxTimerBase::Start(milliseconds, mode); (void)wxTimerBase::Start(milliseconds, mode);
wxCHECK_MSG( m_milli > 0, FALSE, wxT("invalid value for timer timeout") ); wxCHECK_MSG( m_milli > 0, false, wxT("invalid value for timer timeout") );
wxCHECK_MSG( m_info->m_task.tmAddr == NULL , FALSE, wxT("attempting to restart a timer") ); wxCHECK_MSG( m_info->m_task.tmAddr == NULL , false, wxT("attempting to restart a timer") );
m_info->m_task.tmAddr = NewTimerUPP( MacTimerProc ) ; m_info->m_task.tmAddr = NewTimerUPP( MacTimerProc ) ;
m_info->m_task.tmWakeUp = 0 ; m_info->m_task.tmWakeUp = 0 ;
@@ -199,7 +199,7 @@ bool wxTimer::Start(int milliseconds,bool mode)
m_info->m_timer = this ; m_info->m_timer = this ;
InsXTime((QElemPtr) &m_info->m_task ) ; InsXTime((QElemPtr) &m_info->m_task ) ;
PrimeTime( (QElemPtr) &m_info->m_task , m_milli ) ; PrimeTime( (QElemPtr) &m_info->m_task , m_milli ) ;
return TRUE; return true;
} }
void wxTimer::Stop() void wxTimer::Stop()

View File

@@ -115,9 +115,9 @@ void wxFrame::Init()
//// Motif-specific //// Motif-specific
m_frameShell = (WXWidget) NULL; m_frameShell = (WXWidget) NULL;
m_mainWidget = (WXWidget) NULL;; m_mainWidget = (WXWidget) NULL;
m_workArea = (WXWidget) NULL;; m_workArea = (WXWidget) NULL;
m_clientArea = (WXWidget) NULL;; m_clientArea = (WXWidget) NULL;
} }
bool wxFrame::Create(wxWindow *parent, bool wxFrame::Create(wxWindow *parent,

View File

@@ -905,7 +905,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
SetMask(new wxMask((WXHBITMAP)hbitmap)); SetMask(new wxMask((WXHBITMAP)hbitmap));
} }
delete data; delete[] data;
} }
return true; return true;
@@ -1250,7 +1250,7 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
HBITMAP hDIB; HBITMAP hDIB;
if ( !GetBitmapData()->m_isDIB ) if ( !GetBitmapData()->m_isDIB )
{ {
wxCHECK_MSG( !GetBitmapData()->m_dib, FALSE, wxCHECK_MSG( !GetBitmapData()->m_dib, NULL,
_T("GetRawData() may be called only once") ); _T("GetRawData() may be called only once") );
wxDIB *dib = new wxDIB(*this); wxDIB *dib = new wxDIB(*this);
@@ -1599,7 +1599,7 @@ bool wxCreateDIB(long xSize, long ySize, long bitsPerPixel,
// this value must be 1, 4, 8 or 24 so PixelDepth can only be // this value must be 1, 4, 8 or 24 so PixelDepth can only be
lpDIBheader->bmiHeader.biBitCount = (WORD)(bitsPerPixel); lpDIBheader->bmiHeader.biBitCount = (WORD)(bitsPerPixel);
lpDIBheader->bmiHeader.biCompression = BI_RGB; lpDIBheader->bmiHeader.biCompression = BI_RGB;
lpDIBheader->bmiHeader.biSizeImage = xSize * abs(ySize) * bitsPerPixel >> 3; lpDIBheader->bmiHeader.biSizeImage = (xSize * abs(ySize) * bitsPerPixel) >> 3;
lpDIBheader->bmiHeader.biClrUsed = 256; lpDIBheader->bmiHeader.biClrUsed = 256;

View File

@@ -1420,7 +1420,7 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address,
CHECK_ADDRESS(address, INET); CHECK_ADDRESS(address, INET);
addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr); addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr);
addr->s_addr = htonl(hostaddr);; addr->s_addr = htonl(hostaddr);
return GSOCK_NOERROR; return GSOCK_NOERROR;
} }

View File

@@ -603,7 +603,7 @@ int wxWindowsPrintDialog::ShowModal()
pd->hwndOwner = 0; pd->hwndOwner = 0;
if ( ret != false && (pd->hDC) ) if ( ret && (pd->hDC) )
{ {
wxPrinterDC *pdc = new wxPrinterDC( (WXHDC) pd->hDC ); wxPrinterDC *pdc = new wxPrinterDC( (WXHDC) pd->hDC );
m_printerDC = pdc; m_printerDC = pdc;

View File

@@ -88,7 +88,7 @@ void wxBitmapRefData::Free()
// this function should be called from all wxBitmap ctors // this function should be called from all wxBitmap ctors
void wxBitmap::Init() void wxBitmap::Init()
{ {
m_bIsMono = FALSE; m_bIsMono = false;
// //
// True for all bitmaps created from bits, wxImages, Xpms // True for all bitmaps created from bits, wxImages, Xpms
// //
@@ -104,7 +104,7 @@ bool wxBitmap::CopyFromIconOrCursor(
if (!::WinQueryPointerInfo(hIcon, &SIconInfo)) if (!::WinQueryPointerInfo(hIcon, &SIconInfo))
{ {
wxLogLastError(wxT("WinQueryPointerInfo")); wxLogLastError(wxT("WinQueryPointerInfo"));
return FALSE; return false;
} }
wxBitmapRefData* pRefData = new wxBitmapRefData; wxBitmapRefData* pRefData = new wxBitmapRefData;
@@ -124,7 +124,7 @@ bool wxBitmap::CopyFromIconOrCursor(
pMask->SetMaskBitmap(GetHBITMAP()); pMask->SetMaskBitmap(GetHBITMAP());
SetMask(pMask); SetMask(pMask);
return(TRUE); return true;
} // end of wxBitmap::CopyFromIconOrCursor } // end of wxBitmap::CopyFromIconOrCursor
bool wxBitmap::CopyFromCursor( bool wxBitmap::CopyFromCursor(
@@ -134,7 +134,7 @@ bool wxBitmap::CopyFromCursor(
UnRef(); UnRef();
if (!rCursor.Ok()) if (!rCursor.Ok())
return(FALSE); return(false);
return(CopyFromIconOrCursor(rCursor)); return(CopyFromIconOrCursor(rCursor));
} // end of wxBitmap::CopyFromCursor } // end of wxBitmap::CopyFromCursor
@@ -145,7 +145,7 @@ bool wxBitmap::CopyFromIcon(
UnRef(); UnRef();
if (!rIcon.Ok()) if (!rIcon.Ok())
return(FALSE); return(false);
return CopyFromIconOrCursor(rIcon); return CopyFromIconOrCursor(rIcon);
} // end of wxBitmap::CopyFromIcon } // end of wxBitmap::CopyFromIcon
@@ -334,7 +334,7 @@ bool wxBitmap::Create(
HPS hPS = ::GpiCreatePS(vHabmain, hDC, &vSize, PU_PELS | GPIA_ASSOC); HPS hPS = ::GpiCreatePS(vHabmain, hDC, &vSize, PU_PELS | GPIA_ASSOC);
if (nD == 1) if (nD == 1)
m_bIsMono = TRUE; m_bIsMono = true;
memset(&vHeader, '\0', 16); memset(&vHeader, '\0', 16);
vHeader.cbFix = 16; vHeader.cbFix = 16;
vHeader.cx = nW; vHeader.cx = nW;
@@ -393,17 +393,17 @@ bool wxBitmap::CreateFromXpm(
#if wxUSE_IMAGE && wxUSE_XPM #if wxUSE_IMAGE && wxUSE_XPM
Init(); Init();
wxCHECK_MSG(ppData != NULL, FALSE, wxT("invalid bitmap data")) wxCHECK_MSG(ppData != NULL, false, wxT("invalid bitmap data"))
wxXPMDecoder vDecoder; wxXPMDecoder vDecoder;
wxImage vImg = vDecoder.ReadData(ppData); wxImage vImg = vDecoder.ReadData(ppData);
wxCHECK_MSG(vImg.Ok(), FALSE, wxT("invalid bitmap data")) wxCHECK_MSG(vImg.Ok(), false, wxT("invalid bitmap data"))
*this = wxBitmap(vImg); *this = wxBitmap(vImg);
return TRUE; return true;
#else #else
return FALSE; return false;
#endif #endif
} // end of wxBitmap::CreateFromXpm } // end of wxBitmap::CreateFromXpm
@@ -431,7 +431,7 @@ bool wxBitmap::LoadFile(
} }
else else
{ {
return(FALSE); return false;
} }
} // end of wxBitmap::LoadFile } // end of wxBitmap::LoadFile
@@ -453,7 +453,7 @@ bool wxBitmap::Create(
{ {
wxLogDebug(wxT("Failed to create bitmap: no bitmap handler for type %ld defined."), lType); wxLogDebug(wxT("Failed to create bitmap: no bitmap handler for type %ld defined."), lType);
return(FALSE); return false;
} }
m_refData = new wxBitmapRefData; m_refData = new wxBitmapRefData;
@@ -491,7 +491,7 @@ bool wxBitmap::SaveFile(
wxImage vImage = ConvertToImage(); wxImage vImage = ConvertToImage();
if (!vImage.Ok()) if (!vImage.Ok())
return(FALSE); return false;
return(vImage.SaveFile( rFilename return(vImage.SaveFile( rFilename
,lType ,lType
@@ -509,7 +509,7 @@ bool wxBitmap::CreateFromImage (
, int nDepth , int nDepth
) )
{ {
wxCHECK_MSG(rImage.Ok(), FALSE, wxT("invalid image")); wxCHECK_MSG(rImage.Ok(), false, wxT("invalid image"));
m_refData = new wxBitmapRefData(); m_refData = new wxBitmapRefData();
int nSizeLimit = 1024 * 768 * 3; int nSizeLimit = 1024 * 768 * 3;
@@ -546,13 +546,13 @@ bool wxBitmap::CreateFromImage (
// //
// Set bitmap parameters // Set bitmap parameters
// //
wxCHECK_MSG(rImage.Ok(), FALSE, wxT("invalid image")); wxCHECK_MSG(rImage.Ok(), false, wxT("invalid image"));
SetWidth(nWidth); SetWidth(nWidth);
SetHeight(nBmpHeight); SetHeight(nBmpHeight);
if (nDepth == 1) if (nDepth == 1)
m_bIsMono = TRUE; m_bIsMono = true;
else else
m_bIsMono = FALSE; m_bIsMono = false;
if (nDepth == -1) if (nDepth == -1)
nDepth = wxDisplayDepth(); nDepth = wxDisplayDepth();
SetDepth(nDepth); SetDepth(nDepth);
@@ -589,7 +589,7 @@ bool wxBitmap::CreateFromImage (
if(!pucBits) if(!pucBits)
{ {
wxFAIL_MSG(wxT("could not allocate memory for DIB")); wxFAIL_MSG(wxT("could not allocate memory for DIB"));
return FALSE; return false;
} }
memset(pucBits, '\0', (nBytePerLine * nHeight)); memset(pucBits, '\0', (nBytePerLine * nHeight));
@@ -829,7 +829,7 @@ bool wxBitmap::CreateFromImage (
::DevCloseDC(hDCScreen); ::DevCloseDC(hDCScreen);
::DevCloseDC(hDC); ::DevCloseDC(hDC);
free(pucBits); free(pucBits);
return TRUE; return true;
} // end of wxBitmap::CreateFromImage } // end of wxBitmap::CreateFromImage
wxImage wxBitmap::ConvertToImage() const wxImage wxBitmap::ConvertToImage() const
@@ -860,7 +860,7 @@ wxImage wxBitmap::ConvertToImage() const
HBITMAP hOldBitmap; HBITMAP hOldBitmap;
DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L}; DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
SIZEL vSizlPage = {0,0}; SIZEL vSizlPage = {0,0};
HDC hDCMem = NULLHANDLE;; HDC hDCMem = NULLHANDLE;
vImage.Create( nWidth vImage.Create( nWidth
,nHeight ,nHeight
@@ -1044,11 +1044,11 @@ wxImage wxBitmap::ConvertToImage() const
,ucGreen ,ucGreen
,ucBlue ,ucBlue
); );
vImage.SetMask(TRUE); vImage.SetMask(true);
} }
else else
{ {
vImage.SetMask(FALSE); vImage.SetMask(false);
} }
// //
@@ -1261,7 +1261,7 @@ bool wxMask::Create(
} }
if (!rBitmap.Ok() || rBitmap.GetDepth() != 1) if (!rBitmap.Ok() || rBitmap.GetDepth() != 1)
{ {
return(FALSE); return false;
} }
memset(&vBmih, '\0', sizeof(BITMAPINFOHEADER2)); memset(&vBmih, '\0', sizeof(BITMAPINFOHEADER2));
@@ -1292,7 +1292,7 @@ bool wxMask::Create(
::GpiDestroyPS(hPSDst); ::GpiDestroyPS(hPSDst);
::DevCloseDC(hDCSrc); ::DevCloseDC(hDCSrc);
::DevCloseDC(hDCDst); ::DevCloseDC(hDCDst);
return(TRUE); return true;
} // end of wxMask::Create } // end of wxMask::Create
// Create a mask from a bitmap and a palette index indicating // Create a mask from a bitmap and a palette index indicating
@@ -1329,7 +1329,7 @@ bool wxMask::Create(
)); ));
} }
} }
return(FALSE); return false;
} // end of wxMask::Create } // end of wxMask::Create
// Create a mask from a bitmap and a colour indicating // Create a mask from a bitmap and a colour indicating
@@ -1339,7 +1339,7 @@ bool wxMask::Create(
, const wxColour& rColour , const wxColour& rColour
) )
{ {
bool bOk = TRUE; bool bOk = true;
COLORREF vMaskColour = OS2RGB( rColour.Red() COLORREF vMaskColour = OS2RGB( rColour.Red()
,rColour.Green() ,rColour.Green()
,rColour.Blue() ,rColour.Blue()
@@ -1359,7 +1359,7 @@ bool wxMask::Create(
} }
if (!rBitmap.Ok()) if (!rBitmap.Ok())
{ {
return(FALSE); return false;
} }
// //
@@ -1400,7 +1400,7 @@ bool wxMask::Create(
// //
// Doesn't make sense to continue // Doesn't make sense to continue
// //
bOk = FALSE; bOk = false;
break; break;
} }
@@ -1422,7 +1422,7 @@ bool wxMask::Create(
::GpiDestroyPS(hPSDst); ::GpiDestroyPS(hPSDst);
::DevCloseDC(hDCSrc); ::DevCloseDC(hDCSrc);
::DevCloseDC(hDCDst); ::DevCloseDC(hDCDst);
return(TRUE); return true;
} // end of wxMask::Create } // end of wxMask::Create
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1447,7 +1447,7 @@ bool wxBitmapHandler::Create(
,nWidth ,nWidth
,nHeight ,nHeight
,nDepth ,nDepth
) : FALSE); ) : false);
} }
bool wxBitmapHandler::Load( bool wxBitmapHandler::Load(
@@ -1467,7 +1467,7 @@ bool wxBitmapHandler::Load(
,lFlags ,lFlags
,nWidth ,nWidth
,nHeight ,nHeight
) : FALSE); ) : false);
} }
bool wxBitmapHandler::Save( bool wxBitmapHandler::Save(
@@ -1483,7 +1483,7 @@ bool wxBitmapHandler::Save(
return(pBitmap ? SaveFile( pBitmap return(pBitmap ? SaveFile( pBitmap
,rName ,rName
,lType ,lType
) : FALSE); ) : false);
} }
bool wxBitmapHandler::Create( bool wxBitmapHandler::Create(
@@ -1495,7 +1495,7 @@ bool wxBitmapHandler::Create(
, int WXUNUSED(nDepth) , int WXUNUSED(nDepth)
) )
{ {
return(FALSE); return false;
} }
bool wxBitmapHandler::LoadFile( bool wxBitmapHandler::LoadFile(
@@ -1506,7 +1506,7 @@ bool wxBitmapHandler::LoadFile(
, int WXUNUSED(nDesiredHeight) , int WXUNUSED(nDesiredHeight)
) )
{ {
return(FALSE); return false;
} }
bool wxBitmapHandler::SaveFile( bool wxBitmapHandler::SaveFile(
@@ -1516,7 +1516,7 @@ bool wxBitmapHandler::SaveFile(
, const wxPalette* WXUNUSED(pPalette) , const wxPalette* WXUNUSED(pPalette)
) )
{ {
return(FALSE); return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -1294,7 +1294,7 @@ void wxDC::DoDrawBitmap(
if (!IsKindOf(CLASSINFO(wxPrinterDC))) if (!IsKindOf(CLASSINFO(wxPrinterDC)))
{ {
HBITMAP hBitmap = (HBITMAP)rBmp.GetHBITMAP(); HBITMAP hBitmap = (HBITMAP)rBmp.GetHBITMAP();
HBITMAP hBitmapOld = NULLHANDLE;; HBITMAP hBitmapOld = NULLHANDLE;
POINTL vPoint[4]; POINTL vPoint[4];
vY = OS2Y(vY,rBmp.GetHeight()); vY = OS2Y(vY,rBmp.GetHeight());

View File

@@ -120,7 +120,7 @@ bool CIDropTarget::DragLeave()
// Release the held object // Release the held object
// //
Free(); Free();
return TRUE; return true;
} // end of CIDropTarget::DragLeave } // end of CIDropTarget::DragLeave
MRESULT CIDropTarget::DragOver () MRESULT CIDropTarget::DragOver ()
@@ -250,7 +250,7 @@ MRESULT CIDropTarget::Drop ()
,m_pDragInfo->yDrop ,m_pDragInfo->yDrop
)) ))
{ {
wxDragResult eRc = wxDragNone;; wxDragResult eRc = wxDragNone;
// //
// And now it has the data // And now it has the data
@@ -260,7 +260,7 @@ MRESULT CIDropTarget::Drop ()
,eRc ,eRc
); );
} }
//else: OnDrop() returned FALSE, no need to copy data //else: OnDrop() returned false, no need to copy data
// //
// Release the held object // Release the held object
@@ -292,12 +292,12 @@ bool wxDropTarget::GetData ()
if (vFormat == wxDF_INVALID) if (vFormat == wxDF_INVALID)
{ {
return FALSE; return false;
} }
// //
// Under OS/2 we already have the data via the attached DRAGITEM's // Under OS/2 we already have the data via the attached DRAGITEM's
// //
return TRUE; return true;
} // end of wxDropTarget::GetData } // end of wxDropTarget::GetData
wxDataFormat wxDropTarget::GetSupportedFormat ( wxDataFormat wxDropTarget::GetSupportedFormat (
@@ -313,7 +313,7 @@ wxDataFormat wxDropTarget::GetSupportedFormat (
ULONG n; ULONG n;
wxString sMechanism; wxString sMechanism;
wxString sFormat; wxString sFormat;
bool bValid = FALSE; bool bValid = false;
pFormats = ulFormats == 1 ? &vFormat : new wxDataFormat[ulFormats]; pFormats = ulFormats == 1 ? &vFormat : new wxDataFormat[ulFormats];
m_dataObject->GetAllFormats( pFormats m_dataObject->GetAllFormats( pFormats
@@ -387,7 +387,7 @@ wxDataFormat wxDropTarget::GetSupportedFormat (
pDragItem = ::DrgQueryDragitemPtr(pDataSource, i); pDragItem = ::DrgQueryDragitemPtr(pDataSource, i);
if (::DrgVerifyRMF(pDragItem, (PSZ)sMechanism.c_str(), (PSZ)sFormat.c_str())) if (::DrgVerifyRMF(pDragItem, (PSZ)sMechanism.c_str(), (PSZ)sFormat.c_str()))
{ {
bValid = TRUE; bValid = true;
break; break;
} }
} }
@@ -434,7 +434,7 @@ bool wxDropTarget::OnDrop (
, wxCoord WXUNUSED(y) , wxCoord WXUNUSED(y)
) )
{ {
return TRUE; return true;
} // end of wxDropTarget::OnDrop } // end of wxDropTarget::OnDrop
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@@ -525,11 +525,11 @@ bool wxDropSource::GiveFeedback (
case wxDragError: case wxDragError:
break; break;
} }
return TRUE; return true;
} }
else else
{ {
return FALSE; return false;
} }
} // end of GuiAdvDnd_CDropSource::GiveFeedback } // end of GuiAdvDnd_CDropSource::GiveFeedback

View File

@@ -790,7 +790,7 @@ void wxRadioBox::GetPosition(
) const ) const
{ {
wxWindowOS2* pParent = GetParent(); wxWindowOS2* pParent = GetParent();
RECT vRect = { -1, -1, -1, -1 };; RECT vRect = { -1, -1, -1, -1 };
POINTL vPoint; POINTL vPoint;
int i; int i;

View File

@@ -103,7 +103,7 @@ public:
// add a new verb with the command or replace the old value // add a new verb with the command or replace the old value
void AddOrReplaceVerb(const wxString& verb, const wxString& cmd) void AddOrReplaceVerb(const wxString& verb, const wxString& cmd)
{ {
int n = m_verbs.Index(verb, FALSE /* ignore case */); int n = m_verbs.Index(verb, false /* ignore case */);
if ( n == wxNOT_FOUND ) if ( n == wxNOT_FOUND )
{ {
m_verbs.Add(verb); m_verbs.Add(verb);
@@ -165,7 +165,7 @@ public:
wxMimeTextFile () : wxTextFile () {}; wxMimeTextFile () : wxTextFile () {};
wxMimeTextFile (const wxString& strFile) : wxTextFile (strFile) { }; wxMimeTextFile (const wxString& strFile) : wxTextFile (strFile) { };
int pIndexOf(const wxString & sSearch, bool bIncludeComments = FALSE, int iStart = 0) int pIndexOf(const wxString & sSearch, bool bIncludeComments = false, int iStart = 0)
{ {
size_t i = iStart; size_t i = iStart;
int nResult = wxNOT_FOUND; int nResult = wxNOT_FOUND;
@@ -203,19 +203,19 @@ public:
bool CommentLine(int nIndex) bool CommentLine(int nIndex)
{ {
if (nIndex <0) return FALSE; if (nIndex <0) return false;
if (nIndex >= (int)GetLineCount() ) return FALSE; if (nIndex >= (int)GetLineCount() ) return false;
GetLine(nIndex) = GetLine(nIndex).Prepend(wxT("#")); GetLine(nIndex) = GetLine(nIndex).Prepend(wxT("#"));
return TRUE; return true;
} }
bool CommentLine(const wxString & sTest) bool CommentLine(const wxString & sTest)
{ {
int nIndex = pIndexOf(sTest); int nIndex = pIndexOf(sTest);
if (nIndex <0) return FALSE; if (nIndex <0) return false;
if (nIndex >= (int)GetLineCount() ) return FALSE; if (nIndex >= (int)GetLineCount() ) return false;
GetLine(nIndex) = GetLine(nIndex).Prepend(wxT("#")); GetLine(nIndex) = GetLine(nIndex).Prepend(wxT("#"));
return TRUE; return true;
} }
wxString GetVerb (size_t i) wxString GetVerb (size_t i)
@@ -368,7 +368,7 @@ bool wxMimeTypesManagerImpl::CheckGnomeDirsExist ()
if (!wxMkdir ( sTmp )) if (!wxMkdir ( sTmp ))
{ {
wxLogError(_("Failed to create directory %s/.gnome."), sTmp.c_str()); wxLogError(_("Failed to create directory %s/.gnome."), sTmp.c_str());
return FALSE; return false;
} }
} }
sTmp = sTmp + wxT("/mime-info"); sTmp = sTmp + wxT("/mime-info");
@@ -377,10 +377,10 @@ bool wxMimeTypesManagerImpl::CheckGnomeDirsExist ()
if (!wxMkdir ( sTmp )) if (!wxMkdir ( sTmp ))
{ {
wxLogError(_("Failed to create directory %s/mime-info."), sTmp.c_str()); wxLogError(_("Failed to create directory %s/mime-info."), sTmp.c_str());
return FALSE; return false;
} }
} }
return TRUE; return true;
} }
@@ -401,8 +401,8 @@ bool wxMimeTypesManagerImpl::WriteGnomeKeyFile(int index, bool delete_index)
if (! outfile.Open () ) if (! outfile.Open () )
#endif #endif
{ {
if (delete_index) return FALSE; if (delete_index) return false;
if (!CheckGnomeDirsExist() ) return FALSE; if (!CheckGnomeDirsExist() ) return false;
outfile.Create (); outfile.Create ();
} }
@@ -434,8 +434,8 @@ bool wxMimeTypesManagerImpl::WriteGnomeKeyFile(int index, bool delete_index)
wxMimeTypeCommands sOld; wxMimeTypeCommands sOld;
size_t nOld = nIndex + 1; size_t nOld = nIndex + 1;
bool oldEntryEnd = FALSE; bool oldEntryEnd = false;
while ( (nOld < outfile.GetLineCount() )&& (oldEntryEnd == FALSE )) while ( (nOld < outfile.GetLineCount() )&& (!oldEntryEnd))
{ {
sTmp = outfile.GetLine(nOld); sTmp = outfile.GetLine(nOld);
if ( (sTmp[0u] == wxT('\t')) || (sTmp[0u] == wxT('#')) ) if ( (sTmp[0u] == wxT('\t')) || (sTmp[0u] == wxT('#')) )
@@ -449,7 +449,7 @@ bool wxMimeTypesManagerImpl::WriteGnomeKeyFile(int index, bool delete_index)
} }
// next mimetpye ??or blank line // next mimetpye ??or blank line
else else
oldEntryEnd = TRUE; oldEntryEnd = true;
} }
// list of entries in our data; these should all be in sOld, // list of entries in our data; these should all be in sOld,
// though sOld may also contain other entries , eg flags // though sOld may also contain other entries , eg flags
@@ -491,8 +491,8 @@ bool wxMimeTypesManagerImpl::WriteGnomeMimeFile(int index, bool delete_index)
// create it anyway as a private mime store // create it anyway as a private mime store
if (! outfile.Open () ) if (! outfile.Open () )
{ {
if (delete_index) return FALSE; if (delete_index) return false;
if (!CheckGnomeDirsExist() ) return FALSE; if (!CheckGnomeDirsExist() ) return false;
outfile.Create (); outfile.Create ();
} }
wxString strType = m_aTypes[index]; wxString strType = m_aTypes[index];
@@ -603,7 +603,7 @@ void wxMimeTypesManagerImpl::LoadGnomeDataFromKeyFile(const wxString& filename,
// for now ignore lines with flags in...FIX // for now ignore lines with flags in...FIX
sTmp = sTmp.AfterLast(wxT(']')); sTmp = sTmp.AfterLast(wxT(']'));
sTmp = sTmp.AfterLast(wxT('\t')); sTmp = sTmp.AfterLast(wxT('\t'));
sTmp.Trim(FALSE).Trim(); sTmp.Trim(false).Trim();
if (0 == sTmp.Replace ( wxT("%f"), wxT("%s") )) sTmp = sTmp + wxT(" %s"); if (0 == sTmp.Replace ( wxT("%f"), wxT("%s") )) sTmp = sTmp + wxT(" %s");
entry->Add(sTmp); entry->Add(sTmp);
@@ -673,7 +673,7 @@ void wxMimeTypesManagerImpl::LoadGnomeMimeTypesFromMimeFile(const wxString& file
if ( !pc || !*pc ) if ( !pc || !*pc )
{ {
// end of the entry // end of the entry
if ( !!curMimeType && !!curExtList ) if ( !curMimeType.empty() && !curExtList.empty() )
{ {
wxLogTrace(TRACE_MIME, wxLogTrace(TRACE_MIME,
wxT("--- At end of Gnome file finding mimetype %s ---"), wxT("--- At end of Gnome file finding mimetype %s ---"),
@@ -731,7 +731,7 @@ void wxMimeTypesManagerImpl::LoadGnomeMimeTypesFromMimeFile(const wxString& file
void wxMimeTypesManagerImpl::LoadGnomeMimeFilesFromDir( void wxMimeTypesManagerImpl::LoadGnomeMimeFilesFromDir(
const wxString& dirbase, const wxArrayString& dirs) const wxString& dirbase, const wxArrayString& dirs)
{ {
wxASSERT_MSG( !!dirbase && !wxEndsWithPathSeparator(dirbase), wxASSERT_MSG( !dirbase.empty() && !wxEndsWithPathSeparator(dirbase),
_T("base directory shouldn't end with a slash") ); _T("base directory shouldn't end with a slash") );
wxString dirname = dirbase; wxString dirname = dirbase;
@@ -798,7 +798,7 @@ void wxMimeTypesManagerImpl::LoadGnomeMimeFilesFromDir(
wxString iconFile = dirname; wxString iconFile = dirname;
iconFile << wxT("/"); iconFile << wxT("/");
iconFile << filename; iconFile << filename;
AddToMimeData ( mimeType, iconFile, NULL, strExtensions, strDesc, TRUE ); AddToMimeData ( mimeType, iconFile, NULL, strExtensions, strDesc, true );
} }
cont = dir2.GetNext(&filename); cont = dir2.GetNext(&filename);
@@ -855,9 +855,9 @@ bool wxMimeTypesManagerImpl::CheckKDEDirsExist ( const wxString &sOK, const wxSt
if (sTest.empty()) if (sTest.empty())
{ {
if (wxDir::Exists(sOK)) if (wxDir::Exists(sOK))
return TRUE; return true;
else else
return FALSE; return false;
} }
else else
{ {
@@ -883,7 +883,7 @@ bool wxMimeTypesManagerImpl::WriteKDEMimeFile(int index, bool delete_index)
{ {
bTemp = mimeoutfile.Create (sTmp); bTemp = mimeoutfile.Create (sTmp);
// some unknown error eg out of disk space // some unknown error eg out of disk space
if (!bTemp) return FALSE; if (!bTemp) return false;
} }
sTmp = wxT(".kde/share/applnk/"); sTmp = wxT(".kde/share/applnk/");
@@ -896,7 +896,7 @@ bool wxMimeTypesManagerImpl::WriteKDEMimeFile(int index, bool delete_index)
{ {
bTemp = appoutfile.Create (sTmp); bTemp = appoutfile.Create (sTmp);
// some unknown error eg out of disk space // some unknown error eg out of disk space
if (!bTemp) return FALSE; if (!bTemp) return false;
} }
// fixed data; write if new file // fixed data; write if new file
@@ -965,10 +965,10 @@ bool wxMimeTypesManagerImpl::WriteKDEMimeFile(int index, bool delete_index)
//other actions as well as open //other actions as well as open
} }
bTemp = FALSE; bTemp = false;
if (mimeoutfile.Write ()) bTemp = TRUE; if (mimeoutfile.Write ()) bTemp = true;
mimeoutfile.Close (); mimeoutfile.Close ();
if (appoutfile.Write ()) bTemp = TRUE; if (appoutfile.Write ()) bTemp = true;
appoutfile.Close (); appoutfile.Close ();
return bTemp; return bTemp;
@@ -1028,7 +1028,7 @@ void wxMimeTypesManagerImpl::LoadKDELinksForMimeSubtype(const wxString& dirbase,
nIndex = file.pIndexOf(_T("Patterns=")); nIndex = file.pIndexOf(_T("Patterns="));
if ( nIndex != wxNOT_FOUND ) if ( nIndex != wxNOT_FOUND )
{ {
wxString exts = file.GetCmd (nIndex);; wxString exts = file.GetCmd (nIndex);
wxStringTokenizer tokenizer(exts, _T(";")); wxStringTokenizer tokenizer(exts, _T(";"));
while ( tokenizer.HasMoreTokens() ) while ( tokenizer.HasMoreTokens() )
@@ -1140,7 +1140,7 @@ void wxMimeTypesManagerImpl::LoadKDELinksForMimeType(const wxString& dirbase,
void wxMimeTypesManagerImpl::LoadKDELinkFilesFromDir(const wxString& dirbase, void wxMimeTypesManagerImpl::LoadKDELinkFilesFromDir(const wxString& dirbase,
const wxArrayString& icondirs) const wxArrayString& icondirs)
{ {
wxASSERT_MSG( !!dirbase && !wxEndsWithPathSeparator(dirbase), wxASSERT_MSG( !dirbase.empty() && !wxEndsWithPathSeparator(dirbase),
_T("base directory shouldn't end with a slash") ); _T("base directory shouldn't end with a slash") );
wxString dirname = dirbase; wxString dirname = dirbase;
@@ -1317,14 +1317,14 @@ bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
i ++; i ++;
} }
if ( sTmp.empty () ) if ( sTmp.empty () )
return FALSE; return false;
if ( iconLoc ) if ( iconLoc )
{ {
iconLoc->SetFileName(sTmp); iconLoc->SetFileName(sTmp);
} }
return TRUE; return true;
} }
@@ -1334,7 +1334,7 @@ wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
mimeTypes.Clear(); mimeTypes.Clear();
for (size_t i = 0; i < m_index.GetCount(); i++) for (size_t i = 0; i < m_index.GetCount(); i++)
mimeTypes.Add(m_manager->m_aTypes[m_index[i]]); mimeTypes.Add(m_manager->m_aTypes[m_index[i]]);
return TRUE; return true;
} }
@@ -1414,14 +1414,14 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
} }
} }
return TRUE; return true;
} }
// set an arbitrary command, // set an arbitrary command,
// could adjust the code to ask confirmation if it already exists and // could adjust the code to ask confirmation if it already exists and
// overwriteprompt is TRUE, but this is currently ignored as *Associate* has // overwriteprompt is true, but this is currently ignored as *Associate* has
// no overwrite prompt // no overwrite prompt
bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt /*= TRUE*/) bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt /*= true*/)
{ {
wxArrayString strExtensions; wxArrayString strExtensions;
wxString strDesc, strIcon; wxString strDesc, strIcon;
@@ -1431,14 +1431,14 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool
wxArrayString strTypes; wxArrayString strTypes;
GetMimeTypes (strTypes); GetMimeTypes (strTypes);
if (strTypes.GetCount() < 1) return FALSE; if (strTypes.GetCount() < 1) return false;
size_t i; size_t i;
bool Ok = TRUE; bool Ok = true;
for (i = 0; i < strTypes.GetCount(); i++) for (i = 0; i < strTypes.GetCount(); i++)
{ {
if (!m_manager->DoAssociation (strTypes[i], strIcon, entry, strExtensions, strDesc)) if (!m_manager->DoAssociation (strTypes[i], strIcon, entry, strExtensions, strDesc))
Ok = FALSE; Ok = false;
} }
return Ok; return Ok;
@@ -1447,7 +1447,7 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool
// ignore index on the grouds that we only have one icon in a Unix file // ignore index on the grouds that we only have one icon in a Unix file
bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon /*= wxEmptyString*/, int /*index = 0*/) bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon /*= wxEmptyString*/, int /*index = 0*/)
{ {
if (strIcon.empty()) return FALSE; if (strIcon.empty()) return false;
wxArrayString strExtensions; wxArrayString strExtensions;
wxString strDesc; wxString strDesc;
@@ -1455,14 +1455,14 @@ bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon /*= wxEmptyString*/,
wxArrayString strTypes; wxArrayString strTypes;
GetMimeTypes (strTypes); GetMimeTypes (strTypes);
if (strTypes.GetCount() < 1) return FALSE; if (strTypes.GetCount() < 1) return false;
size_t i; size_t i;
bool Ok = TRUE; bool Ok = true;
for (i = 0; i < strTypes.GetCount(); i++) for (i = 0; i < strTypes.GetCount(); i++)
{ {
if (!m_manager->DoAssociation (strTypes[i], strIcon, entry, strExtensions, strDesc)) if (!m_manager->DoAssociation (strTypes[i], strIcon, entry, strExtensions, strDesc))
Ok = FALSE; Ok = false;
} }
return Ok; return Ok;
@@ -1475,7 +1475,7 @@ bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon /*= wxEmptyString*/,
wxMimeTypesManagerImpl::wxMimeTypesManagerImpl() wxMimeTypesManagerImpl::wxMimeTypesManagerImpl()
{ {
m_initialized = FALSE; m_initialized = false;
m_mailcapStylesInited = 0; m_mailcapStylesInited = 0;
} }
@@ -1484,7 +1484,7 @@ void wxMimeTypesManagerImpl::InitIfNeeded()
if ( !m_initialized ) if ( !m_initialized )
{ {
// set the flag first to prevent recursion // set the flag first to prevent recursion
m_initialized = TRUE; m_initialized = true;
#if 0 #if 0
wxString wm = wxGetenv( wxT("WINDOWMANAGER") ); wxString wm = wxGetenv( wxT("WINDOWMANAGER") );
@@ -1585,7 +1585,7 @@ bool wxMimeTypesManagerImpl::WriteToMimeTypes (int index, bool delete_index)
{ {
// check we have the right manager // check we have the right manager
if (! ( m_mailcapStylesInited & wxMAILCAP_STANDARD) ) if (! ( m_mailcapStylesInited & wxMAILCAP_STANDARD) )
return FALSE; return false;
bool bTemp; bool bTemp;
wxString strHome = wxGetenv(wxT("HOME")); wxString strHome = wxGetenv(wxT("HOME"));
@@ -1600,18 +1600,18 @@ bool wxMimeTypesManagerImpl::WriteToMimeTypes (int index, bool delete_index)
} }
else else
{ {
if (delete_index) return FALSE; if (delete_index) return false;
bTemp = file.Create(strUserMailcap); bTemp = file.Create(strUserMailcap);
} }
if (bTemp) if (bTemp)
{ {
int nIndex; int nIndex;
// test for netscape's header and return FALSE if its found // test for netscape's header and return false if its found
nIndex = file.pIndexOf (wxT("#--Netscape")); nIndex = file.pIndexOf (wxT("#--Netscape"));
if (nIndex != wxNOT_FOUND) if (nIndex != wxNOT_FOUND)
{ {
wxASSERT_MSG(FALSE,wxT("Error in .mime.types \nTrying to mix Netscape and Metamail formats\nFile not modiifed")); wxASSERT_MSG(false,wxT("Error in .mime.types \nTrying to mix Netscape and Metamail formats\nFile not modiifed"));
return FALSE; return false;
} }
// write it in alternative format // write it in alternative format
// get rid of unwanted entries // get rid of unwanted entries
@@ -1639,7 +1639,7 @@ bool wxMimeTypesManagerImpl::WriteToNSMimeTypes (int index, bool delete_index)
{ {
//check we have the right managers //check we have the right managers
if (! ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE) ) if (! ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE) )
return FALSE; return false;
bool bTemp; bool bTemp;
wxString strHome = wxGetenv(wxT("HOME")); wxString strHome = wxGetenv(wxT("HOME"));
@@ -1654,7 +1654,7 @@ bool wxMimeTypesManagerImpl::WriteToNSMimeTypes (int index, bool delete_index)
} }
else else
{ {
if (delete_index) return FALSE; if (delete_index) return false;
bTemp = file.Create(strUserMailcap); bTemp = file.Create(strUserMailcap);
} }
if (bTemp) if (bTemp)
@@ -1663,8 +1663,8 @@ bool wxMimeTypesManagerImpl::WriteToNSMimeTypes (int index, bool delete_index)
// write it in the format that Netscape uses // write it in the format that Netscape uses
int nIndex; int nIndex;
// test for netscape's header and insert if required... // test for netscape's header and insert if required...
// this is a comment so use TRUE // this is a comment so use true
nIndex = file.pIndexOf (wxT("#--Netscape"), TRUE); nIndex = file.pIndexOf (wxT("#--Netscape"), true);
if (nIndex == wxNOT_FOUND) if (nIndex == wxNOT_FOUND)
{ {
// either empty file or metamail format // either empty file or metamail format
@@ -1672,8 +1672,8 @@ bool wxMimeTypesManagerImpl::WriteToNSMimeTypes (int index, bool delete_index)
// metamail entreies // metamail entreies
if (file.GetLineCount () > 0) if (file.GetLineCount () > 0)
{ {
wxASSERT_MSG(FALSE, wxT(".mime.types File not in Netscape format\nNo entries written to\n.mime.types or to .mailcap")); wxASSERT_MSG(false, wxT(".mime.types File not in Netscape format\nNo entries written to\n.mime.types or to .mailcap"));
return FALSE; return false;
} }
file.InsertLine (wxT( "#--Netscape Communications Corporation MIME Information" ), 0); file.InsertLine (wxT( "#--Netscape Communications Corporation MIME Information" ), 0);
nIndex = 0; nIndex = 0;
@@ -1708,7 +1708,7 @@ bool wxMimeTypesManagerImpl::WriteToNSMimeTypes (int index, bool delete_index)
} }
} }
wxString sExts = m_aExtensions.Item(index); wxString sExts = m_aExtensions.Item(index);
sTmp = wxT("exts=\"") + sExts.Trim(FALSE).Trim() + wxT("\""); sTmp = wxT("exts=\"") + sExts.Trim(false).Trim() + wxT("\"");
if (!delete_index) if (!delete_index)
{ {
nIndex ++; nIndex ++;
@@ -1727,7 +1727,7 @@ bool wxMimeTypesManagerImpl::WriteToMailCap (int index, bool delete_index)
//check we have the right managers //check we have the right managers
if ( !( ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE) || if ( !( ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE) ||
( m_mailcapStylesInited & wxMAILCAP_STANDARD) ) ) ( m_mailcapStylesInited & wxMAILCAP_STANDARD) ) )
return FALSE; return false;
bool bTemp; bool bTemp;
wxString strHome = wxGetenv(wxT("HOME")); wxString strHome = wxGetenv(wxT("HOME"));
@@ -1742,7 +1742,7 @@ bool wxMimeTypesManagerImpl::WriteToMailCap (int index, bool delete_index)
} }
else else
{ {
if (delete_index) return FALSE; if (delete_index) return false;
bTemp = file.Create(strUserMailcap); bTemp = file.Create(strUserMailcap);
} }
if (bTemp) if (bTemp)
@@ -1804,13 +1804,13 @@ bool wxMimeTypesManagerImpl::WriteToMailCap (int index, bool delete_index)
s = sT.GetNextToken(); s = sT.GetNextToken();
while ( ! s.empty() ) while ( ! s.empty() )
{ {
bool bKnownToken = FALSE; bool bKnownToken = false;
if (s.Contains(wxT("description="))) bKnownToken = TRUE; if (s.Contains(wxT("description="))) bKnownToken = true;
if (s.Contains(wxT("x11-bitmap="))) bKnownToken = TRUE; if (s.Contains(wxT("x11-bitmap="))) bKnownToken = true;
size_t i; size_t i;
for (i=0; i < entries->GetCount(); i++) for (i=0; i < entries->GetCount(); i++)
{ {
if (s.Contains(entries->GetVerb(i))) bKnownToken = TRUE; if (s.Contains(entries->GetVerb(i))) bKnownToken = true;
} }
if (!bKnownToken) if (!bKnownToken)
{ {
@@ -1886,7 +1886,7 @@ wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
{ {
sExt = sA_Exts.Item(i); sExt = sA_Exts.Item(i);
//clean up to just a space before and after //clean up to just a space before and after
sExt.Trim().Trim(FALSE); sExt.Trim().Trim(false);
sExt = wxT(' ') + sExt + wxT(' '); sExt = wxT(' ') + sExt + wxT(' ');
for (nIndex = 0; nIndex < m_aExtensions.GetCount(); nIndex ++) for (nIndex = 0; nIndex < m_aExtensions.GetCount(); nIndex ++)
{ {
@@ -1909,44 +1909,44 @@ bool wxMimeTypesManagerImpl::DoAssociation(const wxString& strType,
const wxArrayString& strExtensions, const wxArrayString& strExtensions,
const wxString& strDesc) const wxString& strDesc)
{ {
int nIndex = AddToMimeData(strType, strIcon, entry, strExtensions, strDesc, TRUE); int nIndex = AddToMimeData(strType, strIcon, entry, strExtensions, strDesc, true);
if ( nIndex == wxNOT_FOUND ) if ( nIndex == wxNOT_FOUND )
return FALSE; return false;
return WriteMimeInfo (nIndex, FALSE); return WriteMimeInfo (nIndex, false);
} }
bool wxMimeTypesManagerImpl::WriteMimeInfo(int nIndex, bool delete_mime ) bool wxMimeTypesManagerImpl::WriteMimeInfo(int nIndex, bool delete_mime )
{ {
bool ok = TRUE; bool ok = true;
if ( m_mailcapStylesInited & wxMAILCAP_STANDARD ) if ( m_mailcapStylesInited & wxMAILCAP_STANDARD )
{ {
// write in metamail format; // write in metamail format;
if (WriteToMimeTypes (nIndex, delete_mime) ) if (WriteToMimeTypes (nIndex, delete_mime) )
if ( WriteToMailCap (nIndex, delete_mime) ) if ( WriteToMailCap (nIndex, delete_mime) )
ok = FALSE; ok = false;
} }
if ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE ) if ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE )
{ {
// write in netsacpe format; // write in netsacpe format;
if (WriteToNSMimeTypes (nIndex, delete_mime) ) if (WriteToNSMimeTypes (nIndex, delete_mime) )
if ( WriteToMailCap (nIndex, delete_mime) ) if ( WriteToMailCap (nIndex, delete_mime) )
ok = FALSE; ok = false;
} }
if (m_mailcapStylesInited & wxMAILCAP_GNOME) if (m_mailcapStylesInited & wxMAILCAP_GNOME)
{ {
// write in Gnome format; // write in Gnome format;
if (WriteGnomeMimeFile (nIndex, delete_mime) ) if (WriteGnomeMimeFile (nIndex, delete_mime) )
if (WriteGnomeKeyFile (nIndex, delete_mime) ) if (WriteGnomeKeyFile (nIndex, delete_mime) )
ok = FALSE; ok = false;
} }
if (m_mailcapStylesInited & wxMAILCAP_KDE) if (m_mailcapStylesInited & wxMAILCAP_KDE)
{ {
// write in KDE format; // write in KDE format;
if (WriteKDEMimeFile (nIndex, delete_mime) ) if (WriteKDEMimeFile (nIndex, delete_mime) )
ok = FALSE; ok = false;
} }
return ok; return ok;
@@ -2070,7 +2070,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
while ( tk.HasMoreTokens() ) while ( tk.HasMoreTokens() )
{ {
// consider extensions as not being case-sensitive // consider extensions as not being case-sensitive
if ( tk.GetNextToken().IsSameAs(ext, FALSE /* no case */) ) if ( tk.GetNextToken().IsSameAs(ext, false /* no case */) )
{ {
// found // found
wxFileType *fileType = new wxFileType; wxFileType *fileType = new wxFileType;
@@ -2181,7 +2181,7 @@ void wxMimeTypesManagerImpl::AddMimeTypeInfo(const wxString& strMimeType,
wxString sTmp = strExtensions; wxString sTmp = strExtensions;
wxArrayString sExts; wxArrayString sExts;
sTmp.Trim().Trim(FALSE); sTmp.Trim().Trim(false);
while (!sTmp.empty()) while (!sTmp.empty())
{ {
@@ -2189,7 +2189,7 @@ void wxMimeTypesManagerImpl::AddMimeTypeInfo(const wxString& strMimeType,
sTmp = sTmp.BeforeLast(wxT(' ')); sTmp = sTmp.BeforeLast(wxT(' '));
} }
AddToMimeData (strMimeType, strIcon, NULL, sExts, strDesc, TRUE); AddToMimeData (strMimeType, strIcon, NULL, sExts, strDesc, true);
} }
void wxMimeTypesManagerImpl::AddMailcapInfo(const wxString& strType, void wxMimeTypesManagerImpl::AddMailcapInfo(const wxString& strType,
@@ -2208,7 +2208,7 @@ void wxMimeTypesManagerImpl::AddMailcapInfo(const wxString& strType,
wxString strIcon; wxString strIcon;
wxArrayString strExtensions; wxArrayString strExtensions;
AddToMimeData (strType, strIcon, entry, strExtensions, strDesc, TRUE); AddToMimeData (strType, strIcon, entry, strExtensions, strDesc, true);
} }
@@ -2223,7 +2223,7 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
#else #else
if ( !file.Open() ) if ( !file.Open() )
#endif #endif
return FALSE; return false;
// the information we extract // the information we extract
wxString strMimeType, strDesc, strExtensions; wxString strMimeType, strDesc, strExtensions;
@@ -2315,7 +2315,7 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
// if there is something left, it may be either a '\\' to continue // if there is something left, it may be either a '\\' to continue
// the line or the next field of the same entry // the line or the next field of the same entry
bool entryEnded = *pc == wxT('\0'), bool entryEnded = *pc == wxT('\0'),
nextFieldOnSameLine = FALSE; nextFieldOnSameLine = false;
if ( !entryEnded ) { if ( !entryEnded ) {
nextFieldOnSameLine = ((*pc != wxT('\\')) || (pc[1] != wxT('\0'))); nextFieldOnSameLine = ((*pc != wxT('\\')) || (pc[1] != wxT('\0')));
} }
@@ -2378,7 +2378,7 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
pc = NULL; pc = NULL;
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -2403,7 +2403,7 @@ struct MailcapLineData
needsterminal, needsterminal,
copiousoutput; copiousoutput;
MailcapLineData() { testfailed = needsterminal = copiousoutput = FALSE; } MailcapLineData() { testfailed = needsterminal = copiousoutput = false; }
}; };
// process a non-standard (i.e. not the first or second one) mailcap field // process a non-standard (i.e. not the first or second one) mailcap field
@@ -2414,7 +2414,7 @@ wxMimeTypesManagerImpl::ProcessOtherMailcapField(MailcapLineData& data,
if ( curField.empty() ) if ( curField.empty() )
{ {
// we don't care // we don't care
return TRUE; return true;
} }
// is this something of the form foo=bar? // is this something of the form foo=bar?
@@ -2425,8 +2425,8 @@ wxMimeTypesManagerImpl::ProcessOtherMailcapField(MailcapLineData& data,
wxString lhs = curField.BeforeFirst(wxT('=')), wxString lhs = curField.BeforeFirst(wxT('=')),
rhs = curField.AfterFirst(wxT('=')); rhs = curField.AfterFirst(wxT('='));
lhs.Trim(TRUE); // from right lhs.Trim(true); // from right
rhs.Trim(FALSE); // from left rhs.Trim(false); // from left
// it might be quoted // it might be quoted
if ( !rhs.empty() && rhs[0u] == wxT('"') && rhs.Last() == wxT('"') ) if ( !rhs.empty() && rhs[0u] == wxT('"') && rhs.Last() == wxT('"') )
@@ -2451,7 +2451,7 @@ wxMimeTypesManagerImpl::ProcessOtherMailcapField(MailcapLineData& data,
wxT("Test '%s' for mime type '%s' failed, skipping."), wxT("Test '%s' for mime type '%s' failed, skipping."),
rhs.c_str(), data.type.c_str()); rhs.c_str(), data.type.c_str());
data.testfailed = TRUE; data.testfailed = true;
} }
} }
else if ( lhs == wxT("desc") ) else if ( lhs == wxT("desc") )
@@ -2477,21 +2477,21 @@ wxMimeTypesManagerImpl::ProcessOtherMailcapField(MailcapLineData& data,
// so it must be a simple flag // so it must be a simple flag
if ( curField == wxT("needsterminal") ) if ( curField == wxT("needsterminal") )
{ {
data.needsterminal = TRUE; data.needsterminal = true;
} }
else if ( curField == wxT("copiousoutput")) else if ( curField == wxT("copiousoutput"))
{ {
// copiousoutput impies that the viewer is a console program // copiousoutput impies that the viewer is a console program
data.needsterminal = data.needsterminal =
data.copiousoutput = TRUE; data.copiousoutput = true;
} }
else if ( !IsKnownUnimportantField(curField) ) else if ( !IsKnownUnimportantField(curField) )
{ {
return FALSE; return false;
} }
} }
return TRUE; return true;
} }
bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
@@ -2506,7 +2506,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
#else #else
if ( !file.Open() ) if ( !file.Open() )
#endif #endif
return FALSE; return false;
// indices of MIME types (in m_aTypes) we already found in this file // indices of MIME types (in m_aTypes) we already found in this file
// //
@@ -2549,7 +2549,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
// the flags and field values on the current line // the flags and field values on the current line
MailcapLineData data; MailcapLineData data;
bool cont = TRUE; bool cont = true;
while ( cont ) while ( cont )
{ {
switch ( *pc ) switch ( *pc )
@@ -2563,7 +2563,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
if ( nLine == nLineCount - 1 ) if ( nLine == nLineCount - 1 )
{ {
// something is wrong, bail out // something is wrong, bail out
cont = FALSE; cont = false;
wxLogDebug(wxT("Mailcap file %s, line %lu: '\\' on the end of the last line ignored."), wxLogDebug(wxT("Mailcap file %s, line %lu: '\\' on the end of the last line ignored."),
strFileName.c_str(), strFileName.c_str(),
@@ -2586,13 +2586,13 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
break; break;
case wxT('\0'): case wxT('\0'):
cont = FALSE; // end of line reached, exit the loop cont = false; // end of line reached, exit the loop
// fall through to still process this field // fall through to still process this field
case wxT(';'): case wxT(';'):
// trim whitespaces from both sides // trim whitespaces from both sides
curField.Trim(TRUE).Trim(FALSE); curField.Trim(true).Trim(false);
switch ( currentToken ) switch ( currentToken )
{ {
@@ -2639,7 +2639,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
else if ( data.testfailed ) else if ( data.testfailed )
{ {
// skip this entry entirely // skip this entry entirely
cont = FALSE; cont = false;
} }
// it already has this value // it already has this value
@@ -2714,7 +2714,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
// the fall back entries have the lowest priority, by definition // the fall back entries have the lowest priority, by definition
if ( fallback ) if ( fallback )
{ {
overwrite = FALSE; overwrite = false;
} }
else else
{ {
@@ -2747,7 +2747,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
} }
} }
return TRUE; return true;
} }
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
@@ -2789,11 +2789,11 @@ bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft)
if ( nIndex == wxNOT_FOUND) if ( nIndex == wxNOT_FOUND)
{ {
// error if we get here ?? // error if we get here ??
return FALSE; return false;
} }
else else
{ {
WriteMimeInfo(nIndex, TRUE ); WriteMimeInfo(nIndex, true );
m_aTypes.RemoveAt(nIndex); m_aTypes.RemoveAt(nIndex);
m_aEntries.RemoveAt(nIndex); m_aEntries.RemoveAt(nIndex);
m_aExtensions.RemoveAt(nIndex); m_aExtensions.RemoveAt(nIndex);
@@ -2807,7 +2807,7 @@ bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft)
m_aTypes.Count() == m_aIcons.Count() && m_aTypes.Count() == m_aIcons.Count() &&
m_aTypes.Count() == m_aDescriptions.Count() ); m_aTypes.Count() == m_aDescriptions.Count() );
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -2827,10 +2827,10 @@ static bool IsKnownUnimportantField(const wxString& fieldAll)
for ( size_t n = 0; n < WXSIZEOF(knownFields); n++ ) for ( size_t n = 0; n < WXSIZEOF(knownFields); n++ )
{ {
if ( field.CmpNoCase(knownFields[n]) == 0 ) if ( field.CmpNoCase(knownFields[n]) == 0 )
return TRUE; return true;
} }
return FALSE; return false;
} }
#endif #endif