added missing consts and pass objects by const reference instead of by value (patch 1205869)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-09-24 21:43:15 +00:00
parent 68bc51a9ed
commit fbfb8bcc3f
111 changed files with 199 additions and 197 deletions

View File

@@ -120,7 +120,7 @@ struct wxCmdLineOption
void SetStrVal(const wxString& val)
{ Check(wxCMD_LINE_VAL_STRING); m_strVal = val; m_hasVal = true; }
#if wxUSE_DATETIME
void SetDateVal(const wxDateTime val)
void SetDateVal(const wxDateTime& val)
{ Check(wxCMD_LINE_VAL_DATE); m_dateVal = val; m_hasVal = true; }
#endif // wxUSE_DATETIME

View File

@@ -83,7 +83,7 @@ void wxEffects::DrawSunkenEdge(wxDC& dc, const wxRect& rect, int WXUNUSED(border
dc.SetPen(wxNullPen);
}
bool wxEffects::TileBitmap(const wxRect& rect, wxDC& dc, wxBitmap& bitmap)
bool wxEffects::TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap)
{
static bool hiColour = (wxDisplayDepth() >= 16) ;

View File

@@ -572,7 +572,7 @@ wxFileConfig::~wxFileConfig()
// parse a config file
// ----------------------------------------------------------------------------
void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal)
void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
{
const wxChar *pStart;
const wxChar *pEnd;

View File

@@ -514,7 +514,7 @@ void wxNativeFontInfo::SetUnderlined(bool underlined_)
underlined = underlined_;
}
void wxNativeFontInfo::SetFaceName(wxString facename_)
void wxNativeFontInfo::SetFaceName(const wxString& facename_)
{
faceName = facename_;
}

View File

@@ -41,7 +41,7 @@ class MemFSHashObj : public wxObject
InitTime();
}
MemFSHashObj(wxMemoryOutputStream& stream)
MemFSHashObj(const wxMemoryOutputStream& stream)
{
m_Len = stream.GetSize();
m_Data = new char[m_Len];

View File

@@ -641,8 +641,8 @@ wxSocketBase *wxFTP::AcceptIfActive(wxSocketBase *sock)
return sock;
}
wxString wxFTP::GetPortCmdArgument(wxIPV4address addrLocal,
wxIPV4address addrNew)
wxString wxFTP::GetPortCmdArgument(const wxIPV4address& addrLocal,
const wxIPV4address& addrNew)
{
// Just fills in the return value with the local IP
// address of the current socket. Also it fill in the

View File

@@ -47,7 +47,7 @@ wxConnectionBase::wxConnectionBase()
{
}
wxConnectionBase::wxConnectionBase(wxConnectionBase& copy)
wxConnectionBase::wxConnectionBase(const wxConnectionBase& copy)
: wxObject(),
m_connected(copy.m_connected),
m_buffer(copy.m_buffer),

View File

@@ -71,7 +71,7 @@ void wxTransformMatrix::operator = (const wxTransformMatrix& mat)
m_isIdentity = mat.m_isIdentity;
}
bool wxTransformMatrix::operator == (const wxTransformMatrix& mat)
bool wxTransformMatrix::operator == (const wxTransformMatrix& mat) const
{
if (m_isIdentity && mat.m_isIdentity)
return true;
@@ -88,7 +88,7 @@ bool wxTransformMatrix::operator == (const wxTransformMatrix& mat)
return true;
}
bool wxTransformMatrix::operator != (const wxTransformMatrix& mat)
bool wxTransformMatrix::operator != (const wxTransformMatrix& mat) const
{
return (! ((*this) == mat));
}

View File

