TRUE/true, FALSE/false, whitespace cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28812 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-08-16 12:45:46 +00:00
parent a29b55cdf6
commit 0a0e6a5baf
14 changed files with 1007 additions and 1007 deletions

View File

@@ -16,9 +16,7 @@
#pragma interface #pragma interface
#endif #endif
#if !wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
#error "You should #define wxUSE_ACCESSIBILITY to 1 to compile this file!"
#endif //wxUSE_ACCESSIBILITY
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// forward declarations // forward declarations
@@ -68,5 +66,7 @@ private:
DECLARE_NO_COPY_CLASS(wxAccessible) DECLARE_NO_COPY_CLASS(wxAccessible)
}; };
#endif //wxUSE_ACCESSIBILITY
#endif //_WX_ACCESS_H_ #endif //_WX_ACCESS_H_

View File

@@ -57,7 +57,7 @@ public:
wxString GetId() const; wxString GetId() const;
void SetId(const wxChar *format); void SetId(const wxChar *format);
// returns TRUE if the format is one of those defined in wxDataFormatId // returns true if the format is one of those defined in wxDataFormatId
bool IsStandard() const { return m_format > 0 && m_format < wxDF_PRIVATE; } bool IsStandard() const { return m_format > 0 && m_format < wxDF_PRIVATE; }
private: private:

View File

@@ -36,7 +36,7 @@ public:
// it is deleted, it should delete us as well // it is deleted, it should delete us as well
void SetAutoDelete(); void SetAutoDelete();
// return TRUE if we support this format in "Get" direction // return true if we support this format in "Get" direction
bool IsSupportedFormat(const wxDataFormat& format) const bool IsSupportedFormat(const wxDataFormat& format) const
{ return wxDataObjectBase::IsSupported(format, Get); } { return wxDataObjectBase::IsSupported(format, Get); }

View File

@@ -16,9 +16,7 @@
#pragma interface #pragma interface
#endif #endif
#if !wxUSE_DRAG_AND_DROP #if wxUSE_DRAG_AND_DROP
#error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
#endif //WX_DRAG_DROP
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// forward declarations // forward declarations
@@ -80,4 +78,6 @@ private:
DECLARE_NO_COPY_CLASS(wxDropSource) DECLARE_NO_COPY_CLASS(wxDropSource)
}; };
#endif //wxUSE_DRAG_AND_DROP
#endif //_WX_OLEDROPSRC_H #endif //_WX_OLEDROPSRC_H

View File

@@ -16,9 +16,7 @@
#pragma interface "droptgt.h" #pragma interface "droptgt.h"
#endif #endif
#if !wxUSE_DRAG_AND_DROP #if wxUSE_DRAG_AND_DROP
#error "You should #define wxUSE_DRAG_AND_DROP to 1 to compile this file!"
#endif //WX_DRAG_DROP
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// forward declarations // forward declarations
@@ -73,4 +71,6 @@ private:
DECLARE_NO_COPY_CLASS(wxDropTarget) DECLARE_NO_COPY_CLASS(wxDropTarget)
}; };
#endif //wxUSE_DRAG_AND_DROP
#endif //_WX_OLEDROPTGT_H #endif //_WX_OLEDROPTGT_H

View File

@@ -39,7 +39,7 @@ inline void ReleaseInterface(IUnknown *pIUnk)
// release the interface pointer (if !NULL) and make it NULL // release the interface pointer (if !NULL) and make it NULL
#define RELEASE_AND_NULL(p) if ( (p) != NULL ) { p->Release(); p = NULL; }; #define RELEASE_AND_NULL(p) if ( (p) != NULL ) { p->Release(); p = NULL; };
// return TRUE if the iid is in the array // return true if the iid is in the array
extern bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount); extern bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount);
// ============================================================================ // ============================================================================

View File

@@ -101,7 +101,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
wxVariant& retValue, int noArgs, wxVariant args[], const wxVariant* ptrArgs[]) const wxVariant& retValue, int noArgs, wxVariant args[], const wxVariant* ptrArgs[]) const
{ {
if (!m_dispatchPtr) if (!m_dispatchPtr)
return FALSE; return false;
// nonConstMember is necessary because the wxString class doesn't have enough consts... // nonConstMember is necessary because the wxString class doesn't have enough consts...
wxString nonConstMember(member); wxString nonConstMember(member);
@@ -114,7 +114,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
wxString rest(nonConstMember.Right(nonConstMember.Length() - ch - 1)); wxString rest(nonConstMember.Right(nonConstMember.Length() - ch - 1));
wxAutomationObject obj; wxAutomationObject obj;
if (!GetObject(obj, member2)) if (!GetObject(obj, member2))
return FALSE; return false;
return obj.Invoke(rest, action, retValue, noArgs, args, ptrArgs); return obj.Invoke(rest, action, retValue, noArgs, args, ptrArgs);
} }
@@ -166,7 +166,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
// ShowException(szMember, hr, NULL, 0); // ShowException(szMember, hr, NULL, 0);
delete[] argNames; delete[] argNames;
delete[] dispIds; delete[] dispIds;
return FALSE; return false;
} }
// if doing a property put(ref), we need to adjust the first argument to have a // if doing a property put(ref), we need to adjust the first argument to have a
@@ -188,7 +188,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
delete[] argNames; delete[] argNames;
delete[] dispIds; delete[] dispIds;
delete[] oleArgs; delete[] oleArgs;
return FALSE; return false;
} }
} }
@@ -225,7 +225,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
if (vReturnPtr) if (vReturnPtr)
ReleaseVariant(vReturnPtr); ReleaseVariant(vReturnPtr);
return FALSE; return false;
} }
else else
{ {
@@ -241,7 +241,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
ReleaseVariant(& vReturn); ReleaseVariant(& vReturn);
} }
} }
return TRUE; return true;
} }
// Invoke a member function // Invoke a member function
@@ -382,9 +382,9 @@ bool wxAutomationObject::PutProperty(const wxString& property, int noArgs, wxVar
wxVariant retVariant; wxVariant retVariant;
if (!Invoke(property, DISPATCH_PROPERTYPUT, retVariant, noArgs, args)) if (!Invoke(property, DISPATCH_PROPERTYPUT, retVariant, noArgs, args))
{ {
return FALSE; return false;
} }
return TRUE; return true;
} }
bool wxAutomationObject::PutPropertyArray(const wxString& property, int noArgs, const wxVariant **args) bool wxAutomationObject::PutPropertyArray(const wxString& property, int noArgs, const wxVariant **args)
@@ -392,9 +392,9 @@ bool wxAutomationObject::PutPropertyArray(const wxString& property, int noArgs,
wxVariant retVariant; wxVariant retVariant;
if (!Invoke(property, DISPATCH_PROPERTYPUT, retVariant, noArgs, NULL, args)) if (!Invoke(property, DISPATCH_PROPERTYPUT, retVariant, noArgs, NULL, args))
{ {
return FALSE; return false;
} }
return TRUE; return true;
} }
bool wxAutomationObject::PutProperty(const wxString& property, bool wxAutomationObject::PutProperty(const wxString& property,
@@ -485,10 +485,10 @@ bool wxAutomationObject::GetObject(wxAutomationObject& obj, const wxString& prop
if (dispatch) if (dispatch)
{ {
obj.SetDispatchPtr(dispatch); obj.SetDispatchPtr(dispatch);
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
// A way of initialising another wxAutomationObject with a dispatch object // A way of initialising another wxAutomationObject with a dispatch object
@@ -498,10 +498,10 @@ bool wxAutomationObject::GetObject(wxAutomationObject& obj, const wxString& prop
if (dispatch) if (dispatch)
{ {
obj.SetDispatchPtr(dispatch); obj.SetDispatchPtr(dispatch);
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
// Get a dispatch pointer from the current object associated // Get a dispatch pointer from the current object associated
@@ -509,7 +509,7 @@ bool wxAutomationObject::GetObject(wxAutomationObject& obj, const wxString& prop
bool wxAutomationObject::GetInstance(const wxString& classId) const bool wxAutomationObject::GetInstance(const wxString& classId) const
{ {
if (m_dispatchPtr) if (m_dispatchPtr)
return FALSE; return false;
CLSID clsId; CLSID clsId;
IUnknown * pUnk = NULL; IUnknown * pUnk = NULL;
@@ -519,22 +519,22 @@ bool wxAutomationObject::GetInstance(const wxString& classId) const
if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId))) if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId)))
{ {
wxLogWarning(wxT("Cannot obtain CLSID from ProgID")); wxLogWarning(wxT("Cannot obtain CLSID from ProgID"));
return FALSE; return false;
} }
if (FAILED(GetActiveObject(clsId, NULL, &pUnk))) if (FAILED(GetActiveObject(clsId, NULL, &pUnk)))
{ {
wxLogWarning(wxT("Cannot find an active object")); wxLogWarning(wxT("Cannot find an active object"));
return FALSE; return false;
} }
if (pUnk->QueryInterface(IID_IDispatch, (LPVOID*) &m_dispatchPtr) != S_OK) if (pUnk->QueryInterface(IID_IDispatch, (LPVOID*) &m_dispatchPtr) != S_OK)
{ {
wxLogWarning(wxT("Cannot find IDispatch interface")); wxLogWarning(wxT("Cannot find IDispatch interface"));
return FALSE; return false;
} }
return TRUE; return true;
} }
// Get a dispatch pointer from a new object associated // Get a dispatch pointer from a new object associated
@@ -542,7 +542,7 @@ bool wxAutomationObject::GetInstance(const wxString& classId) const
bool wxAutomationObject::CreateInstance(const wxString& classId) const bool wxAutomationObject::CreateInstance(const wxString& classId) const
{ {
if (m_dispatchPtr) if (m_dispatchPtr)
return FALSE; return false;
CLSID clsId; CLSID clsId;
@@ -551,17 +551,17 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const
if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId))) if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId)))
{ {
wxLogWarning(wxT("Cannot obtain CLSID from ProgID")); wxLogWarning(wxT("Cannot obtain CLSID from ProgID"));
return FALSE; return false;
} }
// start a new copy of Excel, grab the IDispatch interface // start a new copy of Excel, grab the IDispatch interface
if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void**)&m_dispatchPtr))) if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void**)&m_dispatchPtr)))
{ {
wxLogWarning(wxT("Cannot start an instance of this class.")); wxLogWarning(wxT("Cannot start an instance of this class."));
return FALSE; return false;
} }
return TRUE; return true;
} }
@@ -571,7 +571,7 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
if (variant.IsNull()) if (variant.IsNull())
{ {
oleVariant.vt = VT_NULL; oleVariant.vt = VT_NULL;
return TRUE; return true;
} }
wxString type(variant.GetType()); wxString type(variant.GetType());
@@ -621,7 +621,7 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
if (!OleDateFromTm(date.GetYear(), date.GetMonth(), date.GetDay(), if (!OleDateFromTm(date.GetYear(), date.GetMonth(), date.GetDay(),
0, 0, 0, oleVariant.date)) 0, 0, 0, oleVariant.date))
return FALSE; return false;
} }
else if (type == wxT("time")) else if (type == wxT("time"))
{ {
@@ -630,7 +630,7 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
if (!OleDateFromTm(time.GetYear(), time.GetMonth(), time.GetDay(), if (!OleDateFromTm(time.GetYear(), time.GetMonth(), time.GetDay(),
time.GetHour(), time.GetMinute(), time.GetSecond(), oleVariant.date)) time.GetHour(), time.GetMinute(), time.GetSecond(), oleVariant.date))
return FALSE; return false;
} }
#endif #endif
#if wxUSE_DATETIME #if wxUSE_DATETIME
@@ -641,7 +641,7 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
if (!OleDateFromTm(date.GetYear(), date.GetMonth(), date.GetDay(), if (!OleDateFromTm(date.GetYear(), date.GetMonth(), date.GetDay(),
date.GetHour(), date.GetMinute(), date.GetSecond(), oleVariant.date)) date.GetHour(), date.GetMinute(), date.GetSecond(), oleVariant.date))
return FALSE; return false;
} }
#endif #endif
else if (type == wxT("void*")) else if (type == wxT("void*"))
@@ -666,7 +666,7 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
psa = SafeArrayCreate(VT_VARIANT, 1, &saBound); psa = SafeArrayCreate(VT_VARIANT, 1, &saBound);
if (psa == NULL) if (psa == NULL)
return FALSE; return false;
SafeArrayAccessData(psa, (void**)&pvargBase); SafeArrayAccessData(psa, (void**)&pvargBase);
@@ -686,7 +686,7 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
pvarg++; pvarg++;
} }
SafeArrayDestroy(psa); SafeArrayDestroy(psa);
return FALSE; return false;
} }
pvarg++; pvarg++;
} }
@@ -698,9 +698,9 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
else else
{ {
oleVariant.vt = VT_NULL; oleVariant.vt = VT_NULL;
return FALSE; return false;
} }
return TRUE; return true;
} }
#ifndef VT_TYPEMASK #ifndef VT_TYPEMASK
@@ -722,7 +722,7 @@ bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
#if wxUSE_DATETIME #if wxUSE_DATETIME
struct tm tmTemp; struct tm tmTemp;
if (!TmFromOleDate(oleVariant.date, tmTemp)) if (!TmFromOleDate(oleVariant.date, tmTemp))
return FALSE; return false;
wxDateTime date(tmTemp.tm_yday, (wxDateTime::Month) tmTemp.tm_mon, tmTemp.tm_year, tmTemp.tm_hour, tmTemp.tm_min, tmTemp.tm_sec); wxDateTime date(tmTemp.tm_yday, (wxDateTime::Month) tmTemp.tm_mon, tmTemp.tm_year, tmTemp.tm_hour, tmTemp.tm_min, tmTemp.tm_sec);
@@ -779,14 +779,14 @@ bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
// Get a pointer to the data // Get a pointer to the data
HRESULT hr = SafeArrayAccessData(oleVariant.parray, (void HUGEP* FAR*) & pvdata); HRESULT hr = SafeArrayAccessData(oleVariant.parray, (void HUGEP* FAR*) & pvdata);
if (hr != NOERROR) if (hr != NOERROR)
return FALSE; return false;
// Iterate the data. // Iterate the data.
for (i = 0; i < cElements; i++) for (i = 0; i < cElements; i++)
{ {
VARIANTARG& oleElement = pvdata[i]; VARIANTARG& oleElement = pvdata[i];
wxVariant vElement; wxVariant vElement;
if (!wxConvertOleToVariant(oleElement, vElement)) if (!wxConvertOleToVariant(oleElement, vElement))
return FALSE; return false;
variant.Append(vElement); variant.Append(vElement);
} }
@@ -810,10 +810,10 @@ bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
default: default:
{ {
wxLogError(wxT("wxAutomationObject::ConvertOleToVariant: Unknown variant value type")); wxLogError(wxT("wxAutomationObject::ConvertOleToVariant: Unknown variant value type"));
return FALSE; return false;
} }
} }
return TRUE; return true;
} }
BSTR wxConvertStringToOle(const wxString& str) BSTR wxConvertStringToOle(const wxString& str)

