From fbfb8bcc3fa17e079d4219655b173f8ed2ccc65a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 24 Sep 2005 21:43:15 +0000 Subject: [PATCH] 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 --- docs/latex/wx/function.tex | 2 +- docs/latex/wx/htdcrend.tex | 2 +- docs/latex/wx/hteasypr.tex | 2 +- docs/latex/wx/htparser.tex | 2 +- docs/latex/wx/htprint.tex | 2 +- docs/latex/wx/htwindow.tex | 2 +- docs/latex/wx/htwinprs.tex | 2 +- docs/latex/wx/sizer.tex | 2 +- docs/latex/wx/sizeritem.tex | 2 +- docs/latex/wx/socksrv.tex | 2 +- include/wx/cocoa/brush.h | 4 ++-- include/wx/cocoa/cursor.h | 4 ++-- include/wx/cocoa/pen.h | 4 ++-- include/wx/dynarray.h | 8 ++++---- include/wx/effects.h | 2 +- include/wx/event.h | 4 ++-- include/wx/fileconf.h | 2 +- include/wx/fontutil.h | 2 +- include/wx/gdicmn.h | 8 ++++---- include/wx/generic/grid.h | 12 ++++++------ include/wx/generic/gridctrl.h | 10 +++++----- include/wx/generic/paletteg.h | 4 ++-- include/wx/generic/region.h | 4 ++-- include/wx/generic/textdlgg.h | 2 +- include/wx/geometry.h | 4 ++-- include/wx/gtk/region.h | 4 ++-- include/wx/gtk1/region.h | 4 ++-- include/wx/html/htmlcell.h | 6 +++--- include/wx/html/htmlpars.h | 2 +- include/wx/html/htmlwin.h | 2 +- include/wx/html/htmprint.h | 6 +++--- include/wx/html/winpars.h | 2 +- include/wx/ipcbase.h | 2 +- include/wx/mac/carbon/accel.h | 4 ++-- include/wx/mac/carbon/brush.h | 4 ++-- include/wx/mac/carbon/fontdlg.h | 2 +- include/wx/mac/carbon/metafile.h | 4 ++-- include/wx/mac/carbon/palette.h | 4 ++-- include/wx/mac/carbon/pen.h | 4 ++-- include/wx/mac/carbon/private.h | 2 +- include/wx/mac/classic/accel.h | 4 ++-- include/wx/mac/classic/brush.h | 4 ++-- include/wx/mac/classic/cursor.h | 4 ++-- include/wx/mac/classic/metafile.h | 4 ++-- include/wx/mac/classic/palette.h | 4 ++-- include/wx/mac/classic/pen.h | 4 ++-- include/wx/matrix.h | 4 ++-- include/wx/motif/accel.h | 4 ++-- include/wx/msw/listctrl.h | 6 +++--- include/wx/protocol/ftp.h | 2 +- include/wx/sckaddr.h | 2 +- include/wx/sizer.h | 10 +++++----- include/wx/socket.h | 6 +++--- include/wx/stockitem.h | 2 +- include/wx/x11/region.h | 4 ++-- samples/dnd/dnd.cpp | 4 ++-- samples/docview/doc.cpp | 2 +- samples/docview/doc.h | 2 +- samples/docvwmdi/doc.cpp | 2 +- samples/docvwmdi/doc.h | 2 +- samples/layout/layout.cpp | 2 +- samples/ownerdrw/ownerdrw.cpp | 4 ++-- samples/printing/printing.cpp | 4 ++-- samples/printing/printing.h | 2 +- samples/regtest/regtest.cpp | 4 ++-- src/common/cmdline.cpp | 2 +- src/common/effects.cpp | 2 +- src/common/fileconf.cpp | 2 +- src/common/fontcmn.cpp | 2 +- src/common/fs_mem.cpp | 2 +- src/common/ftp.cpp | 4 ++-- src/common/ipcbase.cpp | 2 +- src/common/matrix.cpp | 4 ++-- src/common/sckaddr.cpp | 2 +- src/common/sizer.cpp | 4 +++- src/common/socket.cpp | 6 +++--- src/common/stockitem.cpp | 2 +- src/generic/grid.cpp | 12 ++++++------ src/generic/gridctrl.cpp | 8 ++++---- src/generic/htmllbox.cpp | 2 +- src/generic/listctrl.cpp | 12 ++++++------ src/generic/paletteg.cpp | 4 ++-- src/generic/regiong.cpp | 2 +- src/generic/textdlgg.cpp | 2 +- src/gtk/filedlg.cpp | 2 +- src/gtk/region.cpp | 2 +- src/gtk/textctrl.cpp | 2 +- src/gtk1/filedlg.cpp | 2 +- src/gtk1/region.cpp | 2 +- src/gtk1/textctrl.cpp | 2 +- src/html/helpfrm.cpp | 2 +- src/html/htmlcell.cpp | 6 +++--- src/html/htmlpars.cpp | 2 +- src/html/htmlwin.cpp | 2 +- src/html/htmprint.cpp | 6 +++--- src/html/winpars.cpp | 2 +- src/mac/carbon/fontdlg.cpp | 2 +- src/mac/carbon/mimetmac.cpp | 2 +- src/mac/carbon/textctrl.cpp | 4 ++-- src/mac/carbon/tooltip.cpp | 4 ++-- src/mac/carbon/toplevel.cpp | 4 ++-- src/motif/clipbrd.cpp | 6 +++--- src/motif/spinbutt.cpp | 2 +- src/motif/utils.cpp | 4 ++-- src/motif/window.cpp | 2 +- src/msw/font.cpp | 2 +- src/msw/listctrl.cpp | 8 ++++---- src/msw/mediactrl.cpp | 2 +- src/os2/font.cpp | 2 +- src/unix/fontutil.cpp | 4 ++-- src/x11/region.cpp | 2 +- 111 files changed, 199 insertions(+), 197 deletions(-) diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index 619b25dee1..7e4a4f8599 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -3014,7 +3014,7 @@ See also \helpref{wxWriteResource}{wxwriteresource}, \helpref{wxConfigBase}{wxco \membersection{::wxGetStockLabel}\label{wxgetstocklabel} -\func{wxString}{wxGetStockLabel}{\param{wxWindowID }{id}, \param{bool }{withCodes = true}, \param{wxString }{accelerator = wxEmptyString}} +\func{wxString}{wxGetStockLabel}{\param{wxWindowID }{id}, \param{bool }{withCodes = true}, \param{const wxString\& }{accelerator = wxEmptyString}} Returns label that should be used for given {\it id} element. diff --git a/docs/latex/wx/htdcrend.tex b/docs/latex/wx/htdcrend.tex index 0d1bcd9af5..f7623eb322 100644 --- a/docs/latex/wx/htdcrend.tex +++ b/docs/latex/wx/htdcrend.tex @@ -37,7 +37,7 @@ inch wide on typical printer. With pixel\_scale = 3.0 it would be 3 inches.) \membersection{wxHtmlDCRenderer::SetFonts}\label{wxhtmldcrenderersetfonts} -\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}} +\func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}} Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for detailed description. diff --git a/docs/latex/wx/hteasypr.tex b/docs/latex/wx/hteasypr.tex index 5418d50852..7958055e71 100644 --- a/docs/latex/wx/hteasypr.tex +++ b/docs/latex/wx/hteasypr.tex @@ -101,7 +101,7 @@ Display page setup dialog and allows the user to modify settings. \membersection{wxHtmlEasyPrinting::SetFonts}\label{wxhtmleasyprintingsetfonts} -\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}} +\func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}} Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for detailed description. diff --git a/docs/latex/wx/htparser.tex b/docs/latex/wx/htparser.tex index 669bfc14ea..bc373af4be 100644 --- a/docs/latex/wx/htparser.tex +++ b/docs/latex/wx/htparser.tex @@ -190,7 +190,7 @@ You shouldn't use InitParser, DoParsing, GetProduct or DoneParser directly. \membersection{wxHtmlParser::PushTagHandler}\label{wxhtmlparserpushtaghandler} -\func{void}{PushTagHandler}{\param{wxHtmlTagHandler* }{handler}, \param{wxString }{tags}} +\func{void}{PushTagHandler}{\param{wxHtmlTagHandler* }{handler}, \param{const wxString\& }{tags}} Forces the handler to handle additional tags (not returned by \helpref{GetSupportedTags}{wxhtmltaghandlergetsupportedtags}). diff --git a/docs/latex/wx/htprint.tex b/docs/latex/wx/htprint.tex index 197a57cd3a..15f4ef87a0 100644 --- a/docs/latex/wx/htprint.tex +++ b/docs/latex/wx/htprint.tex @@ -36,7 +36,7 @@ further information. \membersection{wxHtmlPrintout::SetFonts}\label{wxhtmlprintoutsetfonts} -\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}} +\func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}} Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for detailed description. diff --git a/docs/latex/wx/htwindow.tex b/docs/latex/wx/htwindow.tex index 52bf97972f..01c50a9223 100644 --- a/docs/latex/wx/htwindow.tex +++ b/docs/latex/wx/htwindow.tex @@ -354,7 +354,7 @@ This function sets the space between border of window and HTML contents. See ima \membersection{wxHtmlWindow::SetFonts}\label{wxhtmlwindowsetfonts} -\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}} +\func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}} This function sets font sizes and faces. diff --git a/docs/latex/wx/htwinprs.tex b/docs/latex/wx/htwinprs.tex index 5260ccd2d4..5a24cf285b 100644 --- a/docs/latex/wx/htwinprs.tex +++ b/docs/latex/wx/htwinprs.tex @@ -269,7 +269,7 @@ Sets underlined flag of actualfont. {\it x} is either true of false. \membersection{wxHtmlWinParser::SetFonts}\label{wxhtmlwinparsersetfonts} -\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes = NULL}} +\func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}} Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for detailed description. diff --git a/docs/latex/wx/sizer.tex b/docs/latex/wx/sizer.tex index c871edc5a9..a0c77ab757 100644 --- a/docs/latex/wx/sizer.tex +++ b/docs/latex/wx/sizer.tex @@ -384,7 +384,7 @@ by the sizer to resize themselves according to the rules defined by the paramete \func{void}{SetMinSize}{\param{int }{width}, \param{int }{height}} -\func{void}{SetMinSize}{\param{wxSize }{size}} +\func{void}{SetMinSize}{\param{const wxSize\& }{size}} Call this to give the sizer a minimal size. Normally, the sizer will calculate its minimal size based purely on how much space its children need. After calling this diff --git a/docs/latex/wx/sizeritem.tex b/docs/latex/wx/sizeritem.tex index 745b5964ea..885981eaef 100644 --- a/docs/latex/wx/sizeritem.tex +++ b/docs/latex/wx/sizeritem.tex @@ -183,7 +183,7 @@ Set the border item attribute. \membersection{wxSizerItem::SetDimension}\label{wxsizeritemsetdimension} -\func{void}{SetDimension}{\param{wxPoint }{pos}, \param{wxSize }{size}} +\func{void}{SetDimension}{\param{const wxPoint\& }{pos}, \param{const wxSize\& }{size}} Set the position and size of the space allocated to the sizer, and adjust the position and size of the item to be within that space diff --git a/docs/latex/wx/socksrv.tex b/docs/latex/wx/socksrv.tex index be485c6c63..f4e4553fe5 100644 --- a/docs/latex/wx/socksrv.tex +++ b/docs/latex/wx/socksrv.tex @@ -32,7 +32,7 @@ % \membersection{wxSocketServer::wxSocketServer}\label{wxsocketserverctor} -\func{}{wxSocketServer}{\param{wxSockAddress\&}{ address}, \param{wxSocketFlags}{ flags = wxSOCKET\_NONE}} +\func{}{wxSocketServer}{\param{const wxSockAddress\&}{ address}, \param{wxSocketFlags}{ flags = wxSOCKET\_NONE}} Constructs a new server and tries to bind to the specified {\it address}. Before trying to accept new connections, test whether it succeeded with diff --git a/include/wx/cocoa/brush.h b/include/wx/cocoa/brush.h index e3d793db54..728a0ab2de 100644 --- a/include/wx/cocoa/brush.h +++ b/include/wx/cocoa/brush.h @@ -49,9 +49,9 @@ public: { if (*this == brush) return (*this); Ref(brush); return *this; } // comparison - bool operator == (const wxBrush& brush) + bool operator == (const wxBrush& brush) const { return m_refData == brush.m_refData; } - bool operator != (const wxBrush& brush) + bool operator != (const wxBrush& brush) const { return m_refData != brush.m_refData; } // accessors diff --git a/include/wx/cocoa/cursor.h b/include/wx/cocoa/cursor.h index c34f16eb8d..25bd551455 100644 --- a/include/wx/cocoa/cursor.h +++ b/include/wx/cocoa/cursor.h @@ -57,8 +57,8 @@ public: virtual bool Ok() const { return m_refData ; } inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; } - inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; } - inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; } + inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; } + inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; } inline WX_NSCursor GetNSCursor() const { diff --git a/include/wx/cocoa/pen.h b/include/wx/cocoa/pen.h index 01d4ef5d91..6608e2c978 100644 --- a/include/wx/cocoa/pen.h +++ b/include/wx/cocoa/pen.h @@ -39,9 +39,9 @@ public: inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; } - inline bool operator == (const wxPen& pen) + inline bool operator == (const wxPen& pen) const { return m_refData == pen.m_refData; } - inline bool operator != (const wxPen& pen) + inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; } virtual bool Ok() const { return (m_refData != NULL) ; } diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index 18c1d42702..4aaf0f8b42 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -400,8 +400,8 @@ public: \ { reverse_iterator tmp = *this; --m_ptr; return tmp; } \ itor& operator--() { ++m_ptr; return *this; } \ const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; }\ - bool operator ==(const itor& it) { return m_ptr == it.m_ptr; } \ - bool operator !=(const itor& it) { return m_ptr != it.m_ptr; } \ + bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }\ + bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }\ }; \ \ class const_reverse_iterator \ @@ -433,8 +433,8 @@ public: \ { itor tmp = *this; --m_ptr; return tmp; } \ itor& operator--() { ++m_ptr; return *this; } \ const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; }\ - bool operator ==(const itor& it) { return m_ptr == it.m_ptr; } \ - bool operator !=(const itor& it) { return m_ptr != it.m_ptr; } \ + bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }\ + bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }\ }; \ \ name(size_type n, const_reference v) { assign(n, v); } \ diff --git a/include/wx/effects.h b/include/wx/effects.h index 55f988ff53..64f7d02eee 100644 --- a/include/wx/effects.h +++ b/include/wx/effects.h @@ -57,7 +57,7 @@ public: void DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize = 1); // Tile a bitmap - bool TileBitmap(const wxRect& rect, wxDC& dc, wxBitmap& bitmap); + bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap); protected: wxColour m_highlightColour; // Usually white diff --git a/include/wx/event.h b/include/wx/event.h index 0ded7cd2da..7d6f0a0076 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1088,7 +1088,7 @@ public: wxSize GetSize() const { return m_size; } wxRect GetRect() const { return m_rect; } - void SetRect(wxRect rect) { m_rect = rect; } + void SetRect(const wxRect& rect) { m_rect = rect; } virtual wxEvent *Clone() const { return new wxSizeEvent(*this); } @@ -1128,7 +1128,7 @@ public: wxPoint GetPosition() const { return m_pos; } void SetPosition(const wxPoint& pos) { m_pos = pos; } wxRect GetRect() const { return m_rect; } - void SetRect(wxRect rect) { m_rect = rect; } + void SetRect(const wxRect& rect) { m_rect = rect; } virtual wxEvent *Clone() const { return new wxMoveEvent(*this); } diff --git a/include/wx/fileconf.h b/include/wx/fileconf.h index a3b6391b5a..79828da710 100644 --- a/include/wx/fileconf.h +++ b/include/wx/fileconf.h @@ -200,7 +200,7 @@ private: void CleanUp(); // parse the whole file - void Parse(wxTextBuffer& buffer, bool bLocal); + void Parse(const wxTextBuffer& buffer, bool bLocal); // the same as SetPath("/") void SetRootPath(); diff --git a/include/wx/fontutil.h b/include/wx/fontutil.h index becafbc25e..d2491dcbc5 100644 --- a/include/wx/fontutil.h +++ b/include/wx/fontutil.h @@ -195,7 +195,7 @@ public: void SetStyle(wxFontStyle style); void SetWeight(wxFontWeight weight); void SetUnderlined(bool underlined); - void SetFaceName(wxString facename); + void SetFaceName(const wxString& facename); void SetFamily(wxFontFamily family); void SetEncoding(wxFontEncoding encoding); diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index ff28ea2f1c..5018eece64 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -213,10 +213,10 @@ public: bool operator==(const wxSize& sz) const { return x == sz.x && y == sz.y; } bool operator!=(const wxSize& sz) const { return x != sz.x || y != sz.y; } - wxSize operator+(const wxSize& sz) { return wxSize(x + sz.x, y + sz.y); } - wxSize operator-(const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); } - wxSize operator/(const int i) { return wxSize(x / i, y / i); } - wxSize operator*(const int i) { return wxSize(x * i, y * i); } + wxSize operator+(const wxSize& sz) const { return wxSize(x + sz.x, y + sz.y); } + wxSize operator-(const wxSize& sz) const { return wxSize(x - sz.x, y - sz.y); } + wxSize operator/(int i) const { return wxSize(x / i, y / i); } + wxSize operator*(int i) const { return wxSize(x * i, y * i); } wxSize& operator+=(const wxSize& sz) { x += sz.x; y += sz.y; return *this; } wxSize& operator-=(const wxSize& sz) { x -= sz.x; y -= sz.y; return *this; } diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 8701a1941b..0d73cd15d5 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -180,13 +180,13 @@ public: protected: // set the text colours before drawing - void SetTextColoursAndFont(wxGrid& grid, - wxGridCellAttr& attr, + void SetTextColoursAndFont(const wxGrid& grid, + const wxGridCellAttr& attr, wxDC& dc, bool isSelected); // calc the string extent for given string/font - wxSize DoGetBestSize(wxGridCellAttr& attr, + wxSize DoGetBestSize(const wxGridCellAttr& attr, wxDC& dc, const wxString& text); }; @@ -212,7 +212,7 @@ public: { return new wxGridCellNumberRenderer; } protected: - wxString GetString(wxGrid& grid, int row, int col); + wxString GetString(const wxGrid& grid, int row, int col); }; class WXDLLIMPEXP_ADV wxGridCellFloatRenderer : public wxGridCellStringRenderer @@ -245,7 +245,7 @@ public: virtual wxGridCellRenderer *Clone() const; protected: - wxString GetString(wxGrid& grid, int row, int col); + wxString GetString(const wxGrid& grid, int row, int col); private: // formatting parameters @@ -1175,7 +1175,7 @@ public: // void StringToLines( const wxString& value, wxArrayString& lines ); - void GetTextBoxSize( wxDC& dc, + void GetTextBoxSize( const wxDC& dc, const wxArrayString& lines, long *width, long *height ); diff --git a/include/wx/generic/gridctrl.h b/include/wx/generic/gridctrl.h index a51708b790..31849d7d39 100644 --- a/include/wx/generic/gridctrl.h +++ b/include/wx/generic/gridctrl.h @@ -28,8 +28,8 @@ class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellStringRenderer { public: - wxGridCellDateTimeRenderer(wxString outformat = wxDefaultDateTimeFormat, - wxString informat = wxDefaultDateTimeFormat); + wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat, + const wxString& informat = wxDefaultDateTimeFormat); // draw the string right aligned virtual void Draw(wxGrid& grid, @@ -50,7 +50,7 @@ public: virtual void SetParameters(const wxString& params); protected: - wxString GetString(wxGrid& grid, int row, int col); + wxString GetString(const wxGrid& grid, int row, int col); wxString m_iformat; wxString m_oformat; @@ -85,7 +85,7 @@ public: virtual void SetParameters(const wxString& params); protected: - wxString GetString(wxGrid& grid, int row, int col); + wxString GetString(const wxGrid& grid, int row, int col); wxArrayString m_choices; }; @@ -149,7 +149,7 @@ public: private: wxArrayString GetTextLines( wxGrid& grid, wxDC& dc, - wxGridCellAttr& attr, + const wxGridCellAttr& attr, const wxRect& rect, int row, int col); diff --git a/include/wx/generic/paletteg.h b/include/wx/generic/paletteg.h index 438af448c1..4f1ee46384 100644 --- a/include/wx/generic/paletteg.h +++ b/include/wx/generic/paletteg.h @@ -38,8 +38,8 @@ class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase wxPalette( const wxPalette& palette ); ~wxPalette(); wxPalette& operator = ( const wxPalette& palette ); - bool operator == ( const wxPalette& palette ); - bool operator != ( const wxPalette& palette ); + bool operator == ( const wxPalette& palette ) const; + bool operator != ( const wxPalette& palette ) const; virtual bool Ok() const; bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); diff --git a/include/wx/generic/region.h b/include/wx/generic/region.h index 1657415892..1163dc9be7 100644 --- a/include/wx/generic/region.h +++ b/include/wx/generic/region.h @@ -44,8 +44,8 @@ public: bool Ok() const { return m_refData != NULL; } - bool operator == ( const wxRegionGeneric& region ); - bool operator != ( const wxRegionGeneric& region ) { return !(*this == region); } + bool operator == ( const wxRegionGeneric& region ) const; + bool operator != ( const wxRegionGeneric& region ) const { return !(*this == region); } //# Modify region // Clear current region diff --git a/include/wx/generic/textdlgg.h b/include/wx/generic/textdlgg.h index 8825d90216..b8f4eb474a 100644 --- a/include/wx/generic/textdlgg.h +++ b/include/wx/generic/textdlgg.h @@ -47,7 +47,7 @@ public: wxString GetValue() const { return m_value; } #if wxUSE_VALIDATORS - void SetTextValidator( wxTextValidator& validator ); + void SetTextValidator( const wxTextValidator& validator ); void SetTextValidator( long style = wxFILTER_NONE ); wxTextValidator* GetTextValidator() { return (wxTextValidator*)m_textctrl->GetValidator(); } #endif diff --git a/include/wx/geometry.h b/include/wx/geometry.h index bf32e5b2b2..d38e7ab210 100644 --- a/include/wx/geometry.h +++ b/include/wx/geometry.h @@ -627,9 +627,9 @@ public: m_width *= ((wxDouble)num)/((wxDouble)denum); m_height *= ((wxDouble)num)/((wxDouble)denum);} wxRect2DDouble& operator = (const wxRect2DDouble& rect); - inline bool operator == (const wxRect2DDouble& rect) + inline bool operator == (const wxRect2DDouble& rect) const { return (m_x==rect.m_x && m_y==rect.m_y && m_width==rect.m_width && m_height==rect.m_height); } - inline bool operator != (const wxRect2DDouble& rect) + inline bool operator != (const wxRect2DDouble& rect) const { return !(*this == rect); } wxDouble m_x; diff --git a/include/wx/gtk/region.h b/include/wx/gtk/region.h index fa396d31e1..f9925be044 100644 --- a/include/wx/gtk/region.h +++ b/include/wx/gtk/region.h @@ -87,8 +87,8 @@ public: bool Ok() const { return m_refData != NULL; } - bool operator == ( const wxRegion& region ); - bool operator != ( const wxRegion& region ) { return !(*this == region); } + bool operator == ( const wxRegion& region ) const; + bool operator != ( const wxRegion& region ) const { return !(*this == region); } void Clear(); diff --git a/include/wx/gtk1/region.h b/include/wx/gtk1/region.h index fa396d31e1..f9925be044 100644 --- a/include/wx/gtk1/region.h +++ b/include/wx/gtk1/region.h @@ -87,8 +87,8 @@ public: bool Ok() const { return m_refData != NULL; } - bool operator == ( const wxRegion& region ); - bool operator != ( const wxRegion& region ) { return !(*this == region); } + bool operator == ( const wxRegion& region ) const; + bool operator != ( const wxRegion& region ) const { return !(*this == region); } void Clear(); diff --git a/include/wx/html/htmlcell.h b/include/wx/html/htmlcell.h index a37ac64d5c..d1570257cb 100644 --- a/include/wx/html/htmlcell.h +++ b/include/wx/html/htmlcell.h @@ -333,7 +333,7 @@ protected: class WXDLLIMPEXP_HTML wxHtmlWordCell : public wxHtmlCell { public: - wxHtmlWordCell(const wxString& word, wxDC& dc); + wxHtmlWordCell(const wxString& word, const wxDC& dc); void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo& info); wxCursor GetCursor() const; @@ -343,8 +343,8 @@ public: void SetPreviousWord(wxHtmlWordCell *cell); protected: - void SetSelectionPrivPos(wxDC& dc, wxHtmlSelection *s) const; - void Split(wxDC& dc, + void SetSelectionPrivPos(const wxDC& dc, wxHtmlSelection *s) const; + void Split(const wxDC& dc, const wxPoint& selFrom, const wxPoint& selTo, unsigned& pos1, unsigned& pos2) const; diff --git a/include/wx/html/htmlpars.h b/include/wx/html/htmlpars.h index 446fa3cba2..d102b6c8dd 100644 --- a/include/wx/html/htmlpars.h +++ b/include/wx/html/htmlpars.h @@ -99,7 +99,7 @@ public: // handler can handle only 'myitems' (e.g. it's GetSupportedTags returns "MYITEMS") // you can call PushTagHandler(handler, "IT") when you find // and call PopTagHandler() when you find - void PushTagHandler(wxHtmlTagHandler *handler, wxString tags); + void PushTagHandler(wxHtmlTagHandler *handler, const wxString& tags); // Restores state before last call to PushTagHandler void PopTagHandler(); diff --git a/include/wx/html/htmlwin.h b/include/wx/html/htmlwin.h index 9d961b27d8..57cc3f500b 100644 --- a/include/wx/html/htmlwin.h +++ b/include/wx/html/htmlwin.h @@ -123,7 +123,7 @@ public: #endif // wxUSE_STATUSBAR // Sets fonts to be used when displaying HTML page. - void SetFonts(wxString normal_face, wxString fixed_face, + void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); // Sets font sizes to be relative to the given size or the system diff --git a/include/wx/html/htmprint.h b/include/wx/html/htmprint.h index 558f24130f..b407ebeeec 100644 --- a/include/wx/html/htmprint.h +++ b/include/wx/html/htmprint.h @@ -53,7 +53,7 @@ public: void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = true); // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). - void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL); + void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); // Sets font sizes to be relative to the given size or the system // default size; use either specified or default font @@ -143,7 +143,7 @@ public: // You can set different header/footer for odd and even pages // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). - void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL); + void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); // Sets font sizes to be relative to the given size or the system // default size; use either specified or default font @@ -242,7 +242,7 @@ public: // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants. // You can set different header/footer for odd and even pages - void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = 0); + void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = 0); // Sets fonts to be used when displaying HTML page. (if size null then default sizes used) // Sets font sizes to be relative to the given size or the system diff --git a/include/wx/html/winpars.h b/include/wx/html/winpars.h index 783b172052..6bd5fa2a6b 100644 --- a/include/wx/html/winpars.h +++ b/include/wx/html/winpars.h @@ -65,7 +65,7 @@ public: wxHtmlWindow *GetWindow() {return m_Window;} // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). - void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL); + void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); // Sets font sizes to be relative to the given size or the system // default size; use either specified or default font diff --git a/include/wx/ipcbase.h b/include/wx/ipcbase.h index 28fb1f46cb..cfc442eb97 100644 --- a/include/wx/ipcbase.h +++ b/include/wx/ipcbase.h @@ -48,7 +48,7 @@ class WXDLLIMPEXP_BASE wxConnectionBase: public wxObject public: wxConnectionBase(wxChar *buffer, int size); // use external buffer wxConnectionBase(); // use internal, adaptive buffer - wxConnectionBase(wxConnectionBase& copy); + wxConnectionBase(const wxConnectionBase& copy); ~wxConnectionBase(void); void SetConnected( bool c ) { m_connected = c; } diff --git a/include/wx/mac/carbon/accel.h b/include/wx/mac/carbon/accel.h index d68b50d597..6d34d460d8 100644 --- a/include/wx/mac/carbon/accel.h +++ b/include/wx/mac/carbon/accel.h @@ -33,9 +33,9 @@ public: wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; } - bool operator == (const wxAcceleratorTable& accel) + bool operator == (const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; } - bool operator != (const wxAcceleratorTable& accel) + bool operator != (const wxAcceleratorTable& accel) const { return m_refData != accel.m_refData; } bool Ok() const; diff --git a/include/wx/mac/carbon/brush.h b/include/wx/mac/carbon/brush.h index c99c10daf0..2bdfa0fb13 100644 --- a/include/wx/mac/carbon/brush.h +++ b/include/wx/mac/carbon/brush.h @@ -49,9 +49,9 @@ public: wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; } - bool operator == (const wxBrush& brush) + bool operator == (const wxBrush& brush) const { return m_refData == brush.m_refData; } - bool operator != (const wxBrush& brush) + bool operator != (const wxBrush& brush) const { return m_refData != brush.m_refData; } wxMacBrushKind MacGetBrushKind() const ; diff --git a/include/wx/mac/carbon/fontdlg.h b/include/wx/mac/carbon/fontdlg.h index fca0112cac..b69a9fe74c 100644 --- a/include/wx/mac/carbon/fontdlg.h +++ b/include/wx/mac/carbon/fontdlg.h @@ -34,7 +34,7 @@ public: wxFontData& GetFontData() { return m_fontData; } bool IsShown() const; void OnPanelClose(); - void SetData(wxFontData& data); + void SetData(const wxFontData& data); protected: wxWindow* m_dialogParent; diff --git a/include/wx/mac/carbon/metafile.h b/include/wx/mac/carbon/metafile.h index 23a0dc9570..7bf91023d1 100644 --- a/include/wx/mac/carbon/metafile.h +++ b/include/wx/mac/carbon/metafile.h @@ -64,8 +64,8 @@ public: // Operators inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; } - inline bool operator == (const wxMetafile& metafile) { return m_refData == metafile.m_refData; } - inline bool operator != (const wxMetafile& metafile) { return m_refData != metafile.m_refData; } + inline bool operator == (const wxMetafile& metafile) const { return m_refData == metafile.m_refData; } + inline bool operator != (const wxMetafile& metafile) const { return m_refData != metafile.m_refData; } protected: }; diff --git a/include/wx/mac/carbon/palette.h b/include/wx/mac/carbon/palette.h index 414e7eb315..04368cb846 100644 --- a/include/wx/mac/carbon/palette.h +++ b/include/wx/mac/carbon/palette.h @@ -51,8 +51,8 @@ public: virtual bool Ok() const { return (m_refData != NULL) ; } inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; } - inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; } - inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; } + inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } + inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } /* TODO: implementation inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); } diff --git a/include/wx/mac/carbon/pen.h b/include/wx/mac/carbon/pen.h index db2d4ebc53..a6055de188 100644 --- a/include/wx/mac/carbon/pen.h +++ b/include/wx/mac/carbon/pen.h @@ -58,8 +58,8 @@ public: ~wxPen(); inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; } - inline bool operator == (const wxPen& pen) { return m_refData == pen.m_refData; } - inline bool operator != (const wxPen& pen) { return m_refData != pen.m_refData; } + inline bool operator == (const wxPen& pen) const { return m_refData == pen.m_refData; } + inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; } virtual bool Ok() const { return (m_refData != NULL) ; } diff --git a/include/wx/mac/carbon/private.h b/include/wx/mac/carbon/private.h index bc08be5c3d..90e220dee9 100644 --- a/include/wx/mac/carbon/private.h +++ b/include/wx/mac/carbon/private.h @@ -753,7 +753,7 @@ private : // toplevel.cpp -ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow, Point location , WindowRef window , ControlPartCode *outPart ) ; +ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow, const Point& location , WindowRef window , ControlPartCode *outPart ) ; #endif // wxUSE_GUI diff --git a/include/wx/mac/classic/accel.h b/include/wx/mac/classic/accel.h index d68b50d597..6d34d460d8 100644 --- a/include/wx/mac/classic/accel.h +++ b/include/wx/mac/classic/accel.h @@ -33,9 +33,9 @@ public: wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; } - bool operator == (const wxAcceleratorTable& accel) + bool operator == (const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; } - bool operator != (const wxAcceleratorTable& accel) + bool operator != (const wxAcceleratorTable& accel) const { return m_refData != accel.m_refData; } bool Ok() const; diff --git a/include/wx/mac/classic/brush.h b/include/wx/mac/classic/brush.h index 16b517550f..51cf58939c 100644 --- a/include/wx/mac/classic/brush.h +++ b/include/wx/mac/classic/brush.h @@ -49,9 +49,9 @@ public: wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; } - bool operator == (const wxBrush& brush) + bool operator == (const wxBrush& brush) const { return m_refData == brush.m_refData; } - bool operator != (const wxBrush& brush) + bool operator != (const wxBrush& brush) const { return m_refData != brush.m_refData; } wxMacBrushKind MacGetBrushKind() const ; diff --git a/include/wx/mac/classic/cursor.h b/include/wx/mac/classic/cursor.h index 2ba5cd064e..2ceb41e993 100644 --- a/include/wx/mac/classic/cursor.h +++ b/include/wx/mac/classic/cursor.h @@ -64,8 +64,8 @@ public: virtual bool Ok() const { return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; } inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; } - inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; } - inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; } + inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; } + inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; } void MacInstall() const ; diff --git a/include/wx/mac/classic/metafile.h b/include/wx/mac/classic/metafile.h index 2b528efeca..7026e1bc54 100644 --- a/include/wx/mac/classic/metafile.h +++ b/include/wx/mac/classic/metafile.h @@ -75,8 +75,8 @@ public: // Operators inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; } - inline bool operator == (const wxMetafile& metafile) { return m_refData == metafile.m_refData; } - inline bool operator != (const wxMetafile& metafile) { return m_refData != metafile.m_refData; } + inline bool operator == (const wxMetafile& metafile) const { return m_refData == metafile.m_refData; } + inline bool operator != (const wxMetafile& metafile) const { return m_refData != metafile.m_refData; } protected: }; diff --git a/include/wx/mac/classic/palette.h b/include/wx/mac/classic/palette.h index 414e7eb315..04368cb846 100644 --- a/include/wx/mac/classic/palette.h +++ b/include/wx/mac/classic/palette.h @@ -51,8 +51,8 @@ public: virtual bool Ok() const { return (m_refData != NULL) ; } inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; } - inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; } - inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; } + inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } + inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } /* TODO: implementation inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); } diff --git a/include/wx/mac/classic/pen.h b/include/wx/mac/classic/pen.h index db2d4ebc53..a6055de188 100644 --- a/include/wx/mac/classic/pen.h +++ b/include/wx/mac/classic/pen.h @@ -58,8 +58,8 @@ public: ~wxPen(); inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; } - inline bool operator == (const wxPen& pen) { return m_refData == pen.m_refData; } - inline bool operator != (const wxPen& pen) { return m_refData != pen.m_refData; } + inline bool operator == (const wxPen& pen) const { return m_refData == pen.m_refData; } + inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; } virtual bool Ok() const { return (m_refData != NULL) ; } diff --git a/include/wx/matrix.h b/include/wx/matrix.h index 67bee817b7..8061667a3a 100644 --- a/include/wx/matrix.h +++ b/include/wx/matrix.h @@ -48,8 +48,8 @@ public: void SetValue(int col, int row, double value); void operator = (const wxTransformMatrix& mat); - bool operator == (const wxTransformMatrix& mat); - bool operator != (const wxTransformMatrix& mat); + bool operator == (const wxTransformMatrix& mat) const; + bool operator != (const wxTransformMatrix& mat) const; //multiply every element by t wxTransformMatrix& operator*=(const double& t); diff --git a/include/wx/motif/accel.h b/include/wx/motif/accel.h index 901019fca5..78605a9c4c 100644 --- a/include/wx/motif/accel.h +++ b/include/wx/motif/accel.h @@ -31,8 +31,8 @@ public: ~wxAcceleratorTable(); wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; } - bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; } - bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; } + bool operator == (const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; } + bool operator != (const wxAcceleratorTable& accel) const { return m_refData != accel.m_refData; } bool Ok() const; diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index d7fc57e1ce..308304f780 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -120,7 +120,7 @@ public: bool GetColumn(int col, wxListItem& item) const; // Sets information about this column - bool SetColumn(int col, wxListItem& item) ; + bool SetColumn(int col, const wxListItem& item) ; // Gets the column width int GetColumnWidth(int col) const; @@ -298,7 +298,7 @@ public: // Inserts an item, returning the index of the new item if successful, // -1 otherwise. - long InsertItem(wxListItem& info); + long InsertItem(const wxListItem& info); // Insert a string item long InsertItem(long index, const wxString& label); @@ -310,7 +310,7 @@ public: long InsertItem(long index, const wxString& label, int imageIndex); // For list view mode (only), inserts a column. - long InsertColumn(long col, wxListItem& info); + long InsertColumn(long col, const wxListItem& info); long InsertColumn(long col, const wxString& heading, diff --git a/include/wx/protocol/ftp.h b/include/wx/protocol/ftp.h index f79c40f1bc..03a1a6ba69 100644 --- a/include/wx/protocol/ftp.h +++ b/include/wx/protocol/ftp.h @@ -138,7 +138,7 @@ protected: wxSocketBase *GetActivePort(); // helper for GetPort() - wxString GetPortCmdArgument(wxIPV4address Local, wxIPV4address New); + wxString GetPortCmdArgument(const wxIPV4address& Local, const wxIPV4address& New); // accept connection from server in active mode, returns the same socket as // passed in in passive mode diff --git a/include/wx/sckaddr.h b/include/wx/sckaddr.h index e1ffdb1c84..98e1c0d4e7 100644 --- a/include/wx/sckaddr.h +++ b/include/wx/sckaddr.h @@ -104,7 +104,7 @@ public: virtual int Type() { return wxSockAddress::IPV4; } virtual wxSockAddress *Clone() const; - bool operator==(wxIPV4address& addr); + bool operator==(const wxIPV4address& addr) const; private: wxString m_origHostname; diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 5407125af4..28965fe97e 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -184,7 +184,7 @@ public: virtual wxSize GetSize() const; virtual wxSize CalcMin(); - virtual void SetDimension( wxPoint pos, wxSize size ); + virtual void SetDimension( const wxPoint& pos, const wxSize& size ); wxSize GetMinSize() const { return m_minSize; } @@ -406,24 +406,24 @@ public: void SetMinSize( int width, int height ) { DoSetMinSize( width, height ); } - void SetMinSize( wxSize size ) + void SetMinSize( const wxSize& size ) { DoSetMinSize( size.x, size.y ); } // Searches recursively bool SetItemMinSize( wxWindow *window, int width, int height ) { return DoSetItemMinSize( window, width, height ); } - bool SetItemMinSize( wxWindow *window, wxSize size ) + bool SetItemMinSize( wxWindow *window, const wxSize& size ) { return DoSetItemMinSize( window, size.x, size.y ); } // Searches recursively bool SetItemMinSize( wxSizer *sizer, int width, int height ) { return DoSetItemMinSize( sizer, width, height ); } - bool SetItemMinSize( wxSizer *sizer, wxSize size ) + bool SetItemMinSize( wxSizer *sizer, const wxSize& size ) { return DoSetItemMinSize( sizer, size.x, size.y ); } bool SetItemMinSize( size_t index, int width, int height ) { return DoSetItemMinSize( index, width, height ); } - bool SetItemMinSize( size_t index, wxSize size ) + bool SetItemMinSize( size_t index, const wxSize& size ) { return DoSetItemMinSize( index, size.x, size.y ); } wxSize GetSize() const diff --git a/include/wx/socket.h b/include/wx/socket.h index cd152bae2e..ac1c7d3640 100644 --- a/include/wx/socket.h +++ b/include/wx/socket.h @@ -230,7 +230,7 @@ class WXDLLIMPEXP_NET wxSocketServer : public wxSocketBase DECLARE_CLASS(wxSocketServer) public: - wxSocketServer(wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE); + wxSocketServer(const wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE); wxSocketBase* Accept(bool wait = true); bool AcceptWith(wxSocketBase& socket, bool wait = true); @@ -272,12 +272,12 @@ class WXDLLIMPEXP_NET wxDatagramSocket : public wxSocketBase DECLARE_CLASS(wxDatagramSocket) public: - wxDatagramSocket(wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE); + wxDatagramSocket(const wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE); wxDatagramSocket& RecvFrom( wxSockAddress& addr, void* buf, wxUint32 nBytes ); - wxDatagramSocket& SendTo( wxSockAddress& addr, + wxDatagramSocket& SendTo( const wxSockAddress& addr, const void* buf, wxUint32 nBytes ); diff --git a/include/wx/stockitem.h b/include/wx/stockitem.h index 6c1740c64a..7d2b214297 100644 --- a/include/wx/stockitem.h +++ b/include/wx/stockitem.h @@ -31,7 +31,7 @@ WXDLLEXPORT bool wxIsStockLabel(wxWindowID id, const wxString& label); // for wxSTOCK_OK): WXDLLEXPORT wxString wxGetStockLabel(wxWindowID id, bool withCodes = true, - wxString accelerator = wxEmptyString); + const wxString& accelerator = wxEmptyString); #ifdef __WXGTK20__ // Translates stock ID to GTK+'s stock item string indentifier: diff --git a/include/wx/x11/region.h b/include/wx/x11/region.h index b2e66e71c2..b4c1ce349a 100644 --- a/include/wx/x11/region.h +++ b/include/wx/x11/region.h @@ -87,8 +87,8 @@ public: bool Ok() const { return m_refData != NULL; } - bool operator == ( const wxRegion& region ); - bool operator != ( const wxRegion& region ) { return !(*this == region); } + bool operator == ( const wxRegion& region ) const; + bool operator != ( const wxRegion& region ) const { return !(*this == region); } void Clear(); diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index a0d8b11dc8..acc50c0de1 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -199,7 +199,7 @@ private: class DnDFrame : public wxFrame { public: - DnDFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h); + DnDFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h); virtual ~DnDFrame(); void OnPaint(wxPaintEvent& event); @@ -920,7 +920,7 @@ bool DnDApp::OnInit() #if wxUSE_DRAG_AND_DROP || wxUSE_CLIPBOARD -DnDFrame::DnDFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h) +DnDFrame::DnDFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h) : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)), m_strText(_T("wxWidgets drag & drop works :-)")) diff --git a/samples/docview/doc.cpp b/samples/docview/doc.cpp index f4b5f587c4..cc04558350 100644 --- a/samples/docview/doc.cpp +++ b/samples/docview/doc.cpp @@ -119,7 +119,7 @@ wxInputStream& DrawingDocument::LoadObject(wxInputStream& stream) } #endif -DoodleSegment::DoodleSegment(DoodleSegment& seg):wxObject() +DoodleSegment::DoodleSegment(const DoodleSegment& seg):wxObject() { wxList::compatibility_iterator node = seg.lines.GetFirst(); while (node) diff --git a/samples/docview/doc.h b/samples/docview/doc.h index 516aee30d4..af9b272fbe 100644 --- a/samples/docview/doc.h +++ b/samples/docview/doc.h @@ -32,7 +32,7 @@ public: wxList lines; DoodleSegment(void){}; - DoodleSegment(DoodleSegment& seg); + DoodleSegment(const DoodleSegment& seg); ~DoodleSegment(void); void Draw(wxDC *dc); diff --git a/samples/docvwmdi/doc.cpp b/samples/docvwmdi/doc.cpp index eaefcc9468..292c280f12 100644 --- a/samples/docvwmdi/doc.cpp +++ b/samples/docvwmdi/doc.cpp @@ -117,7 +117,7 @@ wxInputStream& DrawingDocument::LoadObject(wxInputStream& stream) } #endif -DoodleSegment::DoodleSegment(DoodleSegment& seg) +DoodleSegment::DoodleSegment(const DoodleSegment& seg) :wxObject() { wxList::compatibility_iterator node = seg.lines.GetFirst(); diff --git a/samples/docvwmdi/doc.h b/samples/docvwmdi/doc.h index 600564b785..f68b8a18ea 100644 --- a/samples/docvwmdi/doc.h +++ b/samples/docvwmdi/doc.h @@ -32,7 +32,7 @@ class DoodleSegment: public wxObject wxList lines; DoodleSegment(void){}; - DoodleSegment(DoodleSegment& seg); + DoodleSegment(const DoodleSegment& seg); ~DoodleSegment(void); void Draw(wxDC *dc); diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 99be94d26f..1b00cbbeeb 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -417,7 +417,7 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxChar *title) #define POS(r, c) wxGBPosition(r,c) #define SPAN(r, c) wxGBSpan(r,c) -wxChar* gbsDescription =_T("\ +const wxChar gbsDescription[] =_T("\ The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\ in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\ static text is positioned at (0,0) and it spans 7 columns."); diff --git a/samples/ownerdrw/ownerdrw.cpp b/samples/ownerdrw/ownerdrw.cpp index 3824969383..10db9ced6d 100644 --- a/samples/ownerdrw/ownerdrw.cpp +++ b/samples/ownerdrw/ownerdrw.cpp @@ -40,7 +40,7 @@ class OwnerDrawnFrame : public wxFrame { public: // ctor & dtor - OwnerDrawnFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h); + OwnerDrawnFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h); ~OwnerDrawnFrame(){}; // notifications @@ -202,7 +202,7 @@ void OwnerDrawnFrame::InitMenu() } // main frame constructor -OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, wxChar *title, +OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h) : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index dc0e35c68b..0035f4b1ad 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -66,7 +66,7 @@ wxPageSetupData* g_pageSetupData = (wxPageSetupData*) NULL; IMPLEMENT_APP(MyApp) // Writes a header on a page. Margin units are in millimetres. -bool WritePageHeader(wxPrintout *printout, wxDC *dc, wxChar *text, float mmToLogical); +bool WritePageHeader(wxPrintout *printout, wxDC *dc, const wxChar *text, float mmToLogical); // The `main program' equivalent, creating the windows and returning the // main frame @@ -578,7 +578,7 @@ void MyPrintout::DrawPageTwo(wxDC *dc) } // Writes a header on a page. Margin units are in millimetres. -bool WritePageHeader(wxPrintout *printout, wxDC *dc, wxChar *text, float mmToLogical) +bool WritePageHeader(wxPrintout *printout, wxDC *dc, const wxChar *text, float mmToLogical) { /* static wxFont *headerFont = (wxFont *) NULL; diff --git a/samples/printing/printing.h b/samples/printing/printing.h index 0b04dccc6b..f3c2b6d98c 100644 --- a/samples/printing/printing.h +++ b/samples/printing/printing.h @@ -68,7 +68,7 @@ DECLARE_EVENT_TABLE() class MyPrintout: public wxPrintout { public: - MyPrintout(wxChar *title = _T("My printout")):wxPrintout(title) {} + MyPrintout(const wxChar *title = _T("My printout")):wxPrintout(title) {} bool OnPrintPage(int page); bool HasPage(int page); bool OnBeginDocument(int startPage, int endPage); diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index d350aba026..dd05152ec7 100644 --- a/samples/regtest/regtest.cpp +++ b/samples/regtest/regtest.cpp @@ -181,7 +181,7 @@ class RegFrame : public wxFrame { public: // ctor & dtor - RegFrame(wxFrame *parent, wxChar *title, int x, int y, int w, int h); + RegFrame(wxFrame *parent, const wxChar *title, int x, int y, int w, int h); virtual ~RegFrame(); // callbacks @@ -331,7 +331,7 @@ bool RegApp::OnInit() // RegFrame // ---------------------------------------------------------------------------- -RegFrame::RegFrame(wxFrame *parent, wxChar *title, int x, int y, int w, int h) +RegFrame::RegFrame(wxFrame *parent, const wxChar *title, int x, int y, int w, int h) : wxFrame(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { // this reduces flicker effects diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 4115c72fd3..197d0eb548 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -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 diff --git a/src/common/effects.cpp b/src/common/effects.cpp index 71c183c3a2..5a7ac476e0 100644 --- a/src/common/effects.cpp +++ b/src/common/effects.cpp @@ -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) ; diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 3ede1c004a..5549cd7bb3 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -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; diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index 01625ab42b..bddce519a2 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -514,7 +514,7 @@ void wxNativeFontInfo::SetUnderlined(bool underlined_) underlined = underlined_; } -void wxNativeFontInfo::SetFaceName(wxString facename_) +void wxNativeFontInfo::SetFaceName(const wxString& facename_) { faceName = facename_; } diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index 6fe6c097bf..5c983a1def 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -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]; diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 5ed93b5824..c77c315242 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -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 diff --git a/src/common/ipcbase.cpp b/src/common/ipcbase.cpp index 1322e26285..31f3cab4bd 100644 --- a/src/common/ipcbase.cpp +++ b/src/common/ipcbase.cpp @@ -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), diff --git a/src/common/matrix.cpp b/src/common/matrix.cpp index 89c88ec5ba..72a72517e4 100644 --- a/src/common/matrix.cpp +++ b/src/common/matrix.cpp @@ -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)); } diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 73ab3c04fa..d7c77768b7 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -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; diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 83aa3483aa..1029dc6ee2 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -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 diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 43704880e8..9bf472c517 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -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 ) { diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index 197531b3d1..c1b7d71ad8 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -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; diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index ea517a641d..3c900fa4de 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -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 ) { diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 1c69499c23..2fcacdfd84 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -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) { diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp index 80d4442fb6..f6669cbfe9 100644 --- a/src/generic/htmllbox.cpp +++ b/src/generic/htmllbox.cpp @@ -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) { diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 6442952381..cd1e3dd934 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -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() ); diff --git a/src/generic/paletteg.cpp b/src/generic/paletteg.cpp index c0bd2db225..bc60473143 100644 --- a/src/generic/paletteg.cpp +++ b/src/generic/paletteg.cpp @@ -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; } diff --git a/src/generic/regiong.cpp b/src/generic/regiong.cpp index 218f5a324c..92cbe6ad95 100644 --- a/src/generic/regiong.cpp +++ b/src/generic/regiong.cpp @@ -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)); diff --git a/src/generic/textdlgg.cpp b/src/generic/textdlgg.cpp index 41fa24dec5..9b6ea31e90 100644 --- a/src/generic/textdlgg.cpp +++ b/src/generic/textdlgg.cpp @@ -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 ); } diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index 0be1f06724..ca86050527 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -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; diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index 648fa71e17..93aef5fc16 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -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; diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index f6aa7b6cb4..ea62e18185 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -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; diff --git a/src/gtk1/filedlg.cpp b/src/gtk1/filedlg.cpp index 0be1f06724..ca86050527 100644 --- a/src/gtk1/filedlg.cpp +++ b/src/gtk1/filedlg.cpp @@ -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; diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp index 648fa71e17..93aef5fc16 100644 --- a/src/gtk1/region.cpp +++ b/src/gtk1/region.cpp @@ -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; diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index f6aa7b6cb4..ea62e18185 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -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; diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index 169626f16a..3f403439b6 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -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); diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 73f5a73802..b2db6ded54 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -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; diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index ad552c59bd..f11ebb2af6 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -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; diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 31b9f952ca..a1f8c33629 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -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; diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index 0474ae226c..b6a1bc636d 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -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; diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index e924f2ef1a..7fc11a1280 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -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] = diff --git a/src/mac/carbon/fontdlg.cpp b/src/mac/carbon/fontdlg.cpp index b32cc0993e..382bd5d35f 100644 --- a/src/mac/carbon/fontdlg.cpp +++ b/src/mac/carbon/fontdlg.cpp @@ -60,7 +60,7 @@ wxFontDialog::~wxFontDialog() // empty } -void wxFontDialog::SetData(wxFontData& fontdata) +void wxFontDialog::SetData(const wxFontData& fontdata) { m_fontData = fontdata; } diff --git a/src/mac/carbon/mimetmac.cpp b/src/mac/carbon/mimetmac.cpp index 73fef68d65..cc471b746b 100644 --- a/src/mac/carbon/mimetmac.cpp +++ b/src/mac/carbon/mimetmac.cpp @@ -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(" {"); diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index 59de4dc29d..e8d8fa060f 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -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 ; diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp index 7751eee526..8a3f2979e6 100644 --- a/src/mac/carbon/tooltip.cpp +++ b/src/mac/carbon/tooltip.cpp @@ -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() ; diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 8d4256df67..32a04d0415 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -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() ) ) diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp index 4e60d2d0c5..ea980004f2 100644 --- a/src/motif/clipbrd.cpp +++ b/src/motif/clipbrd.cpp @@ -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 ); diff --git a/src/motif/spinbutt.cpp b/src/motif/spinbutt.cpp index 439189b6a7..f01ea0a2a4 100644 --- a/src/motif/spinbutt.cpp +++ b/src/motif/spinbutt.cpp @@ -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 ) diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index 8766c9b401..fee2d0fb03 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -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(), diff --git a/src/motif/window.cpp b/src/motif/window.cpp index db0b0db413..837bedda45 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -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()); } diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 9b6c4cf1ff..d335ae6fce 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -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)); } diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index ac1ebae472..6577b0771c 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -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); diff --git a/src/msw/mediactrl.cpp b/src/msw/mediactrl.cpp index 6098efa556..67049267bc 100644 --- a/src/msw/mediactrl.cpp +++ b/src/msw/mediactrl.cpp @@ -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)); diff --git a/src/os2/font.cpp b/src/os2/font.cpp index f4077c70f8..ff695a16d0 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -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)); diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 022d8e1d4e..cf77187acb 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -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); } diff --git a/src/x11/region.cpp b/src/x11/region.cpp index 6e8dd85a1e..babe1dcca1 100644 --- a/src/x11/region.cpp +++ b/src/x11/region.cpp @@ -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; -- 2.45.2