@@ -214,7 +214,7 @@ wxString wxIPV4address::IPAddress() const
);
}
bool wxIPV4address::operator==(wxIPV4address& addr)
bool wxIPV4address::operator==(const wxIPV4address& addr) const
{
if(Hostname().Cmp(addr.Hostname().c_str()) == 0 && Service() == addr.Service()) return true;
return false;

View File

@@ -295,8 +295,10 @@ wxSize wxSizerItem::GetMinSizeWithBorder() const
}
void wxSizerItem::SetDimension( wxPoint pos, wxSize size )
void wxSizerItem::SetDimension( const wxPoint& pos_, const wxSize& size_ )
{
wxPoint pos = pos_;
wxSize size = size_;
if (m_flag & wxSHAPED)
{
// adjust aspect ratio

View File

@@ -1053,7 +1053,7 @@ wxUint32 wxSocketBase::GetPushback(void *buffer, wxUint32 size, bool peek)
// Ctor
// --------------------------------------------------------------------------
wxSocketServer::wxSocketServer(wxSockAddress& addr_man,
wxSocketServer::wxSocketServer(const wxSockAddress& addr_man,
wxSocketFlags flags)
: wxSocketBase(flags, wxSOCKET_SERVER)
{
@@ -1260,7 +1260,7 @@ bool wxSocketClient::WaitOnConnect(long seconds, long milliseconds)
/* NOTE: experimental stuff - might change */
wxDatagramSocket::wxDatagramSocket( wxSockAddress& addr,
wxDatagramSocket::wxDatagramSocket( const wxSockAddress& addr,
wxSocketFlags flags )
: wxSocketBase( flags, wxSOCKET_DATAGRAM )
{
@@ -1300,7 +1300,7 @@ wxDatagramSocket& wxDatagramSocket::RecvFrom( wxSockAddress& addr,
return (*this);
}
wxDatagramSocket& wxDatagramSocket::SendTo( wxSockAddress& addr,
wxDatagramSocket& wxDatagramSocket::SendTo( const wxSockAddress& addr,
const void* buf,
wxUint32 nBytes )
{

View File

@@ -89,7 +89,7 @@ bool wxIsStockID(wxWindowID id)
}
}
wxString wxGetStockLabel(wxWindowID id, bool withCodes, wxString accelerator)
wxString wxGetStockLabel(wxWindowID id, bool withCodes, const wxString& accelerator)
{
wxString stockLabel;

View File

@@ -1644,8 +1644,8 @@ void wxGridCellRenderer::Draw(wxGrid& grid,
// wxGridCellStringRenderer
// ----------------------------------------------------------------------------
void wxGridCellStringRenderer::SetTextColoursAndFont(wxGrid& grid,
wxGridCellAttr& attr,
void wxGridCellStringRenderer::SetTextColoursAndFont(const wxGrid& grid,
const wxGridCellAttr& attr,
wxDC& dc,
bool isSelected)
{
@@ -1676,7 +1676,7 @@ void wxGridCellStringRenderer::SetTextColoursAndFont(wxGrid& grid,
dc.SetFont( attr.GetFont() );
}
wxSize wxGridCellStringRenderer::DoGetBestSize(wxGridCellAttr& attr,
wxSize wxGridCellStringRenderer::DoGetBestSize(const wxGridCellAttr& attr,
wxDC& dc,
const wxString& text)
{
@@ -1797,7 +1797,7 @@ void wxGridCellStringRenderer::Draw(wxGrid& grid,
// wxGridCellNumberRenderer
// ----------------------------------------------------------------------------
wxString wxGridCellNumberRenderer::GetString(wxGrid& grid, int row, int col)
wxString wxGridCellNumberRenderer::GetString(const wxGrid& grid, int row, int col)
{
wxGridTableBase *table = grid.GetTable();
wxString text;
@@ -1863,7 +1863,7 @@ wxGridCellRenderer *wxGridCellFloatRenderer::Clone() const
return renderer;
}
wxString wxGridCellFloatRenderer::GetString(wxGrid& grid, int row, int col)
wxString wxGridCellFloatRenderer::GetString(const wxGrid& grid, int row, int col)
{
wxGridTableBase *table = grid.GetTable();
@@ -7563,7 +7563,7 @@ void wxGrid::StringToLines( const wxString& value, wxArrayString& lines )
}
void wxGrid::GetTextBoxSize( wxDC& dc,
void wxGrid::GetTextBoxSize( const wxDC& dc,
const wxArrayString& lines,
long *width, long *height )
{

View File

@@ -33,7 +33,7 @@
// Enables a grid cell to display a formated date and or time
wxGridCellDateTimeRenderer::wxGridCellDateTimeRenderer(wxString outformat, wxString informat)
wxGridCellDateTimeRenderer::wxGridCellDateTimeRenderer(const wxString& outformat, const wxString& informat)
{
m_iformat = informat;
m_oformat = outformat;
@@ -52,7 +52,7 @@ wxGridCellRenderer *wxGridCellDateTimeRenderer::Clone() const
return renderer;
}
wxString wxGridCellDateTimeRenderer::GetString(wxGrid& grid, int row, int col)
wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int col)
{
wxGridTableBase *table = grid.GetTable();
@@ -142,7 +142,7 @@ wxGridCellRenderer *wxGridCellEnumRenderer::Clone() const
return renderer;
}
wxString wxGridCellEnumRenderer::GetString(wxGrid& grid, int row, int col)
wxString wxGridCellEnumRenderer::GetString(const wxGrid& grid, int row, int col)
{
wxGridTableBase *table = grid.GetTable();
wxString text;
@@ -326,7 +326,7 @@ wxGridCellAutoWrapStringRenderer::Draw(wxGrid& grid,
wxArrayString
wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid,
wxDC& dc,
wxGridCellAttr& attr,
const wxGridCellAttr& attr,
const wxRect& rect,
int row, int col)
{

View File

@@ -151,7 +151,7 @@ private:
class wxHtmlListBoxStyle : public wxDefaultHtmlRenderingStyle
{
public:
wxHtmlListBoxStyle(wxHtmlListBox& hlbox) : m_hlbox(hlbox) { }
wxHtmlListBoxStyle(const wxHtmlListBox& hlbox) : m_hlbox(hlbox) { }
virtual wxColour GetSelectedTextColour(const wxColour& colFg)
{

View File

@@ -362,7 +362,7 @@ public:
void GetItem( int index, wxListItem &info );
wxString GetText(int index) const;
void SetText( int index, const wxString s );
void SetText( int index, const wxString& s );
wxListItemAttr *GetAttr() const;
void SetAttr(wxListItemAttr *attr);
@@ -466,7 +466,7 @@ private:
// generate and process the list event of the given type, return true if
// it wasn't vetoed, i.e. if we should proceed
bool SendListEvent(wxEventType type, wxPoint pos);
bool SendListEvent(wxEventType type, const wxPoint& pos);
DECLARE_DYNAMIC_CLASS(wxListHeaderWindow)
DECLARE_EVENT_TABLE()
@@ -717,7 +717,7 @@ public:
// send out a wxListEvent
void SendNotify( size_t line,
wxEventType command,
wxPoint point = wxDefaultPosition );
const wxPoint& point = wxDefaultPosition );
// override base class virtual to reset m_lineHeight when the font changes
virtual bool SetFont(const wxFont& font)
@@ -1365,7 +1365,7 @@ wxString wxListLineData::GetText(int index) const
return s;
}
void wxListLineData::SetText( int index, const wxString s )
void wxListLineData::SetText( int index, const wxString& s )
{
wxListItemDataList::compatibility_iterator node = m_items.Item( index );
if (node)
@@ -2009,7 +2009,7 @@ void wxListHeaderWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) )
m_owner->Update();
}
bool wxListHeaderWindow::SendListEvent(wxEventType type, wxPoint pos)
bool wxListHeaderWindow::SendListEvent(wxEventType type, const wxPoint& pos)
{
wxWindow *parent = GetParent();
wxListEvent le( type, parent->GetId() );
@@ -2794,7 +2794,7 @@ void wxListMainWindow::HighlightAll( bool on )
void wxListMainWindow::SendNotify( size_t line,
wxEventType command,
wxPoint point )
const wxPoint& point )
{
wxListEvent le( command, GetParent()->GetId() );
le.SetEventObject( GetParent() );

View File

@@ -83,12 +83,12 @@ wxPalette& wxPalette::operator = (const wxPalette& palette)
return *this;
}
bool wxPalette::operator == (const wxPalette& palette)
bool wxPalette::operator == (const wxPalette& palette) const
{
return m_refData == palette.m_refData;
}
bool wxPalette::operator != (const wxPalette& palette)
bool wxPalette::operator != (const wxPalette& palette) const
{
return m_refData != palette.m_refData;
}

View File

@@ -275,7 +275,7 @@ wxObjectRefData *wxRegionGeneric::CloneRefData(const wxObjectRefData *data) cons
return new wxRegionRefData(*(wxRegionRefData *)data);
}
bool wxRegionGeneric::operator== (const wxRegionGeneric& region)
bool wxRegionGeneric::operator== (const wxRegionGeneric& region) const
{
wxASSERT(m_refData && region.m_refData);
return REGION::XEqualRegion(M_REGIONDATA,M_REGIONDATA_OF(region));

View File

@@ -173,7 +173,7 @@ void wxTextEntryDialog::SetTextValidator( long style )
m_textctrl->SetValidator( validator );
}
void wxTextEntryDialog::SetTextValidator( wxTextValidator& validator )
void wxTextEntryDialog::SetTextValidator( const wxTextValidator& validator )
{
m_textctrl->SetValidator( validator );
}

View File

@@ -157,7 +157,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
if (parent)
gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) );
gchar* ok_btn_stock;
const gchar* ok_btn_stock;
if ( style & wxSAVE )
{
gtk_action = GTK_FILE_CHOOSER_ACTION_SAVE;

View File

@@ -160,7 +160,7 @@ wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
// wxRegion comparison
// ----------------------------------------------------------------------------
bool wxRegion::operator==( const wxRegion& region )
bool wxRegion::operator==( const wxRegion& region ) const
{
if (m_refData == region.m_refData) return TRUE;

View File

@@ -164,7 +164,7 @@ extern "C" {
static void wxGtkTextInsert(GtkWidget *text,
GtkTextBuffer *text_buffer,
const wxTextAttr& attr,
wxCharBuffer buffer)
const wxCharBuffer& buffer)
{
gint start_offset;

View File

@@ -157,7 +157,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
if (parent)
gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) );
gchar* ok_btn_stock;
const gchar* ok_btn_stock;
if ( style & wxSAVE )
{
gtk_action = GTK_FILE_CHOOSER_ACTION_SAVE;

View File

@@ -160,7 +160,7 @@ wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
// wxRegion comparison
// ----------------------------------------------------------------------------
bool wxRegion::operator==( const wxRegion& region )
bool wxRegion::operator==( const wxRegion& region ) const
{
if (m_refData == region.m_refData) return TRUE;

View File

@@ -164,7 +164,7 @@ extern "C" {
static void wxGtkTextInsert(GtkWidget *text,
GtkTextBuffer *text_buffer,
const wxTextAttr& attr,
wxCharBuffer buffer)
const wxCharBuffer& buffer)
{
gint start_offset;

View File

@@ -1187,7 +1187,7 @@ void wxHtmlHelpFrame::WriteCustomization(wxConfigBase *cfg, const wxString& path
static void SetFontsToHtmlWin(wxHtmlWindow *win, wxString scalf, wxString fixf, int size)
static void SetFontsToHtmlWin(wxHtmlWindow *win, const wxString& scalf, const wxString& fixf, int size)
{
int f_sizes[7];
f_sizes[0] = int(size * 0.6);

View File

@@ -252,7 +252,7 @@ bool wxHtmlCell::IsBefore(wxHtmlCell *cell) const
IMPLEMENT_ABSTRACT_CLASS(wxHtmlWordCell, wxHtmlCell)
wxHtmlWordCell::wxHtmlWordCell(const wxString& word, wxDC& dc) : wxHtmlCell()
wxHtmlWordCell::wxHtmlWordCell(const wxString& word, const wxDC& dc) : wxHtmlCell()
{
m_Word = word;
dc.GetTextExtent(m_Word, &m_Width, &m_Height, &m_Descent);
@@ -272,7 +272,7 @@ void wxHtmlWordCell::SetPreviousWord(wxHtmlWordCell *cell)
// Splits m_Word into up to three parts according to selection, returns
// substring before, in and after selection and the points (in relative coords)
// where s2 and s3 start:
void wxHtmlWordCell::Split(wxDC& dc,
void wxHtmlWordCell::Split(const wxDC& dc,
const wxPoint& selFrom, const wxPoint& selTo,
unsigned& pos1, unsigned& pos2) const
{
@@ -337,7 +337,7 @@ void wxHtmlWordCell::Split(wxDC& dc,
pos2 = j;
}
void wxHtmlWordCell::SetSelectionPrivPos(wxDC& dc, wxHtmlSelection *s) const
void wxHtmlWordCell::SetSelectionPrivPos(const wxDC& dc, wxHtmlSelection *s) const
{
unsigned p1, p2;

View File

@@ -351,7 +351,7 @@ void wxHtmlParser::AddTagHandler(wxHtmlTagHandler *handler)
handler->SetParser(this);
}
void wxHtmlParser::PushTagHandler(wxHtmlTagHandler *handler, wxString tags)
void wxHtmlParser::PushTagHandler(wxHtmlTagHandler *handler, const wxString& tags)
{
wxStringTokenizer tokenizer(tags, wxT(", "));
wxString key;

View File

@@ -235,7 +235,7 @@ void wxHtmlWindow::SetRelatedStatusBar(int bar)
void wxHtmlWindow::SetFonts(wxString normal_face, wxString fixed_face, const int *sizes)
void wxHtmlWindow::SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes)
{
wxString op = m_OpenedPage;

View File

@@ -89,7 +89,7 @@ void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepat
}
void wxHtmlDCRenderer::SetFonts(wxString normal_face, wxString fixed_face,
void wxHtmlDCRenderer::SetFonts(const wxString& normal_face, const wxString& fixed_face,
const int *sizes)
{
m_Parser->SetFonts(normal_face, fixed_face, sizes);
@@ -452,7 +452,7 @@ void wxHtmlPrintout::SetMargins(float top, float bottom, float left, float right
void wxHtmlPrintout::SetFonts(wxString normal_face, wxString fixed_face,
void wxHtmlPrintout::SetFonts(const wxString& normal_face, const wxString& fixed_face,
const int *sizes)
{
m_Renderer->SetFonts(normal_face, fixed_face, sizes);
@@ -628,7 +628,7 @@ void wxHtmlEasyPrinting::SetFooter(const wxString& footer, int pg)
}
void wxHtmlEasyPrinting::SetFonts(wxString normal_face, wxString fixed_face,
void wxHtmlEasyPrinting::SetFonts(const wxString& normal_face, const wxString& fixed_face,
const int *sizes)
{
m_fontMode = FontMode_Explicit;

View File

@@ -111,7 +111,7 @@ void wxHtmlWinParser::RemoveModule(wxHtmlTagsModule *module)
m_Modules.DeleteObject(module);
}
void wxHtmlWinParser::SetFonts(wxString normal_face, wxString fixed_face,
void wxHtmlWinParser::SetFonts(const wxString& normal_face, const wxString& fixed_face,
const int *sizes)
{
static int default_sizes[7] =

View File

@@ -60,7 +60,7 @@ wxFontDialog::~wxFontDialog()
// empty
}
void wxFontDialog::SetData(wxFontData& fontdata)
void wxFontDialog::SetData(const wxFontData& fontdata)
{
m_fontData = fontdata;
}

View File

@@ -968,7 +968,7 @@ public:
}
}
static void PrintOutType(wxString& sMessage, wxString sValue, CFTypeRef cfRef)
static void PrintOutType(wxString& sMessage, const wxString& sValue, CFTypeRef cfRef)
{
sMessage << wxT(" {");

View File

@@ -2555,7 +2555,7 @@ static pascal void wxMacControlUserPaneDrawProc(ControlRef control, SInt16 part)
win->MacControlUserPaneDrawProc(part) ;
}
static pascal ControlPartCode wxMacControlUserPaneHitTestProc(ControlRef control, Point where)
static pascal ControlPartCode wxMacControlUserPaneHitTestProc(ControlRef control, const Point& where)
{
wxTextCtrl *textCtrl = wxDynamicCast( wxFindControlFromMacControl(control) , wxTextCtrl ) ;
wxMacMLTEClassicControl * win = textCtrl ? (wxMacMLTEClassicControl*)(textCtrl->GetPeer()) : NULL ;
@@ -2565,7 +2565,7 @@ static pascal ControlPartCode wxMacControlUserPaneHitTestProc(ControlRef control
return kControlNoPart ;
}
static pascal ControlPartCode wxMacControlUserPaneTrackingProc(ControlRef control, Point startPt, ControlActionUPP actionProc)
static pascal ControlPartCode wxMacControlUserPaneTrackingProc(ControlRef control, const Point& startPt, ControlActionUPP actionProc)
{
wxTextCtrl *textCtrl = wxDynamicCast( wxFindControlFromMacControl(control) , wxTextCtrl ) ;
wxMacMLTEClassicControl * win = textCtrl ? (wxMacMLTEClassicControl*)(textCtrl->GetPeer()) : NULL ;

View File

@@ -31,7 +31,7 @@ class wxMacToolTip
wxMacToolTip( ) ;
~wxMacToolTip() ;
void Setup( WindowRef window , const wxString& text , wxPoint localPosition ) ;
void Setup( WindowRef window , const wxString& text , const wxPoint& localPosition ) ;
long GetMark() { return m_mark ; }
void Draw() ;
void Clear() ;
@@ -184,7 +184,7 @@ wxMacToolTip::wxMacToolTip()
m_timer = NULL ;
}
void wxMacToolTip::Setup( WindowRef win , const wxString& text , wxPoint localPosition )
void wxMacToolTip::Setup( WindowRef win , const wxString& text , const wxPoint& localPosition )
{
m_mark++ ;
Clear() ;

View File

@@ -394,7 +394,7 @@ static void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
}
}
ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, Point location , ControlRef superControl , ControlPartCode *outPart )
ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, const Point& location , ControlRef superControl , ControlPartCode *outPart )
{
if ( superControl )
{
@@ -441,7 +441,7 @@ ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, Point locat
return NULL ;
}
ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow , Point location , WindowRef window , ControlPartCode *outPart )
ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow , const Point& location , WindowRef window , ControlPartCode *outPart )
{
#if TARGET_API_MAC_OSX
if ( UMAGetSystemVersion() >= 0x1030 && ( toplevelWindow == 0 || toplevelWindow->MacUsesCompositing() ) )

View File

@@ -67,7 +67,7 @@ bool wxClipboardOpen()
return wxTheClipboard->IsOpened();
}
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
bool wxIsClipboardFormatAvailable(const wxDataFormat& dataFormat)
{
return wxTheClipboard->IsSupported( dataFormat );
}
@@ -129,7 +129,7 @@ wxObject *wxGetClipboardData(wxDataFormat dataFormat, long *len)
return NULL; // just in case...
}
wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat)
wxDataFormat wxEnumClipboardFormats(const wxDataFormat& dataFormat)
{
// Only wxDF_TEXT supported
if (dataFormat == wxDF_TEXT)
@@ -144,7 +144,7 @@ wxDataFormat wxRegisterClipboardFormat(char *WXUNUSED(formatName))
return wxDF_INVALID;
}
bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName,
bool wxGetClipboardFormatName(const wxDataFormat& dataFormat, char *formatName,
int maxCount)
{
wxStrncpy( formatName, dataFormat.GetId().c_str(), maxCount );

View File

@@ -240,7 +240,7 @@ bool wxArrowButton::Create( wxSpinButton* parent, wxWindowID id,
IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl);
IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent);
static void CalcSizes( wxPoint pt, wxSize sz,
static void CalcSizes( const wxPoint& pt, const wxSize& sz,
wxPoint& pt1, wxSize& sz1,
wxPoint& pt2, wxSize& sz2,
bool isVertical )

View File

@@ -926,7 +926,7 @@ void wxDoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, boo
NULL);
}
extern void wxDoChangeFont(WXWidget widget, wxFont& font)
extern void wxDoChangeFont(WXWidget widget, const wxFont& font)
{
// Lesstif 0.87 hangs here, but 0.93 does not; MBN: sometimes it does
#if !wxCHECK_LESSTIF() // || wxCHECK_LESSTIF_VERSION( 0, 93 )
@@ -967,7 +967,7 @@ XmString wxStringToXmString( const char* str )
// Creates a bitmap with transparent areas drawn in
// the given colour.
wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour)
wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, const wxColour& colour)
{
wxBitmap newBitmap(bitmap.GetWidth(),
bitmap.GetHeight(),

View File

@@ -2519,7 +2519,7 @@ wxWindow *wxWindowBase::GetCapture()
// Find the wxWindow at the current mouse position, returning the mouse
// position.
wxWindow* wxFindWindowAtPointer(wxPoint& pt)
wxWindow* wxFindWindowAtPointer(const wxPoint& pt)
{
return wxFindWindowAtPoint(wxGetMousePosition());
}

View File

@@ -562,7 +562,7 @@ void wxNativeFontInfo::SetUnderlined(bool underlined)
lf.lfUnderline = underlined;
}
void wxNativeFontInfo::SetFaceName(wxString facename)
void wxNativeFontInfo::SetFaceName(const wxString& facename)
{
wxStrncpy(lf.lfFaceName, facename, WXSIZEOF(lf.lfFaceName));
}

View File

@@ -119,7 +119,7 @@ public:
}
// init with conversion
void Init(LV_ITEM_OTHER& item)
void Init(const LV_ITEM_OTHER& item)
{
// avoid unnecessary dynamic memory allocation, jjust make m_pItem
// point to our own m_item
@@ -659,7 +659,7 @@ bool wxListCtrl::GetColumn(int col, wxListItem& item) const
}
// Sets information about this column
bool wxListCtrl::SetColumn(int col, wxListItem& item)
bool wxListCtrl::SetColumn(int col, const wxListItem& item)
{
LV_COLUMN lvCol;
wxConvertToMSWListCol(col, item, lvCol);
@@ -1486,7 +1486,7 @@ long wxListCtrl::HitTest(const wxPoint& point, int& flags)
// Inserts an item, returning the index of the new item if successful,
// -1 otherwise.
long wxListCtrl::InsertItem(wxListItem& info)
long wxListCtrl::InsertItem(const wxListItem& info)
{
wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual controls") );
@@ -1559,7 +1559,7 @@ long wxListCtrl::InsertItem(long index, const wxString& label, int imageIndex)
}
// For list view mode (only), inserts a column.
long wxListCtrl::InsertColumn(long col, wxListItem& item)
long wxListCtrl::InsertColumn(long col, const wxListItem& item)
{
LV_COLUMN lvCol;
wxConvertToMSWListCol(col, item, lvCol);

View File

@@ -1189,7 +1189,7 @@ public:
wxDL_VOIDMETHOD_DEFINE(DestroyPortAssociation, (CGrafPtr g), (g));
wxDL_VOIDMETHOD_DEFINE(NativeEventToMacEvent, (MSG* p1, EventRecord* p2), (p1,p2));
wxDL_VOIDMETHOD_DEFINE(MCIsPlayerEvent, (ComponentInstance ci, EventRecord* p2), (ci, p2));
wxDL_METHOD_DEFINE(int, MCSetMovie, (ComponentInstance ci, Movie m, void* p1, Point w),
wxDL_METHOD_DEFINE(int, MCSetMovie, (ComponentInstance ci, Movie m, void* p1, const Point& w),
(ci,m,p1,w),0);
wxDL_VOIDMETHOD_DEFINE(MCPositionController,
(ComponentInstance ci, Rect* r, void* junk, void* morejunk), (ci,r,junk,morejunk));

View File

@@ -691,7 +691,7 @@ void wxNativeFontInfo::SetUnderlined(
} // end of wxNativeFontInfo::SetUnderlined
void wxNativeFontInfo::SetFaceName(
wxString sFacename
const wxString& sFacename
)
{
wxStrncpy((wxChar*)fa.szFacename, sFacename, WXSIZEOF(fa.szFacename));

View File

@@ -254,7 +254,7 @@ void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined))
wxFAIL_MSG( _T("not implemented") );
}
void wxNativeFontInfo::SetFaceName(wxString facename)
void wxNativeFontInfo::SetFaceName(const wxString& facename)
{
pango_font_description_set_family( description, wxGTK_CONV(facename) );
}
@@ -753,7 +753,7 @@ void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined))
// can't do this under X
}
void wxNativeFontInfo::SetFaceName(wxString facename)
void wxNativeFontInfo::SetFaceName(const wxString& facename)
{
SetXFontComponent(wxXLFD_FAMILY, facename);
}

View File

@@ -123,7 +123,7 @@ wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
// wxRegion comparison
// ----------------------------------------------------------------------------
bool wxRegion::operator==( const wxRegion& region )
bool wxRegion::operator==( const wxRegion& region ) const
{
if (m_refData == region.m_refData) return TRUE;