Various source cleanings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-11-09 20:14:39 +00:00
parent 2a4d2d4680
commit 7ec698211d
20 changed files with 326 additions and 328 deletions

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: mac/cocoa/mediactrl.cpp
// Name: src/cocoa/mediactrl.cpp
// Purpose: Built-in Media Backends for Cocoa
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
@@ -492,7 +492,7 @@ void wxQTMediaBackend::Move(int x, int y, int w, int h)
//in source file that contains stuff you don't directly use
#include <wx/html/forcelnk.h>
#include "wx/html/forcelnk.h"
FORCE_LINK_ME(basewxmediabackends);
#endif //wxUSE_MEDIACTRL

View File

@@ -9,7 +9,7 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include <wx/wxprec.h>
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#endif
@@ -208,9 +208,9 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
{
case wxSYS_CAN_ICONIZE_FRAME:
case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
return TRUE;
return true;
default:
return FALSE;
return false;
}
}

View File

@@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////////////
// Name: list.cpp
// Name: src/common/list.cpp
// Purpose: wxList implementation
// Author: Julian Smart
// Modified by: VZ at 16/11/98: WX_DECLARE_LIST() and typesafe lists added
@@ -754,7 +754,7 @@ wxNode *wxStringList::Prepend(const wxChar *s)
#else // wxUSE_STL = 1
#include <wx/listimpl.cpp>
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxObjectList);
// with wxUSE_STL wxStringList contains wxString objects, not pointers
@@ -763,4 +763,3 @@ void wxStringListBase::DeleteFunction( const wxString WXUNUSED(X) )
}
#endif // !wxUSE_STL

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: common/window.cpp
// Name: src/common/window.cpp
// Purpose: common (to all ports) wxWindow functions
// Author: Julian Smart, Vadim Zeitlin
// Modified by:
@@ -2346,7 +2346,7 @@ wxAccessible* wxWindowBase::CreateAccessible()
#if wxUSE_STL
#include <wx/listimpl.cpp>
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxWindowList);
#else

View File

@@ -840,7 +840,7 @@ void wxCodeDepersister::SetConnect(int eventSourceObjectID,
}
}
#include <wx/arrimpl.cpp>
#include "wx/arrimpl.cpp"
WX_DEFINE_OBJARRAY(wxxVariantArray);

View File

@@ -13,7 +13,7 @@
#include "wx/wxprec.h"
#ifdef __VMS
#include <wx/vms_x_fix.h>
#include "wx/vms_x_fix.h"
#undef XtDisplay
#undef XtScreen
#undef XtWindow
@@ -140,8 +140,8 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
int x = pos.x; int y = pos.y;
wxSize best = GetBestSize();
if( size.x != -1 ) best.x = size.x;
if( size.y != -1 ) best.y = size.y;
if( size.x != wxDefaultCoord ) best.x = size.x;
if( size.y != wxDefaultCoord ) best.y = size.y;
ChangeFont(false);

View File

@@ -25,7 +25,7 @@
#ifdef __VMS
#define XtDisplay XTDISPLAY
#pragma message disable nosimpint
#include <wx/vms_x_fix.h>
#include "wx/vms_x_fix.h"
#endif
#include <X11/Xlib.h>
@@ -267,4 +267,3 @@ int wxMessageDialog::ShowModal()
return m_result;
}

View File

