Page 1 of 1

Item's text fragmentation

Posted: Tue Dec 22, 2009 1:34 pm
by kolovan
Hi,

I have problem with tags and text items.

I have a RichViewEdit control on my form. There is a text item with tag (TagsArePChars is ON). I'm adding "SomeText" to the item using the code:

Code: Select all

RVE->SetItemTextEd(RVE->CurItemNo, L"\{SomeText\}");
After that I'm manually typing "_TwoWords_" inside that item:

{Some_TwoWords_Text}

Next code approves that anywhere inside the braces it is still the same TextItem with the same Tag:

Code: Select all

(wchar_t*)RVE->GetItemTag(RVE->CurItemNo);
And when I'm trying to get text of the current item

Code: Select all

RVE->GetItemText(RVE->CurItemNo);
I'm getting different results based on cursor position inside braces:

1. "{Some"
2. "_TwoWords_"
3. "Text}"

Why one item with one tag has three different text fields?

P.S. I'm using C++ Builder 2010

Posted: Sat Dec 26, 2009 6:01 pm
by Sergey Tkachenko
May be you have some protection for this text style?
If not, please send me a sample project.

PS: Use StrNew for tags:
RVE->SetItemTextEd(RVE->CurItemNo, (int)StrNew(L"\{SomeText\}"));

Update 2011-Oct-22: starting from TRichView 13.4, StrNew() is not needed for tags.

Posted: Mon Dec 28, 2009 7:41 am
by kolovan
Sergey Tkachenko wrote:May be you have some protection for this text style?
You were right! That was because of rvprConcateProtect in text item's style.

Thank you!