Use wxSTC::GetTextRaw rather than converting utf-8 -> wxString -> utf-8

This commit is contained in:
Thomas Goyne 2012-10-30 05:50:41 -07:00
parent 99b5c26592
commit d9b56badbf
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ int ScintillaTextCtrl::GetUnicodePosition(int pos) {
/// @brief Reverse unicode-compatible position
int ScintillaTextCtrl::GetReverseUnicodePosition(int pos) {
wxCharBuffer buffer = GetText().utf8_str();
wxCharBuffer buffer = GetTextRaw();
// Limit position to it
if (pos > (signed)buffer.length()) pos = buffer.length();

View File

@ -283,7 +283,7 @@ void SubsTextEditCtrl::SetStyles() {
void SubsTextEditCtrl::UpdateStyle() {
StartStyling(0,255);
std::string text = STD_STR(GetText());
std::string text = GetTextRaw().data();
if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) {
SetStyling(text.size(), 0);