X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/830f8f11bca5c0892ae767ba14790c8b5b59011f..57bf8a6f1efc2d58099f058bfd17579b147baac2:/include/wx/textbuf.h?ds=sidebyside diff --git a/include/wx/textbuf.h b/include/wx/textbuf.h index f768a56324..0db6a65279 100644 --- a/include/wx/textbuf.h +++ b/include/wx/textbuf.h @@ -99,8 +99,10 @@ public: size_t GetLineCount() const { return m_aLines.size(); } // the returned line may be modified (but don't add CR/LF at the end!) - wxString& GetLine(size_t n) const { return (wxString&)m_aLines[n]; } - wxString& operator[](size_t n) const { return (wxString&)m_aLines[n]; } + wxString& GetLine(size_t n) { return m_aLines[n]; } + const wxString& GetLine(size_t n) const { return m_aLines[n]; } + wxString& operator[](size_t n) { return m_aLines[n]; } + const wxString& operator[](size_t n) const { return m_aLines[n]; } // the current line has meaning only when you're using // GetFirstLine()/GetNextLine() functions, it doesn't get updated when @@ -132,7 +134,7 @@ public: wxTextFileType GuessType() const; // get the name of the buffer - const wxChar *GetName() const { return m_strBufferName.c_str(); } + const wxString& GetName() const { return m_strBufferName; } // add/remove lines // ---------------- @@ -172,7 +174,7 @@ protected: // ----- // default ctor, use Open(string) - wxTextBuffer() { m_isOpened = false; } + wxTextBuffer() { m_nCurLine = 0; m_isOpened = false; } // ctor from filename wxTextBuffer(const wxString& strBufferName);