mirror of https://github.com/odrling/Aegisub
Use wxSTC::GetTextRaw rather than converting utf-8 -> wxString -> utf-8
This commit is contained in:
parent
99b5c26592
commit
d9b56badbf
|
@ -52,7 +52,7 @@ int ScintillaTextCtrl::GetUnicodePosition(int pos) {
|
||||||
|
|
||||||
/// @brief Reverse unicode-compatible position
|
/// @brief Reverse unicode-compatible position
|
||||||
int ScintillaTextCtrl::GetReverseUnicodePosition(int pos) {
|
int ScintillaTextCtrl::GetReverseUnicodePosition(int pos) {
|
||||||
wxCharBuffer buffer = GetText().utf8_str();
|
wxCharBuffer buffer = GetTextRaw();
|
||||||
|
|
||||||
// Limit position to it
|
// Limit position to it
|
||||||
if (pos > (signed)buffer.length()) pos = buffer.length();
|
if (pos > (signed)buffer.length()) pos = buffer.length();
|
||||||
|
|
|
@ -283,7 +283,7 @@ void SubsTextEditCtrl::SetStyles() {
|
||||||
void SubsTextEditCtrl::UpdateStyle() {
|
void SubsTextEditCtrl::UpdateStyle() {
|
||||||
StartStyling(0,255);
|
StartStyling(0,255);
|
||||||
|
|
||||||
std::string text = STD_STR(GetText());
|
std::string text = GetTextRaw().data();
|
||||||
|
|
||||||
if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) {
|
if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) {
|
||||||
SetStyling(text.size(), 0);
|
SetStyling(text.size(), 0);
|
||||||
|
|
Loading…
Reference in New Issue