Undo action bug?
Posted: Wed Mar 10, 2010 1:25 pm
Hello Sergey,
I want you to know that I found some kind of a bug.
There are several components on my form: ActionList (only rvActionUndo included), MainMenu (with Undo item linked to rvActionUndo), RichViewEdit and RVStyle. The only text in RVE is one text item with tag "Tag1" and text " several_useless_words ".
OnChange event handler of RVE has the next code inside:
As you can see I want to change tags of items depending on thier content. Well it works fine! But after one change of tag there appears a bug with UndoAction:
P.S. TagsArePChars is ON; UndoLimit equals -1
P.P.S. Sorry for C++
I want you to know that I found some kind of a bug.
There are several components on my form: ActionList (only rvActionUndo included), MainMenu (with Undo item linked to rvActionUndo), RichViewEdit and RVStyle. The only text in RVE is one text item with tag "Tag1" and text " several_useless_words ".
OnChange event handler of RVE has the next code inside:
Code: Select all
UnicodeString tag = (wchar_t *)rve1->GetCurrentTag();
if (tag.Pos(L"Tag")) {
if (rve1->GetCurrentItemText().Trim().IsEmpty()) {
if (!tag.Pos(L"NEW"))
rve1->SetItemTagEd(rve1->CurItemNo,(int)StrNew((L"NEW" + tag).c_str()));
}
else {
if (tag.Pos(L"NEW")) {
rve1->SetItemTagEd(rve1->CurItemNo,(int)StrNew((tag.SubString(4,tag.Length())).c_str()));
}
}
}
- I delete all letters except spaces in text item:
text changes: " several_useless_words "->" "
tag changes: "Tag1"->"NewTag1" - I type some letters:
text changes: " "->" Gsfasfasf "
tag changes: "NewTag1"->"Tag1" - Now I'm pressing Ctrl+Z shorcut key (or Undo menu item) until clearing of Undo buffer. And that's happened (?) when there is only one letter left:
" Gsfasfasf "->" G "
while menu item Undo is still available! I still can press menu item but it does nothing.
P.S. TagsArePChars is ON; UndoLimit equals -1
P.P.S. Sorry for C++