Fixed insertion of bold/italics/etc overrides on lines that contained non-ascii characters.

Originally committed to SVN as r1228.
This commit is contained in:
Rodrigo Braz Monteiro 2007-06-16 23:05:05 +00:00
parent 34cd74525d
commit 35f2610bb8
2 changed files with 4 additions and 4 deletions

View file

@ -915,8 +915,8 @@ void SubsEditBox::SetOverride (wxString tagname,wxString preValue,int forcePos,b
}
else TextEdit->GetSelection(&selstart,&selend);
int len = TextEdit->GetText().Length();
selstart = MID(0,selstart,len);
selend = MID(0,selend,len);
selstart = TextEdit->GetReverseUnicodePosition(MID(0,selstart,len));
selend = TextEdit->GetReverseUnicodePosition(MID(0,selend,len));
// Current tag name
wxString alttagname = tagname;

View file

@ -69,8 +69,6 @@ private:
wxString GetWordAtPosition(int pos);
void GetBoundsOfWordAtPosition(int pos,int &start,int &end);
int GetUnicodePosition(int pos);
int GetReverseUnicodePosition(int pos);
void SetUnicodeStyling(int start,int length,int style);
void ShowPopupMenu(int activePos=-1);
@ -94,6 +92,8 @@ public:
SubsTextEditCtrl(wxWindow* parent, wxWindowID id, const wxString& value = _T(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr);
~SubsTextEditCtrl();
int GetUnicodePosition(int pos);
int GetReverseUnicodePosition(int pos);
void SetSelectionU(int start,int end);
void SetTextTo(const wxString text);
void UpdateStyle(int start=0,int length=-1);