View File

@@ -241,11 +241,11 @@ bool wxDropSource::GiveFeedback(wxDragResult effect)
{ {
::SetCursor((HCURSOR)cursor.GetHCURSOR()); ::SetCursor((HCURSOR)cursor.GetHCURSOR());
return TRUE; return true;
} }
else else
{ {
return FALSE; return false;
} }
} }

View File

@@ -294,7 +294,7 @@ STDMETHODIMP wxIDropTarget::Drop(IDataObject *pIDataSource,
} }
//else: *pdwEffect is already DROPEFFECT_NONE //else: *pdwEffect is already DROPEFFECT_NONE
} }
//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
RELEASE_AND_NULL(m_pIDataObject); RELEASE_AND_NULL(m_pIDataObject);
@@ -335,7 +335,7 @@ bool wxDropTarget::Register(WXHWND hwnd)
// Or maybe we can dynamically load them from ceshell.dll // Or maybe we can dynamically load them from ceshell.dll
// or similar. // or similar.
#if defined(__WXWINCE__) && _WIN32_WCE >= 400 #if defined(__WXWINCE__) && _WIN32_WCE >= 400
return FALSE; return false;
#else #else
HRESULT hr; HRESULT hr;
@@ -344,7 +344,7 @@ bool wxDropTarget::Register(WXHWND hwnd)
hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE); hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);
if ( FAILED(hr) ) { if ( FAILED(hr) ) {
wxLogApiError(wxT("CoLockObjectExternal"), hr); wxLogApiError(wxT("CoLockObjectExternal"), hr);
return FALSE; return false;
} }
#endif #endif
@@ -355,13 +355,13 @@ bool wxDropTarget::Register(WXHWND hwnd)
::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE); ::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE);
#endif #endif
wxLogApiError(wxT("RegisterDragDrop"), hr); wxLogApiError(wxT("RegisterDragDrop"), hr);
return FALSE; return false;
} }
// we will need the window handle for coords transformation later // we will need the window handle for coords transformation later
m_pIDropTarget->SetHwnd((HWND)hwnd); m_pIDropTarget->SetHwnd((HWND)hwnd);
return TRUE; return true;
#endif #endif
} }
@@ -389,11 +389,11 @@ void wxDropTarget::Revoke(WXHWND hwnd)
// base class pure virtuals // base class pure virtuals
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// OnDrop() is called only if we previously returned TRUE from // OnDrop() is called only if we previously returned true from
// IsAcceptedData(), so no need to check anything here // IsAcceptedData(), so no need to check anything here
bool wxDropTarget::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) bool wxDropTarget::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
{ {
return TRUE; return true;
} }
// copy the data from the data source to the target data object // copy the data from the data source to the target data object
@@ -404,7 +404,7 @@ bool wxDropTarget::GetData()
// this is strange because IsAcceptedData() succeeded previously! // this is strange because IsAcceptedData() succeeded previously!
wxFAIL_MSG(wxT("strange - did supported formats list change?")); wxFAIL_MSG(wxT("strange - did supported formats list change?"));
return FALSE; return false;
} }
STGMEDIUM stm; STGMEDIUM stm;
@@ -415,7 +415,7 @@ bool wxDropTarget::GetData()
fmtMemory.lindex = -1; fmtMemory.lindex = -1;
fmtMemory.tymed = TYMED_HGLOBAL; // TODO to add other media fmtMemory.tymed = TYMED_HGLOBAL; // TODO to add other media
bool rc = FALSE; bool rc = false;
HRESULT hr = m_pIDataSource->GetData(&fmtMemory, &stm); HRESULT hr = m_pIDataSource->GetData(&fmtMemory, &stm);
if ( SUCCEEDED(hr) ) { if ( SUCCEEDED(hr) ) {
@@ -423,7 +423,7 @@ bool wxDropTarget::GetData()
hr = dataObject->SetData(&fmtMemory, &stm, TRUE); hr = dataObject->SetData(&fmtMemory, &stm, TRUE);
if ( SUCCEEDED(hr) ) { if ( SUCCEEDED(hr) ) {
rc = TRUE; rc = true;
} }
else { else {
wxLogApiError(wxT("IDataObject::SetData()"), hr); wxLogApiError(wxT("IDataObject::SetData()"), hr);

View File

@@ -60,15 +60,15 @@
// Implementation // Implementation
// ============================================================================ // ============================================================================
// return TRUE if the iid is in the array // return true if the iid is in the array
bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount) bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount)
{ {
for ( size_t i = 0; i < nCount; i++ ) { for ( size_t i = 0; i < nCount; i++ ) {
if ( riid == *aIids[i] ) if ( riid == *aIids[i] )
return TRUE; return true;
} }
return FALSE; return false;
} }
#if wxUSE_DATAOBJ #if wxUSE_DATAOBJ

View File

@@ -143,7 +143,7 @@ bool Uuid::Set(const wxChar *pc)
if ( UuidFromString((wxUChar *)pc, &m_uuid) != RPC_S_OK) if ( UuidFromString((wxUChar *)pc, &m_uuid) != RPC_S_OK)
#endif #endif
// failed: probably invalid string // failed: probably invalid string
return FALSE; return false;
// transform it back to string to normalize it // transform it back to string to normalize it
#ifdef _UNICODE #ifdef _UNICODE
@@ -155,7 +155,7 @@ bool Uuid::Set(const wxChar *pc)
// update m_pszCForm // update m_pszCForm
UuidToCForm(); UuidToCForm();
return TRUE; return true;
} }
// stores m_uuid in m_pszCForm in a format required by // stores m_uuid in m_pszCForm in a format required by