X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a5398eb9c4119c92ad14395bd12aab99e0563e21..2a45803fc3877afd0ae3ce356dfe216505165882:/include/wx/textbuf.h diff --git a/include/wx/textbuf.h b/include/wx/textbuf.h index fae3b12095..a2511b427d 100644 --- a/include/wx/textbuf.h +++ b/include/wx/textbuf.h @@ -20,7 +20,7 @@ // constants // ---------------------------------------------------------------------------- -// the line termination type (kept wxTextFileType name for compability) +// the line termination type (kept wxTextFileType name for compatibility) enum wxTextFileType { wxTextFileType_None, // incomplete (the last line of the file only) @@ -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 @@ -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);