X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4d25c01ae813d8fe13d7b2a267864ccaee1840d..0118b60be6ccd5a198f15cf54d307c0c8645f94c:/src/common/textcmn.cpp diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index b31c830a00..7d3c268389 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -13,10 +13,6 @@ // declarations // ============================================================================ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "textctrlbase.h" -#endif - // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -220,7 +216,7 @@ bool wxTextCtrlBase::LoadFile(const wxString& filename) bool wxTextCtrlBase::SaveFile(const wxString& filename) { - wxString filenameToUse = filename.IsEmpty() ? m_filename : filename; + wxString filenameToUse = filename.empty() ? m_filename : filename; if ( filenameToUse.empty() ) { // what kind of message to give? is it an error or a program bug? @@ -299,7 +295,7 @@ wxTextCtrl& wxTextCtrlBase::operator<<(const wxChar c) // streambuf methods implementation // ---------------------------------------------------------------------------- -#ifndef NO_TEXT_WINDOW_STREAM +#if wxHAS_TEXT_WINDOW_STREAM int wxTextCtrlBase::overflow(int c) { @@ -309,7 +305,7 @@ int wxTextCtrlBase::overflow(int c) return 0; } -#endif // NO_TEXT_WINDOW_STREAM +#endif // wxHAS_TEXT_WINDOW_STREAM // ---------------------------------------------------------------------------- // clipboard stuff @@ -362,7 +358,7 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) case WXK_NUMPAD7: case WXK_NUMPAD8: case WXK_NUMPAD9: - ch = _T('0') + keycode - WXK_NUMPAD0; + ch = (wxChar)(_T('0') + keycode - WXK_NUMPAD0); break; case WXK_MULTIPLY: @@ -394,9 +390,8 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) case WXK_NUMPAD_DELETE: // delete the character at cursor { - const long pos = GetInsertionPoint(), - last = GetLastPosition(); - if ( pos < last ) + const long pos = GetInsertionPoint(); + if ( pos < GetLastPosition() ) Remove(pos, pos + 1); } break; @@ -524,4 +519,3 @@ wxTextCtrlBase::HitTest(const wxPoint& WXUNUSED(pt), DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED) #endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL -