don't use obsolete functions (mostly copystring() and Count()), remove their documentation (patch 1697956)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-04-11 00:23:19 +00:00
parent 325cf48f5a
commit b4a980f4f5
28 changed files with 143 additions and 238 deletions

View File

@@ -242,7 +242,6 @@ Functions in this section return the total number of array elements and allow to
retrieve them - possibly using just the C array indexing $[]$ operator which retrieve them - possibly using just the C array indexing $[]$ operator which
does exactly the same as \helpref{Item()}{wxarrayitem} method. does exactly the same as \helpref{Item()}{wxarrayitem} method.
\helpref{Count}{wxarraycount}\\
\helpref{GetCount}{wxarraygetcount}\\ \helpref{GetCount}{wxarraygetcount}\\
\helpref{IsEmpty}{wxarrayisempty}\\ \helpref{IsEmpty}{wxarrayisempty}\\
\helpref{Item}{wxarrayitem}\\ \helpref{Item}{wxarrayitem}\\
@@ -515,13 +514,6 @@ the existing contents of the array is not modified.
This function does the same as \helpref{Empty()}{wxarrayempty} and additionally This function does the same as \helpref{Empty()}{wxarrayempty} and additionally
frees the memory allocated to the array. frees the memory allocated to the array.
\membersection{wxArray::Count}\label{wxarraycount}
\constfunc{size\_t}{Count}{\void}
Same as \helpref{GetCount()}{wxarraygetcount}. This function is deprecated -
it exists only for compatibility.
\membersection{wxObjArray::Detach}\label{wxobjarraydetach} \membersection{wxObjArray::Detach}\label{wxobjarraydetach}
\func{T *}{Detach}{\param{size\_t }{index}} \func{T *}{Detach}{\param{size\_t }{index}}

View File

@@ -144,14 +144,6 @@ Clears the array contents and frees memory.
See also: \helpref{Empty}{wxarraystringempty} See also: \helpref{Empty}{wxarraystringempty}
\membersection{wxArrayString::Count}\label{wxarraystringcount}
\constfunc{size\_t}{Count}{\void}
Returns the number of items in the array. This function is deprecated and is
for backwards compatibility only, please use
\helpref{GetCount}{wxarraystringgetcount} instead.
\membersection{wxArrayString::Empty}\label{wxarraystringempty} \membersection{wxArrayString::Empty}\label{wxarraystringempty}
\func{void}{Empty}{\void} \func{void}{Empty}{\void}

View File

@@ -267,17 +267,6 @@ Returns {\tt true} if the control is empty or {\tt false} if it has some items.
\helpref{GetCount}{wxcontrolwithitemsgetcount} \helpref{GetCount}{wxcontrolwithitemsgetcount}
\membersection{wxControlWithItems::Number}\label{wxcontrolwithitemsnumber}
\constfunc{int}{Number}{\void}
{\bf Obsolescence note:} This method is obsolete and was replaced with
\helpref{GetCount}{wxcontrolwithitemsgetcount}, please use the new method in
the new code. This method is only available if wxWidgets was compiled with
{\tt WXWIN\_COMPATIBILITY\_2\_2} defined and will disappear completely in
future versions.
\membersection{wxControlWithItems::Select}\label{wxcontrolwithitemsselect} \membersection{wxControlWithItems::Select}\label{wxcontrolwithitemsselect}
\func{void}{Select}{\param{int}{ n}} \func{void}{Select}{\param{int}{ n}}

View File

@@ -16,12 +16,6 @@ wxDynamicLibrary is a class representing dynamically loadable library
this class to load a library and don't worry about unloading it -- it will be this class to load a library and don't worry about unloading it -- it will be
done in the objects destructor automatically. done in the objects destructor automatically.
% deprecated now...
%
%\wxheading{See also}
%
%\helpref{wxDllLoader}{wxdllloader}
\wxheading{Derived from} \wxheading{Derived from}
No base class. No base class.

View File

@@ -20,7 +20,6 @@ the corresponding topic.
\section{Alphabetical functions and macros list}\label{functionsalphabetically} \section{Alphabetical functions and macros list}\label{functionsalphabetically}
\helpref{CLASSINFO}{classinfo}\\ \helpref{CLASSINFO}{classinfo}\\
\helpref{copystring}{copystring}\\
\helpref{DECLARE\_ABSTRACT\_CLASS}{declareabstractclass}\\ \helpref{DECLARE\_ABSTRACT\_CLASS}{declareabstractclass}\\
\helpref{DECLARE\_APP}{declareapp}\\ \helpref{DECLARE\_APP}{declareapp}\\
\helpref{DECLARE\_CLASS}{declareclass}\\ \helpref{DECLARE\_CLASS}{declareclass}\\
@@ -1614,17 +1613,6 @@ if successful, \false otherwise.
\section{String functions}\label{stringfunctions} \section{String functions}\label{stringfunctions}
\membersection{::copystring}\label{copystring}
\func{char *}{copystring}{\param{const char *}{s}}
Makes a copy of the string {\it s} using the C++ new operator, so it can be
deleted with the {\it delete} operator.
This function is deprecated, use \helpref{wxString}{wxstring} class instead.
\membersection{::wxGetTranslation}\label{wxgettranslation} \membersection{::wxGetTranslation}\label{wxgettranslation}
\func{const wxString\& }{wxGetTranslation}{\param{const wxString\& }{str}, \func{const wxString\& }{wxGetTranslation}{\param{const wxString\& }{str},

View File

@@ -73,10 +73,6 @@ With a popup menu, there is a variety of ways to handle a menu selection event
\item Set a new event handler for wxMenu, using an object whose class has EVT\_MENU entries. \item Set a new event handler for wxMenu, using an object whose class has EVT\_MENU entries.
\item Provide EVT\_MENU handlers in the window which pops up the menu, or in an ancestor of \item Provide EVT\_MENU handlers in the window which pops up the menu, or in an ancestor of
this window. this window.
\item Define a callback of type wxFunction, which you pass to the wxMenu constructor.
The callback takes a reference to the menu, and a reference to a
\helpref{wxCommandEvent}{wxcommandevent}. This method is deprecated and should
not be used in the new code, it is provided for backwards compatibility only.
\end{enumerate} \end{enumerate}
\wxheading{See also} \wxheading{See also}

View File

@@ -149,7 +149,7 @@ public:
{ {
wxASSERT_MSG( !IsEmpty(), wxASSERT_MSG( !IsEmpty(),
_T("wxArrayString: index out of bounds") ); _T("wxArrayString: index out of bounds") );
return Item(Count() - 1); return Item(GetCount() - 1);
} }

View File

@@ -589,8 +589,8 @@ public:
virtual void AddFilesToMenu(wxMenu* menu); // Single menu virtual void AddFilesToMenu(wxMenu* menu); // Single menu
// Accessors // Accessors
virtual wxString GetHistoryFile(size_t i) const; virtual wxString GetHistoryFile(size_t i) const { return m_fileHistory[i]; }
virtual size_t GetCount() const { return m_fileHistoryN; } virtual size_t GetCount() const { return m_fileHistory.GetCount(); }
const wxList& GetMenus() const { return m_fileMenus; } const wxList& GetMenus() const { return m_fileMenus; }
@@ -605,11 +605,11 @@ public:
protected: protected:
// Last n files // Last n files
wxChar** m_fileHistory; wxArrayString m_fileHistory;
// Number of files saved
size_t m_fileHistoryN;
// Menus to maintain (may need several for an MDI app) // Menus to maintain (may need several for an MDI app)
wxList m_fileMenus; wxList m_fileMenus;
// Max files to maintain // Max files to maintain
size_t m_fileMaxFiles; size_t m_fileMaxFiles;

View File

@@ -287,7 +287,7 @@ public: \
T& Item(size_t uiIndex) const \ T& Item(size_t uiIndex) const \
{ return (T&)/*const cast*/base::operator[](uiIndex); } \ { return (T&)/*const cast*/base::operator[](uiIndex); } \
T& Last() const \ T& Last() const \
{ return Item(Count() - 1); } \ { return Item(GetCount() - 1); } \
\ \
int Index(T e, bool bFromEnd = false) const \ int Index(T e, bool bFromEnd = false) const \
{ return base::Index(e, bFromEnd); } \ { return base::Index(e, bFromEnd); } \
@@ -336,7 +336,7 @@ public: \
T& Item(size_t uiIndex) const \ T& Item(size_t uiIndex) const \
{ return (T&)(base::operator[](uiIndex)); } \ { return (T&)(base::operator[](uiIndex)); } \
T& Last() const \ T& Last() const \
{ return (T&)(base::operator[](Count() - 1)); } \ { return (T&)(base::operator[](GetCount() - 1)); } \
\ \
int Index(T lItem, bool bFromEnd = false) const \ int Index(T lItem, bool bFromEnd = false) const \
{ return base::Index((base_type)lItem, bFromEnd); } \ { return base::Index((base_type)lItem, bFromEnd); } \

View File

@@ -108,9 +108,11 @@ public:
virtual void SetAccel(wxAcceleratorEntry *accel); virtual void SetAccel(wxAcceleratorEntry *accel);
#endif // wxUSE_ACCEL #endif // wxUSE_ACCEL
#if WXWIN_COMPATIBILITY_2_8
// compatibility only, use new functions in the new code // compatibility only, use new functions in the new code
void SetName(const wxString& str) { SetText(str); } wxDEPRECATED( void SetName(const wxString& str) );
const wxString& GetName() const { return GetText(); } wxDEPRECATED( const wxString& GetName() const );
#endif // WXWIN_COMPATIBILITY_2_8
static wxMenuItem *New(wxMenu *parentMenu, static wxMenuItem *New(wxMenu *parentMenu,
int itemid, int itemid,
@@ -148,6 +150,13 @@ private:
wxMenuItemBase& operator=(const wxMenuItemBase& item); wxMenuItemBase& operator=(const wxMenuItemBase& item);
}; };
#if WXWIN_COMPATIBILITY_2_8
void wxMenuItem::SetName(const wxString &str)
{ SetText(str); }
const wxString& wxMenuItem::GetName() const
{ return GetText(); }
#endif // WXWIN_COMPATIBILITY_2_8
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// include the real class declaration // include the real class declaration
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -221,7 +221,7 @@ private:
// Returns internal number of pages which can be different from // Returns internal number of pages which can be different from
// GetPageCount() while performing a page insertion or removal. // GetPageCount() while performing a page insertion or removal.
size_t DoInternalGetPageCount() const { return m_treeIds.Count(); } size_t DoInternalGetPageCount() const { return m_treeIds.GetCount(); }
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()

View File

@@ -258,7 +258,7 @@ void wxBookCtrlBase::DoSize()
// resize all pages to fit the new control size // resize all pages to fit the new control size
const wxRect pageRect = GetPageRect(); const wxRect pageRect = GetPageRect();
const unsigned pagesCount = m_pages.Count(); const unsigned pagesCount = m_pages.GetCount();
for ( unsigned int i = 0; i < pagesCount; ++i ) for ( unsigned int i = 0; i < pagesCount; ++i )
{ {
wxWindow * const page = m_pages[i]; wxWindow * const page = m_pages[i];

View File

@@ -526,7 +526,7 @@ wxString wxCmdLineParser::GetParam(size_t n) const
// Resets switches and options // Resets switches and options
void wxCmdLineParser::Reset() void wxCmdLineParser::Reset()
{ {
for ( size_t i = 0; i < m_data->m_options.Count(); i++ ) for ( size_t i = 0; i < m_data->m_options.GetCount(); i++ )
{ {
wxCmdLineOption& opt = m_data->m_options[i]; wxCmdLineOption& opt = m_data->m_options[i];
opt.SetHasValue(false); opt.SetHasValue(false);

View File

@@ -59,6 +59,7 @@
#include "wx/file.h" #include "wx/file.h"
#include "wx/cmdproc.h" #include "wx/cmdproc.h"
#include "wx/tokenzr.h" #include "wx/tokenzr.h"
#include "wx/filename.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -2085,50 +2086,28 @@ void wxDocPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, in
// File history processor // File history processor
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static inline wxChar* MYcopystring(const wxString& s)
{
wxChar* copy = new wxChar[s.length() + 1];
return wxStrcpy(copy, s.c_str());
}
static inline wxChar* MYcopystring(const wxChar* s)
{
wxChar* copy = new wxChar[wxStrlen(s) + 1];
return wxStrcpy(copy, s);
}
wxFileHistory::wxFileHistory(size_t maxFiles, wxWindowID idBase) wxFileHistory::wxFileHistory(size_t maxFiles, wxWindowID idBase)
{ {
m_fileMaxFiles = maxFiles; m_fileMaxFiles = maxFiles;
m_idBase = idBase; m_idBase = idBase;
m_fileHistoryN = 0;
m_fileHistory = new wxChar *[m_fileMaxFiles];
} }
wxFileHistory::~wxFileHistory() wxFileHistory::~wxFileHistory()
{ {
size_t i;
for (i = 0; i < m_fileHistoryN; i++)
delete[] m_fileHistory[i];
delete[] m_fileHistory;
} }
// File history management
void wxFileHistory::AddFileToHistory(const wxString& file) void wxFileHistory::AddFileToHistory(const wxString& file)
{ {
wxFileName fn(file);
size_t i; size_t i;
// Check we don't already have this file // Check we don't already have this file
for (i = 0; i < m_fileHistoryN; i++) for (i = 0; i < m_fileHistory.GetCount(); i++)
{ {
#if defined( __WXMSW__ ) // Add any other OSes with case insensitive file names // we need to do a comparison using wxFileNames because it knows
wxString testString; // how to exactly compare files on the different platforms
if ( m_fileHistory[i] ) // (e.g. handle case [in]sensitive filesystems)
testString = m_fileHistory[i]; if ( fn == wxFileName(m_fileHistory[i]) )
if ( m_fileHistory[i] && ( file.Lower() == testString.Lower() ) )
#else
if ( m_fileHistory[i] && ( file == m_fileHistory[i] ) )
#endif
{ {
// we do have it, move it to the top of the history // we do have it, move it to the top of the history
RemoveFileFromHistory (i); RemoveFileFromHistory (i);
@@ -2138,43 +2117,36 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
} }
// if we already have a full history, delete the one at the end // if we already have a full history, delete the one at the end
if ( m_fileMaxFiles == m_fileHistoryN ) if ( m_fileMaxFiles == m_fileHistory.GetCount() )
{ {
RemoveFileFromHistory (m_fileHistoryN - 1); RemoveFileFromHistory (m_fileHistory.GetCount() - 1);
AddFileToHistory (file); AddFileToHistory (file);
return; return;
} }
// Add to the project file history: // Add to the project file history:
// Move existing files (if any) down so we can insert file at beginning. // Move existing files (if any) down so we can insert file at beginning.
if (m_fileHistoryN < m_fileMaxFiles) if (m_fileHistory.GetCount() < m_fileMaxFiles)
{ {
wxList::compatibility_iterator node = m_fileMenus.GetFirst(); wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while (node) while (node)
{ {
wxMenu* menu = (wxMenu*) node->GetData(); wxMenu* menu = (wxMenu*) node->GetData();
if ( m_fileHistoryN == 0 && menu->GetMenuItemCount() ) if ( m_fileHistory.IsEmpty() && menu->GetMenuItemCount() )
{ {
menu->AppendSeparator(); menu->AppendSeparator();
} }
menu->Append(m_idBase+m_fileHistoryN, _("[EMPTY]")); menu->Append(m_idBase+m_fileHistory.GetCount(), _("[EMPTY]"));
node = node->GetNext(); node = node->GetNext();
} }
m_fileHistoryN ++;
} }
// Shuffle filenames down
for (i = (m_fileHistoryN-1); i > 0; i--) m_fileHistory.Insert(file, 0);
{
m_fileHistory[i] = m_fileHistory[i-1];
}
m_fileHistory[0] = MYcopystring(file);
// this is the directory of the last opened file // this is the directory of the last opened file
wxString pathCurrent; wxString pathCurrent;
wxSplitPath( m_fileHistory[0], &pathCurrent, NULL, NULL ); wxSplitPath( m_fileHistory[0], &pathCurrent, NULL, NULL );
for (i = 0; i < m_fileHistoryN; i++) for (i = 0; i < m_fileHistory.GetCount(); i++)
{
if ( m_fileHistory[i] )
{ {
// if in same directory just show the filename; otherwise the full // if in same directory just show the filename; otherwise the full
// path // path
@@ -2194,8 +2166,10 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
// we need to quote '&' characters which are used for mnemonics // we need to quote '&' characters which are used for mnemonics
pathInMenu.Replace(_T("&"), _T("&&")); pathInMenu.Replace(_T("&"), _T("&&"));
wxString buf; wxString buf;
buf.Printf(s_MRUEntryFormat, i + 1, pathInMenu.c_str()); buf.Printf(s_MRUEntryFormat, i + 1, pathInMenu.c_str());
wxList::compatibility_iterator node = m_fileMenus.GetFirst(); wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while (node) while (node)
{ {
@@ -2204,22 +2178,15 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
node = node->GetNext(); node = node->GetNext();
} }
} }
}
} }
void wxFileHistory::RemoveFileFromHistory(size_t i) void wxFileHistory::RemoveFileFromHistory(size_t i)
{ {
wxCHECK_RET( i < m_fileHistoryN, wxCHECK_RET( i < m_fileHistory.GetCount(),
wxT("invalid index in wxFileHistory::RemoveFileFromHistory") ); wxT("invalid index in wxFileHistory::RemoveFileFromHistory") );
// delete the element from the array (could use memmove() too...) // delete the element from the array
delete [] m_fileHistory[i]; m_fileHistory.RemoveAt(i);
size_t j;
for ( j = i; j < m_fileHistoryN - 1; j++ )
{
m_fileHistory[j] = m_fileHistory[j + 1];
}
wxList::compatibility_iterator node = m_fileMenus.GetFirst(); wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while ( node ) while ( node )
@@ -2228,23 +2195,23 @@ void wxFileHistory::RemoveFileFromHistory(size_t i)
// shuffle filenames up // shuffle filenames up
wxString buf; wxString buf;
for ( j = i; j < m_fileHistoryN - 1; j++ ) for ( size_t j = i; j < m_fileHistory.GetCount(); j++ )
{ {
buf.Printf(s_MRUEntryFormat, j + 1, m_fileHistory[j]); buf.Printf(s_MRUEntryFormat, j + 1, m_fileHistory[j].c_str());
menu->SetLabel(m_idBase + j, buf); menu->SetLabel(m_idBase + j, buf);
} }
node = node->GetNext(); node = node->GetNext();
// delete the last menu item which is unused now // delete the last menu item which is unused now
wxWindowID lastItemId = m_idBase + wx_truncate_cast(wxWindowID, m_fileHistoryN) - 1; wxWindowID lastItemId = m_idBase + wx_truncate_cast(wxWindowID, m_fileHistory.GetCount());
if (menu->FindItem(lastItemId)) if (menu->FindItem(lastItemId))
{ {
menu->Delete(lastItemId); menu->Delete(lastItemId);
} }
// delete the last separator too if no more files are left // delete the last separator too if no more files are left
if ( m_fileHistoryN == 1 ) if ( m_fileHistory.GetCount() == 0 )
{ {
wxMenuItemList::compatibility_iterator nodeLast = menu->GetMenuItems().GetLast(); wxMenuItemList::compatibility_iterator nodeLast = menu->GetMenuItems().GetLast();
if ( nodeLast ) if ( nodeLast )
@@ -2259,23 +2226,6 @@ void wxFileHistory::RemoveFileFromHistory(size_t i)
//else: menu is empty somehow //else: menu is empty somehow
} }
} }
m_fileHistoryN--;
}
wxString wxFileHistory::GetHistoryFile(size_t i) const
{
wxString s;
if ( i < m_fileHistoryN )
{
s = m_fileHistory[i];
}
else
{
wxFAIL_MSG( wxT("bad index in wxFileHistory::GetHistoryFile") );
}
return s;
} }
void wxFileHistory::UseMenu(wxMenu *menu) void wxFileHistory::UseMenu(wxMenu *menu)
@@ -2292,17 +2242,21 @@ void wxFileHistory::RemoveMenu(wxMenu *menu)
#if wxUSE_CONFIG #if wxUSE_CONFIG
void wxFileHistory::Load(wxConfigBase& config) void wxFileHistory::Load(wxConfigBase& config)
{ {
m_fileHistoryN = 0; m_fileHistory.Clear();
wxString buf; wxString buf;
buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1); buf.Printf(wxT("file%d"), 1);
wxString historyFile; wxString historyFile;
while ((m_fileHistoryN < m_fileMaxFiles) && config.Read(buf, &historyFile) && (!historyFile.empty())) while ((m_fileHistory.GetCount() < m_fileMaxFiles) &&
config.Read(buf, &historyFile) && !historyFile.empty())
{ {
m_fileHistory[m_fileHistoryN] = MYcopystring((const wxChar*) historyFile); m_fileHistory.Add(historyFile);
m_fileHistoryN ++;
buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1); buf.Printf(wxT("file%d"), (int)m_fileHistory.GetCount()+1);
historyFile = wxEmptyString; historyFile = wxEmptyString;
} }
AddFilesToMenu(); AddFilesToMenu();
} }
@@ -2313,7 +2267,7 @@ void wxFileHistory::Save(wxConfigBase& config)
{ {
wxString buf; wxString buf;
buf.Printf(wxT("file%d"), (int)i+1); buf.Printf(wxT("file%d"), (int)i+1);
if (i < m_fileHistoryN) if (i < m_fileHistory.GetCount())
config.Write(buf, wxString(m_fileHistory[i])); config.Write(buf, wxString(m_fileHistory[i]));
else else
config.Write(buf, wxEmptyString); config.Write(buf, wxEmptyString);
@@ -2323,7 +2277,7 @@ void wxFileHistory::Save(wxConfigBase& config)
void wxFileHistory::AddFilesToMenu() void wxFileHistory::AddFilesToMenu()
{ {
if (m_fileHistoryN > 0) if (m_fileHistory.GetCount() > 0)
{ {
wxList::compatibility_iterator node = m_fileMenus.GetFirst(); wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while (node) while (node)
@@ -2335,15 +2289,12 @@ void wxFileHistory::AddFilesToMenu()
} }
size_t i; size_t i;
for (i = 0; i < m_fileHistoryN; i++) for (i = 0; i < m_fileHistory.GetCount(); i++)
{
if (m_fileHistory[i])
{ {
wxString buf; wxString buf;
buf.Printf(s_MRUEntryFormat, i+1, m_fileHistory[i]); buf.Printf(s_MRUEntryFormat, i+1, m_fileHistory[i].c_str());
menu->Append(m_idBase+i, buf); menu->Append(m_idBase+i, buf);
} }
}
node = node->GetNext(); node = node->GetNext();
} }
} }
@@ -2351,7 +2302,7 @@ void wxFileHistory::AddFilesToMenu()
void wxFileHistory::AddFilesToMenu(wxMenu* menu) void wxFileHistory::AddFilesToMenu(wxMenu* menu)
{ {
if (m_fileHistoryN > 0) if (m_fileHistory.GetCount() > 0)
{ {
if (menu->GetMenuItemCount()) if (menu->GetMenuItemCount())
{ {
@@ -2359,16 +2310,13 @@ void wxFileHistory::AddFilesToMenu(wxMenu* menu)
} }
size_t i; size_t i;
for (i = 0; i < m_fileHistoryN; i++) for (i = 0; i < m_fileHistory.GetCount(); i++)
{
if (m_fileHistory[i])
{ {
wxString buf; wxString buf;
buf.Printf(s_MRUEntryFormat, i+1, m_fileHistory[i]); buf.Printf(s_MRUEntryFormat, i+1, m_fileHistory[i].c_str());
menu->Append(m_idBase+i, buf); menu->Append(m_idBase+i, buf);
} }
} }
}
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -728,7 +728,7 @@ wxFileConfig::DoSetPath(const wxString& strPath, bool createMissingComponents)
// change current group // change current group
size_t n; size_t n;
m_pCurrentGroup = m_pRootGroup; m_pCurrentGroup = m_pRootGroup;
for ( n = 0; n < aParts.Count(); n++ ) { for ( n = 0; n < aParts.GetCount(); n++ ) {
wxFileConfigGroup *pNextGroup = m_pCurrentGroup->FindSubgroup(aParts[n]); wxFileConfigGroup *pNextGroup = m_pCurrentGroup->FindSubgroup(aParts[n]);
if ( pNextGroup == NULL ) if ( pNextGroup == NULL )
{ {
@@ -743,7 +743,7 @@ wxFileConfig::DoSetPath(const wxString& strPath, bool createMissingComponents)
// recombine path parts in one variable // recombine path parts in one variable
m_strPath.Empty(); m_strPath.Empty();
for ( n = 0; n < aParts.Count(); n++ ) { for ( n = 0; n < aParts.GetCount(); n++ ) {
m_strPath << wxCONFIG_PATH_SEPARATOR << aParts[n]; m_strPath << wxCONFIG_PATH_SEPARATOR << aParts[n];
} }
@@ -767,7 +767,7 @@ bool wxFileConfig::GetFirstGroup(wxString& str, long& lIndex) const
bool wxFileConfig::GetNextGroup (wxString& str, long& lIndex) const bool wxFileConfig::GetNextGroup (wxString& str, long& lIndex) const
{ {
if ( size_t(lIndex) < m_pCurrentGroup->Groups().Count() ) { if ( size_t(lIndex) < m_pCurrentGroup->Groups().GetCount() ) {
str = m_pCurrentGroup->Groups()[(size_t)lIndex++]->Name(); str = m_pCurrentGroup->Groups()[(size_t)lIndex++]->Name();
return true; return true;
} }
@@ -783,7 +783,7 @@ bool wxFileConfig::GetFirstEntry(wxString& str, long& lIndex) const
bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const
{ {
if ( size_t(lIndex) < m_pCurrentGroup->Entries().Count() ) { if ( size_t(lIndex) < m_pCurrentGroup->Entries().GetCount() ) {
str = m_pCurrentGroup->Entries()[(size_t)lIndex++]->Name(); str = m_pCurrentGroup->Entries()[(size_t)lIndex++]->Name();
return true; return true;
} }
@@ -793,10 +793,10 @@ bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const
size_t wxFileConfig::GetNumberOfEntries(bool bRecursive) const size_t wxFileConfig::GetNumberOfEntries(bool bRecursive) const
{ {
size_t n = m_pCurrentGroup->Entries().Count(); size_t n = m_pCurrentGroup->Entries().GetCount();
if ( bRecursive ) { if ( bRecursive ) {
wxFileConfigGroup *pOldCurrentGroup = m_pCurrentGroup; wxFileConfigGroup *pOldCurrentGroup = m_pCurrentGroup;
size_t nSubgroups = m_pCurrentGroup->Groups().Count(); size_t nSubgroups = m_pCurrentGroup->Groups().GetCount();
for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) { for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup]; CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfEntries(true); n += GetNumberOfEntries(true);
@@ -809,10 +809,10 @@ size_t wxFileConfig::GetNumberOfEntries(bool bRecursive) const
size_t wxFileConfig::GetNumberOfGroups(bool bRecursive) const size_t wxFileConfig::GetNumberOfGroups(bool bRecursive) const
{ {
size_t n = m_pCurrentGroup->Groups().Count(); size_t n = m_pCurrentGroup->Groups().GetCount();
if ( bRecursive ) { if ( bRecursive ) {
wxFileConfigGroup *pOldCurrentGroup = m_pCurrentGroup; wxFileConfigGroup *pOldCurrentGroup = m_pCurrentGroup;
size_t nSubgroups = m_pCurrentGroup->Groups().Count(); size_t nSubgroups = m_pCurrentGroup->Groups().GetCount();
for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) { for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) {
CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup]; CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup];
n += GetNumberOfGroups(true); n += GetNumberOfGroups(true);
@@ -1339,12 +1339,12 @@ wxFileConfigGroup::wxFileConfigGroup(wxFileConfigGroup *pParent,
wxFileConfigGroup::~wxFileConfigGroup() wxFileConfigGroup::~wxFileConfigGroup()
{ {
// entries // entries
size_t n, nCount = m_aEntries.Count(); size_t n, nCount = m_aEntries.GetCount();
for ( n = 0; n < nCount; n++ ) for ( n = 0; n < nCount; n++ )
delete m_aEntries[n]; delete m_aEntries[n];
// subgroups // subgroups
nCount = m_aSubgroups.Count(); nCount = m_aSubgroups.GetCount();
for ( n = 0; n < nCount; n++ ) for ( n = 0; n < nCount; n++ )
delete m_aSubgroups[n]; delete m_aSubgroups[n];
} }
@@ -1507,7 +1507,7 @@ void wxFileConfigGroup::UpdateGroupAndSubgroupsLines()
// also update all subgroups as they have this groups name in their lines // also update all subgroups as they have this groups name in their lines
const size_t nCount = m_aSubgroups.Count(); const size_t nCount = m_aSubgroups.GetCount();
for ( size_t n = 0; n < nCount; n++ ) for ( size_t n = 0; n < nCount; n++ )
{ {
m_aSubgroups[n]->UpdateGroupAndSubgroupsLines(); m_aSubgroups[n]->UpdateGroupAndSubgroupsLines();
@@ -1552,7 +1552,7 @@ wxFileConfigGroup::FindEntry(const wxChar *szName) const
{ {
size_t i, size_t i,
lo = 0, lo = 0,
hi = m_aEntries.Count(); hi = m_aEntries.GetCount();
int res; int res;
wxFileConfigEntry *pEntry; wxFileConfigEntry *pEntry;
@@ -1582,7 +1582,7 @@ wxFileConfigGroup::FindSubgroup(const wxChar *szName) const
{ {
size_t i, size_t i,
lo = 0, lo = 0,
hi = m_aSubgroups.Count(); hi = m_aSubgroups.GetCount();
int res; int res;
wxFileConfigGroup *pGroup; wxFileConfigGroup *pGroup;
@@ -1673,7 +1673,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
: wxEmptyString ); : wxEmptyString );
// delete all entries... // delete all entries...
size_t nCount = pGroup->m_aEntries.Count(); size_t nCount = pGroup->m_aEntries.GetCount();
wxLogTrace(FILECONF_TRACE_MASK, wxLogTrace(FILECONF_TRACE_MASK,
_T("Removing %lu entries"), (unsigned long)nCount ); _T("Removing %lu entries"), (unsigned long)nCount );
@@ -1692,7 +1692,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
} }
// ...and subgroups of this subgroup // ...and subgroups of this subgroup
nCount = pGroup->m_aSubgroups.Count(); nCount = pGroup->m_aSubgroups.GetCount();
wxLogTrace( FILECONF_TRACE_MASK, wxLogTrace( FILECONF_TRACE_MASK,
_T("Removing %lu subgroups"), (unsigned long)nCount ); _T("Removing %lu subgroups"), (unsigned long)nCount );
@@ -1726,7 +1726,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
// our last entry is being deleted, so find the last one which // our last entry is being deleted, so find the last one which
// stays by going back until we find a subgroup or reach the // stays by going back until we find a subgroup or reach the
// group line // group line
const size_t nSubgroups = m_aSubgroups.Count(); const size_t nSubgroups = m_aSubgroups.GetCount();
m_pLastGroup = NULL; m_pLastGroup = NULL;
for ( wxFileConfigLineList *pl = pLine->Prev(); for ( wxFileConfigLineList *pl = pLine->Prev();
@@ -1781,7 +1781,7 @@ bool wxFileConfigGroup::DeleteEntry(const wxChar *szName)
// go back until we find another entry or reach the group's line // go back until we find another entry or reach the group's line
wxFileConfigEntry *pNewLast = NULL; wxFileConfigEntry *pNewLast = NULL;
size_t n, nEntries = m_aEntries.Count(); size_t n, nEntries = m_aEntries.GetCount();
wxFileConfigLineList *pl; wxFileConfigLineList *pl;
for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) { for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) {
// is it our subgroup? // is it our subgroup?

View File

@@ -951,7 +951,7 @@ int wxFTP::GetFileSize(const wxString& fileName)
bool foundIt = false; bool foundIt = false;
size_t i; size_t i;
for ( i = 0; !foundIt && i < fileList.Count(); i++ ) for ( i = 0; !foundIt && i < fileList.GetCount(); i++ )
{ {
foundIt = fileList[i].Upper().Contains(fileName.Upper()); foundIt = fileList[i].Upper().Contains(fileName.Upper());
} }

View File

@@ -218,7 +218,7 @@ wxTextFileType wxTextBuffer::GuessType() const
// we take MAX_LINES_SCAN in the beginning, middle and the end of buffer // we take MAX_LINES_SCAN in the beginning, middle and the end of buffer
#define MAX_LINES_SCAN (10) #define MAX_LINES_SCAN (10)
size_t nCount = m_aLines.Count() / 3, size_t nCount = m_aLines.GetCount() / 3,
nScan = nCount > 3*MAX_LINES_SCAN ? MAX_LINES_SCAN : nCount / 3; nScan = nCount > 3*MAX_LINES_SCAN ? MAX_LINES_SCAN : nCount / 3;
#define AnalyseLine(n) \ #define AnalyseLine(n) \

View File

@@ -894,7 +894,6 @@ wxChar *wxStripMenuCodes(const wxChar *in, wxChar *out)
} }
else else
{ {
// MYcopystring - for easier search...
out = new wxChar[s.length() + 1]; out = new wxChar[s.length() + 1];
wxStrcpy(out, s.c_str()); wxStrcpy(out, s.c_str());
} }

View File

@@ -883,7 +883,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
// Add the sorted dirs // Add the sorted dirs
size_t i; size_t i;
for (i = 0; i < dirs.Count(); i++) for (i = 0; i < dirs.GetCount(); i++)
{ {
eachFilename = dirs[i]; eachFilename = dirs[i];
path = dirName; path = dirName;
@@ -912,7 +912,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
// Add the sorted filenames // Add the sorted filenames
if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0) if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0)
{ {
for (i = 0; i < filenames.Count(); i++) for (i = 0; i < filenames.GetCount(); i++)
{ {
eachFilename = filenames[i]; eachFilename = filenames[i];
path = dirName; path = dirName;

View File

@@ -2717,7 +2717,7 @@ int wxGridCellAttrData::FindIndex(int row, int col) const
wxGridRowOrColAttrData::~wxGridRowOrColAttrData() wxGridRowOrColAttrData::~wxGridRowOrColAttrData()
{ {
size_t count = m_attrs.Count(); size_t count = m_attrs.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
m_attrs[n]->DecRef(); m_attrs[n]->DecRef();
@@ -2958,7 +2958,7 @@ void wxGridCellAttrProvider::UpdateAttrCols( size_t pos, int numCols )
wxGridTypeRegistry::~wxGridTypeRegistry() wxGridTypeRegistry::~wxGridTypeRegistry()
{ {
size_t count = m_typeinfo.Count(); size_t count = m_typeinfo.GetCount();
for ( size_t i = 0; i < count; i++ ) for ( size_t i = 0; i < count; i++ )
delete m_typeinfo[i]; delete m_typeinfo[i];
} }

View File

@@ -290,7 +290,7 @@ void wxLogGui::Flush()
wxString title; wxString title;
title.Printf(titleFormat, appName.c_str()); title.Printf(titleFormat, appName.c_str());
size_t nMsgCount = m_aMessages.Count(); size_t nMsgCount = m_aMessages.GetCount();
// avoid showing other log dialogs until we're done with the dialog we're // avoid showing other log dialogs until we're done with the dialog we're
// showing right now: nested modal dialogs make for really bad UI! // showing right now: nested modal dialogs make for really bad UI!

View File

@@ -548,7 +548,7 @@ wxGenericTreeItem::~wxGenericTreeItem()
void wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl *tree) void wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl *tree)
{ {
size_t count = m_children.Count(); size_t count = m_children.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
wxGenericTreeItem *child = m_children[n]; wxGenericTreeItem *child = m_children[n];
@@ -570,7 +570,7 @@ void wxGenericTreeItem::SetText( const wxString &text )
size_t wxGenericTreeItem::GetChildrenCount(bool recursively) const size_t wxGenericTreeItem::GetChildrenCount(bool recursively) const
{ {
size_t count = m_children.Count(); size_t count = m_children.GetCount();
if ( !recursively ) if ( !recursively )
return count; return count;
@@ -593,7 +593,7 @@ void wxGenericTreeItem::GetSize( int &x, int &y,
if (IsExpanded()) if (IsExpanded())
{ {
size_t count = m_children.Count(); size_t count = m_children.GetCount();
for ( size_t n = 0; n < count; ++n ) for ( size_t n = 0; n < count; ++n )
{ {
m_children[n]->GetSize( x, y, theButton ); m_children[n]->GetSize( x, y, theButton );
@@ -668,7 +668,7 @@ wxGenericTreeItem *wxGenericTreeItem::HitTest(const wxPoint& point,
} }
// evaluate children // evaluate children
size_t count = m_children.Count(); size_t count = m_children.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
wxGenericTreeItem *res = m_children[n]->HitTest( point, wxGenericTreeItem *res = m_children[n]->HitTest( point,
@@ -1203,7 +1203,7 @@ wxTreeItemId wxGenericTreeCtrl::GetNextChild(const wxTreeItemId& item,
// it's ok to cast cookie to size_t, we never have indices big enough to // it's ok to cast cookie to size_t, we never have indices big enough to
// overflow "void *" // overflow "void *"
size_t *pIndex = (size_t *)&cookie; size_t *pIndex = (size_t *)&cookie;
if ( *pIndex < children.Count() ) if ( *pIndex < children.GetCount() )
{ {
return children.Item((*pIndex)++); return children.Item((*pIndex)++);
} }
@@ -1239,7 +1239,7 @@ wxTreeItemId wxGenericTreeCtrl::GetNextSibling(const wxTreeItemId& item) const
wxASSERT( index != wxNOT_FOUND ); // I'm not a child of my parent? wxASSERT( index != wxNOT_FOUND ); // I'm not a child of my parent?
size_t n = (size_t)(index + 1); size_t n = (size_t)(index + 1);
return n == siblings.Count() ? wxTreeItemId() : wxTreeItemId(siblings[n]); return n == siblings.GetCount() ? wxTreeItemId() : wxTreeItemId(siblings[n]);
} }
wxTreeItemId wxGenericTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const wxTreeItemId wxGenericTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const
@@ -1636,7 +1636,7 @@ void wxGenericTreeCtrl::Collapse(const wxTreeItemId& itemId)
#if 0 // TODO why should items be collapsed recursively? #if 0 // TODO why should items be collapsed recursively?
wxArrayGenericTreeItems& children = item->GetChildren(); wxArrayGenericTreeItems& children = item->GetChildren();
size_t count = children.Count(); size_t count = children.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
Collapse(children[n]); Collapse(children[n]);
@@ -1690,7 +1690,7 @@ void wxGenericTreeCtrl::UnselectAllChildren(wxGenericTreeItem *item)
if (item->HasChildren()) if (item->HasChildren())
{ {
wxArrayGenericTreeItems& children = item->GetChildren(); wxArrayGenericTreeItems& children = item->GetChildren();
size_t count = children.Count(); size_t count = children.GetCount();
for ( size_t n = 0; n < count; ++n ) for ( size_t n = 0; n < count; ++n )
{ {
UnselectAllChildren(children[n]); UnselectAllChildren(children[n]);
@@ -1726,7 +1726,7 @@ bool wxGenericTreeCtrl::TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTr
int index = children.Index(crt_item); int index = children.Index(crt_item);
wxASSERT( index != wxNOT_FOUND ); // I'm not a child of my parent? wxASSERT( index != wxNOT_FOUND ); // I'm not a child of my parent?
size_t count = children.Count(); size_t count = children.GetCount();
for (size_t n=(size_t)(index+1); n<count; ++n) for (size_t n=(size_t)(index+1); n<count; ++n)
{ {
if (TagAllChildrenUntilLast(children[n], last_item, select)) return true; if (TagAllChildrenUntilLast(children[n], last_item, select)) return true;
@@ -1746,7 +1746,7 @@ bool wxGenericTreeCtrl::TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxG
if (crt_item->HasChildren()) if (crt_item->HasChildren())
{ {
wxArrayGenericTreeItems& children = crt_item->GetChildren(); wxArrayGenericTreeItems& children = crt_item->GetChildren();
size_t count = children.Count(); size_t count = children.GetCount();
for ( size_t n = 0; n < count; ++n ) for ( size_t n = 0; n < count; ++n )
{ {
if (TagAllChildrenUntilLast(children[n], last_item, select)) if (TagAllChildrenUntilLast(children[n], last_item, select))
@@ -1908,7 +1908,7 @@ size_t wxGenericTreeCtrl::GetSelections(wxArrayTreeItemIds &array) const
} }
//else: the tree is empty, so no selections //else: the tree is empty, so no selections
return array.Count(); return array.GetCount();
} }
void wxGenericTreeCtrl::EnsureVisible(const wxTreeItemId& item) void wxGenericTreeCtrl::EnsureVisible(const wxTreeItemId& item)
@@ -2019,7 +2019,7 @@ void wxGenericTreeCtrl::SortChildren(const wxTreeItemId& itemId)
wxT("wxGenericTreeCtrl::SortChildren is not reentrant") ); wxT("wxGenericTreeCtrl::SortChildren is not reentrant") );
wxArrayGenericTreeItems& children = item->GetChildren(); wxArrayGenericTreeItems& children = item->GetChildren();
if ( children.Count() > 1 ) if ( children.GetCount() > 1 )
{ {
m_dirty = true; m_dirty = true;
@@ -2300,7 +2300,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
// always expand hidden root // always expand hidden root
int origY = y; int origY = y;
wxArrayGenericTreeItems& children = item->GetChildren(); wxArrayGenericTreeItems& children = item->GetChildren();
int count = children.Count(); int count = children.GetCount();
if (count > 0) if (count > 0)
{ {
int n = 0, oldY; int n = 0, oldY;
@@ -2448,7 +2448,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
if (item->IsExpanded()) if (item->IsExpanded())
{ {
wxArrayGenericTreeItems& children = item->GetChildren(); wxArrayGenericTreeItems& children = item->GetChildren();
int count = children.Count(); int count = children.GetCount();
if (count > 0) if (count > 0)
{ {
int n = 0, oldY; int n = 0, oldY;
@@ -3438,7 +3438,7 @@ void wxGenericTreeCtrl::CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int l
Recurse: Recurse:
wxArrayGenericTreeItems& children = item->GetChildren(); wxArrayGenericTreeItems& children = item->GetChildren();
size_t n, count = children.Count(); size_t n, count = children.GetCount();
++level; ++level;
for (n = 0; n < count; ++n ) for (n = 0; n < count; ++n )
CalculateLevel( children[n], dc, level, y ); // recurse CalculateLevel( children[n], dc, level, y ); // recurse

View File

@@ -264,19 +264,19 @@ bool wxHtmlPrintout::OnPrintPage(int page)
void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
{ {
*minPage = 1; *minPage = 1;
if ( m_NumPages >= (signed)m_PageBreaks.Count()-1) if ( m_NumPages >= (signed)m_PageBreaks.GetCount()-1)
*maxPage = m_NumPages; *maxPage = m_NumPages;
else else
*maxPage = (signed)m_PageBreaks.Count()-1; *maxPage = (signed)m_PageBreaks.GetCount()-1;
*selPageFrom = 1; *selPageFrom = 1;
*selPageTo = (signed)m_PageBreaks.Count()-1; *selPageTo = (signed)m_PageBreaks.GetCount()-1;
} }
bool wxHtmlPrintout::HasPage(int pageNum) bool wxHtmlPrintout::HasPage(int pageNum)
{ {
return pageNum > 0 && (unsigned)pageNum < m_PageBreaks.Count(); return pageNum > 0 && (unsigned)pageNum < m_PageBreaks.GetCount();
} }
@@ -374,7 +374,7 @@ void wxHtmlPrintout::CountPages()
m_PageBreaks, m_PageBreaks,
pos, true, INT_MAX); pos, true, INT_MAX);
m_PageBreaks.Add( pos); m_PageBreaks.Add( pos);
if( m_PageBreaks.Count() > wxHTML_PRINT_MAX_PAGES) if( m_PageBreaks.GetCount() > wxHTML_PRINT_MAX_PAGES)
{ {
wxMessageBox( _("HTML pagination algorithm generated more than the allowed maximum number of pages and it can't continue any longer!"), wxMessageBox( _("HTML pagination algorithm generated more than the allowed maximum number of pages and it can't continue any longer!"),
_("Warning"), wxCANCEL | wxICON_ERROR ); _("Warning"), wxCANCEL | wxICON_ERROR );
@@ -440,7 +440,7 @@ wxString wxHtmlPrintout::TranslateHeader(const wxString& instr, int page)
num.Printf(wxT("%i"), page); num.Printf(wxT("%i"), page);
r.Replace(wxT("@PAGENUM@"), num); r.Replace(wxT("@PAGENUM@"), num);
num.Printf(wxT("%lu"), (unsigned long)(m_PageBreaks.Count() - 1)); num.Printf(wxT("%lu"), (unsigned long)(m_PageBreaks.GetCount() - 1));
r.Replace(wxT("@PAGESCNT@"), num); r.Replace(wxT("@PAGESCNT@"), num);
const wxDateTime now = wxDateTime::Now(); const wxDateTime now = wxDateTime::Now();

View File

@@ -100,7 +100,7 @@ bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, wxArrayInt& known_page
// vertical position. Otherwise we'd be setting a pagebreak above // vertical position. Otherwise we'd be setting a pagebreak above
// the current cell, which is incorrect, or duplicating a // the current cell, which is incorrect, or duplicating a
// pagebreak that has already been set. // pagebreak that has already been set.
if( known_pagebreaks.Count() == 0 || *pagebreak <= m_PosY) if( known_pagebreaks.GetCount() == 0 || *pagebreak <= m_PosY)
{ {
return false; return false;
} }

View File

@@ -126,8 +126,6 @@ wxChar *wxLoadUserResource(const wxString& resourceName, const wxString& resourc
wxStrncpy(s,theText,len); wxStrncpy(s,theText,len);
s[len]=0; s[len]=0;
// wxChar *s = copystring(theText);
// Obsolete in WIN32 // Obsolete in WIN32
#ifndef __WIN32__ #ifndef __WIN32__
UnlockResource(hData); UnlockResource(hData);

View File

@@ -1083,7 +1083,7 @@ static wxString ReadPathFromKDEConfig(const wxString& request)
wxString str; wxString str;
wxArrayString output; wxArrayString output;
if(wxExecute(wxT("kde-config --path ")+request, output) == 0 && if(wxExecute(wxT("kde-config --path ")+request, output) == 0 &&
output.Count() > 0) output.GetCount() > 0)
str = output.Item(0); str = output.Item(0);
return str; return str;
} }
@@ -1111,7 +1111,7 @@ static wxString GetKDEThemeInFile(const wxFileName& filename)
static wxString GetKDETheme(const wxArrayString& basedirs) static wxString GetKDETheme(const wxArrayString& basedirs)
{ {
wxString theme; wxString theme;
for(size_t i = 0; i < basedirs.Count(); i++) { for(size_t i = 0; i < basedirs.GetCount(); i++) {
wxFileName filename(basedirs.Item(i), wxEmptyString); wxFileName filename(basedirs.Item(i), wxEmptyString);
filename.AppendDir( wxT("share") ); filename.AppendDir( wxT("share") );
filename.AppendDir( wxT("config") ); filename.AppendDir( wxT("config") );
@@ -1122,7 +1122,7 @@ static wxString GetKDETheme(const wxArrayString& basedirs)
} }
// If $KDEDIRS and $KDEDIR were set, we try nothing more. Otherwise, we // If $KDEDIRS and $KDEDIR were set, we try nothing more. Otherwise, we
// try to get the configuration file with 'kde-config'. // try to get the configuration file with 'kde-config'.
if(basedirs.Count() > 1) if(basedirs.GetCount() > 1)
return theme; return theme;
wxString paths = ReadPathFromKDEConfig(wxT("config")); wxString paths = ReadPathFromKDEConfig(wxT("config"));
if(! paths.IsEmpty()) { if(! paths.IsEmpty()) {
@@ -1145,7 +1145,7 @@ static void GetKDEIconDirs(const wxArrayString& basedirs,
if(theme.IsEmpty()) if(theme.IsEmpty())
theme = wxT("default.kde"); theme = wxT("default.kde");
for(size_t i = 0; i < basedirs.Count(); i++) { for(size_t i = 0; i < basedirs.GetCount(); i++) {
wxFileName dirname(basedirs.Item(i), wxEmptyString); wxFileName dirname(basedirs.Item(i), wxEmptyString);
dirname.AppendDir( wxT("share") ); dirname.AppendDir( wxT("share") );
dirname.AppendDir( wxT("icons") ); dirname.AppendDir( wxT("icons") );
@@ -1157,7 +1157,7 @@ static void GetKDEIconDirs(const wxArrayString& basedirs,
} }
// If $KDEDIRS and $KDEDIR were not set, use 'kde-config' // If $KDEDIRS and $KDEDIR were not set, use 'kde-config'
if(basedirs.Count() > 1) if(basedirs.GetCount() > 1)
return; return;
wxString paths = ReadPathFromKDEConfig(wxT("icon")); wxString paths = ReadPathFromKDEConfig(wxT("icon"));
if(! paths.IsEmpty()) { if(! paths.IsEmpty()) {
@@ -1178,7 +1178,7 @@ static void GetKDEIconDirs(const wxArrayString& basedirs,
static void GetKDEMimeDirs(const wxArrayString& basedirs, static void GetKDEMimeDirs(const wxArrayString& basedirs,
wxArrayString& mimedirs) wxArrayString& mimedirs)
{ {
for(size_t i = 0; i < basedirs.Count(); i++) { for(size_t i = 0; i < basedirs.GetCount(); i++) {
wxFileName dirname(basedirs.Item(i), wxEmptyString); wxFileName dirname(basedirs.Item(i), wxEmptyString);
dirname.AppendDir( wxT("share") ); dirname.AppendDir( wxT("share") );
dirname.AppendDir( wxT("mimelnk") ); dirname.AppendDir( wxT("mimelnk") );
@@ -1187,7 +1187,7 @@ static void GetKDEMimeDirs(const wxArrayString& basedirs,
} }
// If $KDEDIRS and $KDEDIR were not set, use 'kde-config' // If $KDEDIRS and $KDEDIR were not set, use 'kde-config'
if(basedirs.Count() > 1) if(basedirs.GetCount() > 1)
return; return;
wxString paths = ReadPathFromKDEConfig(wxT("mime")); wxString paths = ReadPathFromKDEConfig(wxT("mime"));
if(! paths.IsEmpty()) { if(! paths.IsEmpty()) {
@@ -1206,7 +1206,7 @@ static void GetKDEMimeDirs(const wxArrayString& basedirs,
static void GetKDEAppsDirs(const wxArrayString& basedirs, static void GetKDEAppsDirs(const wxArrayString& basedirs,
wxArrayString& appsdirs) wxArrayString& appsdirs)
{ {
for(size_t i = 0; i < basedirs.Count(); i++) { for(size_t i = 0; i < basedirs.GetCount(); i++) {
wxFileName dirname(basedirs.Item(i), wxEmptyString); wxFileName dirname(basedirs.Item(i), wxEmptyString);
dirname.AppendDir( wxT("share") ); dirname.AppendDir( wxT("share") );
dirname.AppendDir( wxT("applnk") ); dirname.AppendDir( wxT("applnk") );
@@ -1215,7 +1215,7 @@ static void GetKDEAppsDirs(const wxArrayString& basedirs,
} }
// If $KDEDIRS and $KDEDIR were not set, use 'kde-config' // If $KDEDIRS and $KDEDIR were not set, use 'kde-config'
if(basedirs.Count() > 1) if(basedirs.GetCount() > 1)
return; return;
wxString paths = ReadPathFromKDEConfig(wxT("apps")); wxString paths = ReadPathFromKDEConfig(wxT("apps"));
if(! paths.IsEmpty()) { if(! paths.IsEmpty()) {
@@ -2101,10 +2101,10 @@ int wxMimeTypesManagerImpl::AddToMimeData(const wxString& strType,
} }
// check data integrity // check data integrity
wxASSERT( m_aTypes.Count() == m_aEntries.Count() && wxASSERT( m_aTypes.GetCount() == m_aEntries.GetCount() &&
m_aTypes.Count() == m_aExtensions.Count() && m_aTypes.GetCount() == m_aExtensions.GetCount() &&
m_aTypes.Count() == m_aIcons.Count() && m_aTypes.GetCount() == m_aIcons.GetCount() &&
m_aTypes.Count() == m_aDescriptions.Count() ); m_aTypes.GetCount() == m_aDescriptions.GetCount() );
return nIndex; return nIndex;
} }
@@ -2162,7 +2162,7 @@ wxFileType * wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mim
index = wxNOT_FOUND; index = wxNOT_FOUND;
wxString strCategory = mimetype.BeforeFirst(wxT('/')); wxString strCategory = mimetype.BeforeFirst(wxT('/'));
size_t nCount = m_aTypes.Count(); size_t nCount = m_aTypes.GetCount();
for ( size_t n = 0; n < nCount; n++ ) for ( size_t n = 0; n < nCount; n++ )
{ {
if ( (m_aTypes[n].BeforeFirst(wxT('/')) == strCategory ) && if ( (m_aTypes[n].BeforeFirst(wxT('/')) == strCategory ) &&
@@ -2871,10 +2871,10 @@ bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft)
} }
} }
// check data integrity // check data integrity
wxASSERT( m_aTypes.Count() == m_aEntries.Count() && wxASSERT( m_aTypes.GetCount() == m_aEntries.GetCount() &&
m_aTypes.Count() == m_aExtensions.Count() && m_aTypes.GetCount() == m_aExtensions.GetCount() &&
m_aTypes.Count() == m_aIcons.Count() && m_aTypes.GetCount() == m_aIcons.GetCount() &&
m_aTypes.Count() == m_aDescriptions.Count() ); m_aTypes.GetCount() == m_aDescriptions.GetCount() );
return true; return true;
} }

View File

@@ -100,7 +100,7 @@ wxObject *wxTreebookXmlHandler::DoCreateResource()
size_t depth = GetLong( wxT("depth") ); size_t depth = GetLong( wxT("depth") );
if( depth <= m_treeContext.Count() ) if( depth <= m_treeContext.GetCount() )
{ {
// first prepare the icon // first prepare the icon
int imgIndex = wxNOT_FOUND; int imgIndex = wxNOT_FOUND;
@@ -117,8 +117,8 @@ wxObject *wxTreebookXmlHandler::DoCreateResource()
} }
// then add the page to the corresponding parent // then add the page to the corresponding parent
if( depth < m_treeContext.Count() ) if( depth < m_treeContext.GetCount() )
m_treeContext.RemoveAt(depth, m_treeContext.Count() - depth ); m_treeContext.RemoveAt(depth, m_treeContext.GetCount() - depth );
if( depth == 0) if( depth == 0)
{ {
m_tbk->AddPage(wnd, m_tbk->AddPage(wnd,

View File

@@ -132,7 +132,7 @@ public:
file.Write(_T("class ") + m_className + _T(" : public ") + m_parentClassName file.Write(_T("class ") + m_className + _T(" : public ") + m_parentClassName
+ _T(" {\nprotected:\n")); + _T(" {\nprotected:\n"));
size_t i; size_t i;
for(i=0;i<m_wdata.Count();++i) for(i=0;i<m_wdata.GetCount();++i)
{ {
const XRCWidgetData& w = m_wdata.Item(i); const XRCWidgetData& w = m_wdata.Item(i);
if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue; if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
@@ -147,7 +147,7 @@ public:
+ _T("\"), _T(\"") + _T("\"), _T(\"")
+ m_parentClassName + m_parentClassName
+ _T("\"));\n")); + _T("\"));\n"));
for(i=0;i<m_wdata.Count();++i) for(i=0;i<m_wdata.GetCount();++i)
{ {
const XRCWidgetData& w = m_wdata.Item(i); const XRCWidgetData& w = m_wdata.Item(i);
if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue; if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
@@ -383,7 +383,7 @@ wxArrayString XmlResApp::PrepareTempFiles()
{ {
wxArrayString flist; wxArrayString flist;
for (size_t i = 0; i < parFiles.Count(); i++) for (size_t i = 0; i < parFiles.GetCount(); i++)
{ {
if (flagVerbose) if (flagVerbose)
wxPrintf(_T("processing ") + parFiles[i] + _T("...\n")); wxPrintf(_T("processing ") + parFiles[i] + _T("...\n"));
@@ -513,7 +513,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
void XmlResApp::DeleteTempFiles(const wxArrayString& flist) void XmlResApp::DeleteTempFiles(const wxArrayString& flist)
{ {
for (size_t i = 0; i < flist.Count(); i++) for (size_t i = 0; i < flist.GetCount(); i++)
wxRemoveFile(parOutputPath + wxFILE_SEP_PATH + flist[i]); wxRemoveFile(parOutputPath + wxFILE_SEP_PATH + flist[i]);
} }
@@ -523,7 +523,7 @@ void XmlResApp::MakePackageZIP(const wxArrayString& flist)
{ {
wxString files; wxString files;
for (size_t i = 0; i < flist.Count(); i++) for (size_t i = 0; i < flist.GetCount(); i++)
files += flist[i] + _T(" "); files += flist[i] + _T(" ");
files.RemoveLast(); files.RemoveLast();
@@ -614,7 +614,7 @@ _T("#include <wx/xrc/xmlres.h>\n")
_T("#include <wx/xrc/xh_all.h>\n") _T("#include <wx/xrc/xh_all.h>\n")
_T("\n")); _T("\n"));
for (i = 0; i < flist.Count(); i++) for (i = 0; i < flist.GetCount(); i++)
file.Write( file.Write(
FileToCppArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i)); FileToCppArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i));
@@ -633,7 +633,7 @@ _T(" else wxFileSystem::AddHandler(new wxMemoryFSHandler);\n")
_T(" }\n") _T(" }\n")
_T("\n")); _T("\n"));
for (i = 0; i < flist.Count(); i++) for (i = 0; i < flist.GetCount(); i++)
{ {
wxString s; wxString s;
s.Printf(_T(" wxMemoryFSHandler::AddFile(wxT(\"XRC_resource/") + flist[i] + s.Printf(_T(" wxMemoryFSHandler::AddFile(wxT(\"XRC_resource/") + flist[i] +
@@ -641,7 +641,7 @@ _T("\n"));
file.Write(s); file.Write(s);
} }
for (i = 0; i < parFiles.Count(); i++) for (i = 0; i < parFiles.GetCount(); i++)
{ {
file.Write(_T(" wxXmlResource::Get()->Load(wxT(\"memory:XRC_resource/") + file.Write(_T(" wxXmlResource::Get()->Load(wxT(\"memory:XRC_resource/") +
GetInternalFileName(parFiles[i], flist) + _T("\"));\n")); GetInternalFileName(parFiles[i], flist) + _T("\"));\n"));
@@ -665,7 +665,7 @@ _T("//\n\n")
_T("#ifndef __") + fileSpec + _T("_h__\n") _T("#ifndef __") + fileSpec + _T("_h__\n")
_T("#define __") + fileSpec + _T("_h__\n") _T("#define __") + fileSpec + _T("_h__\n")
); );
for(size_t i=0;i<aXRCWndClassData.Count();++i){ for(size_t i=0;i<aXRCWndClassData.GetCount();++i){
aXRCWndClassData.Item(i).GenerateHeaderCode(file); aXRCWndClassData.Item(i).GenerateHeaderCode(file);
} }
file.Write( file.Write(
@@ -742,7 +742,7 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
file.Write(_T("def ") + parFuncname + _T("():\n")); file.Write(_T("def ") + parFuncname + _T("():\n"));
for (i = 0; i < flist.Count(); i++) for (i = 0; i < flist.GetCount(); i++)
file.Write( file.Write(
FileToPythonArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i)); FileToPythonArray(parOutputPath + wxFILE_SEP_PATH + flist[i], i));
@@ -761,14 +761,14 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
); );
for (i = 0; i < flist.Count(); i++) for (i = 0; i < flist.GetCount(); i++)
{ {
wxString s; wxString s;
s.Printf(_T(" wx.MemoryFSHandler.AddFile('XRC_resource/") + flist[i] + s.Printf(_T(" wx.MemoryFSHandler.AddFile('XRC_resource/") + flist[i] +
_T("', xml_res_file_%i)\n"), i); _T("', xml_res_file_%i)\n"), i);
file.Write(s); file.Write(s);
} }
for (i = 0; i < parFiles.Count(); i++) for (i = 0; i < parFiles.GetCount(); i++)
{ {
file.Write(_T(" wx.xrc.XmlResource.Get().Load('memory:XRC_resource/") + file.Write(_T(" wx.xrc.XmlResource.Get().Load('memory:XRC_resource/") +
GetInternalFileName(parFiles[i], flist) + _T("')\n")); GetInternalFileName(parFiles[i], flist) + _T("')\n"));
@@ -801,7 +801,7 @@ wxArrayString XmlResApp::FindStrings()
{ {
wxArrayString arr, a2; wxArrayString arr, a2;
for (size_t i = 0; i < parFiles.Count(); i++) for (size_t i = 0; i < parFiles.GetCount(); i++)
{ {
if (flagVerbose) if (flagVerbose)
wxPrintf(_T("processing ") + parFiles[i] + _T("...\n")); wxPrintf(_T("processing ") + parFiles[i] + _T("...\n"));