@@ -1,6 +1,6 @@
/* -------------------------------------------------------------------------
* Project: GSocket (Generic Socket)
* Name: gsockmsw.cpp
* Name: src/msw/gsockmsw.cpp
* Copyright: (c) Guilhem Lavaux
* Licence: wxWindows Licence
* Author: Guillermo Rodriguez Garcia <guille@iies.es>
@@ -85,7 +85,7 @@ extern HINSTANCE hInst;
#define assert(x)
#include <winsock.h>
#include "wx/msw/wince/net.h"
#include <wx/hashmap.h>
#include "wx/hashmap.h"
WX_DECLARE_HASH_MAP(int,bool,wxIntegerHash,wxIntegerEqual,SocketHash);
#endif

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: msw/mediactrl.cpp
// Name: src/msw/mediactrl.cpp
// Purpose: Built-in Media Backends for Windows
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
@@ -3536,12 +3536,10 @@ void wxQTMediaEvtHandler::OnEraseBackground(wxEraseEvent& evt)
//---------------------------------------------------------------------------
//in source file that contains stuff you don't directly use
#include <wx/html/forcelnk.h>
#include "wx/html/forcelnk.h"
FORCE_LINK_ME(basewxmediabackends);
//---------------------------------------------------------------------------
// End wxMediaCtrl Compilation Guard and this file
//---------------------------------------------------------------------------
#endif //wxUSE_MEDIACTRL

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: menu.cpp
// Name: src/msw/menu.cpp
// Purpose: wxMenu, wxMenuBar, wxMenuItem
// Author: Julian Smart
// Modified by: Vadim Zeitlin
@@ -120,7 +120,7 @@ UINT GetMenuState(HMENU hMenu, UINT id, UINT flags)
// implementation
// ============================================================================
#include <wx/listimpl.cpp>
#include "wx/listimpl.cpp"
WX_DEFINE_LIST( wxMenuInfoList )
@@ -697,7 +697,7 @@ void wxMenu::SetTitle(const wxString& label)
info.cbSize = sizeof(info);
info.fMask = MIIM_TYPE;
info.fType = MFT_STRING;
info.cch = m_title.Length();
info.cch = m_title.length();
info.dwTypeData = (LPTSTR) m_title.c_str();
if ( !SetMenuItemInfo(hMenu, 0, TRUE, & info) )
{
@@ -1005,7 +1005,7 @@ void wxMenuBar::SetLabelTop(size_t pos, const wxString& label)
info.cbSize = sizeof(info);
info.fMask = MIIM_TYPE;
info.fType = MFT_STRING;
info.cch = label.Length();
info.cch = label.length();
info.dwTypeData = (LPTSTR) label.c_str();
if ( !SetMenuItemInfo(GetHmenu(), id, TRUE, & info) )
{

View File

@@ -103,7 +103,7 @@ LRESULT APIENTRY _EXPORT wxNotebookWndProc(HWND hwnd,
// event table
// ----------------------------------------------------------------------------
#include <wx/listimpl.cpp>
#include "wx/listimpl.cpp"
WX_DEFINE_LIST( wxNotebookPageInfoList )
@@ -111,7 +111,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
EVT_SIZE(wxNotebook::OnSize)
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
@@ -472,12 +472,12 @@ wxString wxNotebook::GetPageText(size_t nPage) const
int wxNotebook::GetPageImage(size_t nPage) const
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
TC_ITEM tcItem;
tcItem.mask = TCIF_IMAGE;
return TabCtrl_GetItem(GetHwnd(), nPage, &tcItem) ? tcItem.iImage : -1;
return TabCtrl_GetItem(GetHwnd(), nPage, &tcItem) ? tcItem.iImage : wxNOT_FOUND;
}
bool wxNotebook::SetPageImage(size_t nPage, int nImage)

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: msw/urlmsw.cpp
// Name: src/msw/urlmsw.cpp
// Purpose: MS-Windows native URL support based on WinINet
// Author: Hajo Kirchhoff
// Modified by:
@@ -19,7 +19,7 @@
#if wxUSE_URL_NATIVE
#if !wxUSE_PROTOCOL_HTTP
#include <wx/protocol/protocol.h>
#include "wx/protocol/protocol.h"
// empty http protocol replacement (for now)
// so that wxUSE_URL_NATIVE can be used with
@@ -48,7 +48,7 @@ protected:
// the only "reason for being" for this class is to tell
// wxURL that there is someone dealing with the http protocol
IMPLEMENT_DYNAMIC_CLASS(wxHTTPDummyProto, wxProtocol)
IMPLEMENT_PROTOCOL(wxHTTPDummyProto, wxT("http"), NULL, FALSE)
IMPLEMENT_PROTOCOL(wxHTTPDummyProto, wxT("http"), NULL, false)
USE_PROTOCOL(wxHTTPDummyProto)
#endif // !wxUSE_PROTOCOL_HTTP
@@ -230,4 +230,3 @@ wxInputStream *wxWinINetURL::GetInputStream(wxURL *owner)
}
#endif // wxUSE_URL_NATIVE

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: helpwin.cpp
// Name: src/os2/helpwin.cpp
// Purpose: Help system: native implementation
// Author: David Webster
// Modified by:
@@ -21,7 +21,7 @@
#if wxUSE_HELP
#include <time.h>
#include <wx/os2/private.h>
#include "wx/os2/private.h"
#include <string.h>
@@ -58,11 +58,11 @@ bool wxWinHelpController::LoadFile(const wxString& file)
bool wxWinHelpController::DisplayContents()
{
if (m_helpFile == wxT(""))
if (m_helpFile.empty())
return false;
wxString str = m_helpFile;
size_t len = str.Length();
size_t len = str.length();
if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
str += wxT(".hlp");
@@ -71,17 +71,17 @@ bool wxWinHelpController::DisplayContents()
// TODO : display the help
return true;
}
return FALSE;
return false;
}
bool wxWinHelpController::DisplaySection(int WXUNUSED(section))
{
// Use context number
if (m_helpFile == wxT(""))
if (m_helpFile.empty())
return false;
wxString str = m_helpFile;
size_t len = str.Length();
size_t len = str.length();
if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
str += wxT(".hlp");
@@ -98,11 +98,11 @@ bool wxWinHelpController::DisplaySection(int WXUNUSED(section))
bool wxWinHelpController::DisplayBlock(long WXUNUSED(block))
{
// Use context number -- a very rough equivalent to block id!
if (m_helpFile == wxT(""))
if (m_helpFile.empty())
return false;
wxString str = m_helpFile;
size_t len = str.Length();
size_t len = str.length();
if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
str += wxT(".hlp");
@@ -118,10 +118,10 @@ bool wxWinHelpController::DisplayBlock(long WXUNUSED(block))
bool wxWinHelpController::KeywordSearch(const wxString& WXUNUSED(k),
wxHelpSearchMode WXUNUSED(mode))
{
if (m_helpFile == wxEmptyString) return FALSE;
if (m_helpFile == wxEmptyString) return false;
wxString str = m_helpFile;
size_t len = str.Length();
size_t len = str.length();
if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
str += wxT(".hlp");
@@ -131,7 +131,7 @@ bool wxWinHelpController::KeywordSearch(const wxString& WXUNUSED(k),
// WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k);
return true;
}
return FALSE;
return false;
}
// Can't close the help window explicitly in WinHelp

View File

@@ -4,6 +4,7 @@
// Author: David Webster
// Modified by:
// Created: 10/09/99
// RCS-ID: $Id$
// Copyright: David Webster
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@@ -12,20 +13,20 @@
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include <wx/string.h>
#include <wx/intl.h>
#include <wx/event.h>
#include <wx/app.h>
#include <wx/utils.h>
#include "wx/string.h"
#include "wx/intl.h"
#include "wx/event.h"
#include "wx/app.h"
#include "wx/utils.h"
#endif //WX_PRECOMP
#include <wx/dynarray.h>
#include <wx/log.h>
#include "wx/dynarray.h"
#include "wx/log.h"
#include <wx/config.h>
#include "wx/config.h"
#if wxUSE_CONFIG
#include <wx/os2/iniconf.h>
#include "wx/os2/iniconf.h"
#define INCL_PM
#include <os2.h>
@@ -72,7 +73,7 @@ wxIniConfig::wxIniConfig(const wxString& strAppName,
}
// set root path
SetPath(wxT(""));
SetPath(wxEmptyString);
}
wxIniConfig::~wxIniConfig()
@@ -307,21 +308,24 @@ bool wxIniConfig::Read(const wxString& szKey, wxString *pstr,
// first look in the private INI file
// NB: the lpDefault param to GetPrivateProfileString can't be NULL
// GetPrivateProfileString(m_strGroup, strKey, "",
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
if ( ::IsEmpty((PSZ)szBuf) ) {
// GetPrivateProfileString(m_strGroup, strKey, "",
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
if ( ::IsEmpty((PSZ)szBuf) )
{
// now look in win.ini
wxString strKey = GetKeyName(path.Name());
// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
}
if ( ::IsEmpty((PSZ)szBuf) ) {
if ( ::IsEmpty((PSZ)szBuf) )
{
*pstr = szDefault;
return FALSE;
return false;
}
else {
else
{
*pstr = szBuf ;
return TRUE;
return true;
}
}
@@ -336,24 +340,27 @@ bool wxIniConfig::Read(const wxString& szKey, long *pl) const
static const int nMagic = 17; // 17 is some "rare" number
static const int nMagic2 = 28; // arbitrary number != nMagic
long lVal = 0; // = GetPrivateProfileInt(m_strGroup, strKey, nMagic, m_strLocalFilename);
if ( lVal != nMagic ) {
if ( lVal != nMagic )
{
// the value was read from the file
*pl = lVal;
return TRUE;
return true;
}
// is it really nMagic?
// lVal = GetPrivateProfileInt(m_strGroup, strKey, nMagic2, m_strLocalFilename);
if ( lVal == nMagic2 ) {
// lVal = GetPrivateProfileInt(m_strGroup, strKey, nMagic2, m_strLocalFilename);
if ( lVal == nMagic2 )
{
// the nMagic it returned was indeed read from the file
*pl = lVal;
return TRUE;
return true;
}
// no, it was just returning the default value, so now look in win.ini
// *pl = GetProfileInt(GetVendorName(), GetKeyName(szKey), *pl);
// *pl = GetProfileInt(GetVendorName(), GetKeyName(szKey), *pl);
return TRUE;
return true;
}
bool wxIniConfig::Write(const wxString& szKey, const wxString& WXUNUSED(szValue))
@@ -382,8 +389,8 @@ bool wxIniConfig::Write(const wxString& szKey, long lValue)
bool wxIniConfig::Flush(bool /* bCurrentOnly */)
{
// this is just the way it works
// return WritePrivateProfileString(NULL, NULL, NULL, m_strLocalFilename) != 0;
return FALSE;
// return WritePrivateProfileString(NULL, NULL, NULL, m_strLocalFilename) != 0;
return false;
}
// ----------------------------------------------------------------------------
@@ -393,21 +400,21 @@ bool wxIniConfig::Flush(bool /* bCurrentOnly */)
bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso)
{
// passing NULL as value to WritePrivateProfileString deletes the key
// if ( !Write(szKey, (const char *)NULL) )
// return FALSE;
// if ( !Write(szKey, (const char *)NULL) )
// return false;
wxConfigPathChanger path(this, szKey);
wxString strKey = GetPrivateKeyName(path.Name());
// if (WritePrivateProfileString(m_strGroup, szKey,
// (const char*) NULL, m_strLocalFilename) == 0)
// return FALSE;
// if (WritePrivateProfileString(m_strGroup, szKey,
// (const char*) NULL, m_strLocalFilename) == 0)
// return false;
if ( !bGroupIfEmptyAlso || !IsEmpty() )
return TRUE;
return true;
// delete the current group too
bool bOk = FALSE; // = WritePrivateProfileString(m_strGroup, NULL,
// NULL, m_strLocalFilename) != 0;
bool bOk = false; // = WritePrivateProfileString(m_strGroup, NULL,
// NULL, m_strLocalFilename) != 0;
if ( !bOk )
wxLogLastError(wxT("WritePrivateProfileString"));
@@ -421,7 +428,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
// passing NULL as section name to WritePrivateProfileString deletes the
// whole section according to the docs
bool bOk = FALSE; // = WritePrivateProfileString(path.Name(), NULL,
bool bOk = false; // = WritePrivateProfileString(path.Name(), NULL,
// NULL, m_strLocalFilename) != 0;
if ( !bOk )
@@ -437,7 +444,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
bool wxIniConfig::DeleteAll()
{
// first delete our group in win.ini
// WriteProfileString(GetVendorName(), NULL, NULL);
// WriteProfileString(GetVendorName(), NULL, NULL);
// then delete our own ini file
wxChar szBuf[MAX_PATH];
@@ -454,12 +461,13 @@ bool wxIniConfig::DeleteAll()
wxString strFile = szBuf;
strFile << wxT('\\') << m_strLocalFilename;
if ( !wxRemoveFile(strFile) ) {
if ( !wxRemoveFile(strFile) )
{
wxLogSysError(_("Can't delete the INI file '%s'"), strFile.c_str());
return FALSE;
return false;
}
return TRUE;
return true;
}
bool wxIniConfig::RenameEntry(const wxString& WXUNUSED(oldName), const wxString& WXUNUSED(newName))

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: joystick.cpp
// Name: src/os2/joystick.cpp
// Purpose: wxJoystick class
// Author: David Webster
// Modified by:
@@ -25,8 +25,8 @@
#define NO_JOYGETPOSEX
#include <wx/window.h>
#include <wx/joystick.h>
#include "wx/window.h"
#include "wx/joystick.h"
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
@@ -122,7 +122,7 @@ int wxJoystick::GetProductId() const
wxString wxJoystick::GetProductName() const
{
// TODO
return wxString("");
return wxEmptyString;
}
int wxJoystick::GetXMin() const

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: slider.cpp
// Name: src/os2/slider.cpp
// Purpose: wxSlider
// Author: David Webster
// Modified by:
@@ -18,9 +18,9 @@
#ifndef WX_PRECOMP
#include <stdio.h>
#include <wx/utils.h>
#include <wx/brush.h>
#include <wx/scrolwin.h>
#include "wx/utils.h"
#include "wx/brush.h"
#include "wx/scrolwin.h"
#endif
#if wxUSE_SLIDER

View File

@@ -63,7 +63,7 @@ static const int idMenuTitle = -3;
// implementation
// ============================================================================
#include <wx/listimpl.cpp>
#include "wx/listimpl.cpp"
WX_DEFINE_LIST( wxMenuInfoList ) ;

View File

@@ -34,7 +34,7 @@
// event table
// ----------------------------------------------------------------------------
#include <wx/listimpl.cpp>
#include "wx/listimpl.cpp"
WX_DEFINE_LIST( wxNotebookPageInfoList ) ;

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: unix/mediactrl.cpp
// Name: src/unix/mediactrl.cpp
// Purpose: Built-in Media Backends for Unix
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
@@ -761,12 +761,7 @@ bool wxGStreamerMediaBackend::SetPlaybackRate(double dRate)
#endif //wxUSE_GSTREAMER
//in source file that contains stuff you don't directly use
#include <wx/html/forcelnk.h>
#include "wx/html/forcelnk.h"
FORCE_LINK_ME(basewxmediabackends);
#endif //wxUSE_MEDIACTRL

View File

@@ -770,7 +770,7 @@ KeySym wxCharCodeWXToX(int id)
// check current state of a key
// ----------------------------------------------------------------------------
#include <wx/app.h>
#include "wx/app.h"
bool wxGetKeyState(wxKeyCode key)
{