trichview.com

trichview.support




Re: UNI CODE Error... (richviewactions Demo)


Return to index


Author

Message

Sergey Tkachenko

Posted: 01/13/2005 19:59:19


Readme.rvf was created without Unicode, as well as ActionTest demo was

created to build non-Unicode documents by default.


How to enable Unicode:


1) Set Unicode property to True for all TextStyles in RVStyle1

2) Set RichViewEdit1.RTFReadProperties.UnicodeMode = rvruOnlyUnicode


But existing non-Unicode documents (such as readme.rvf from ActionTest) must

be converted to Unicode by calling ConvertToUnicode after loading them (see

below).


In any case, generation of AV is bad. Can you please sent to

[email protected] a sequence of actions (what to type) to reproduce it?


procedure ConvertRVToUnicode(RVData: TCustomRVData);

var i,r,c, StyleNo: Integer;

    table: TRVTableItemInfo;

begin

  for i := 0 to RVData.ItemCount-1 do begin

    StyleNo := RVData.GetItemStyle(i);

    if StyleNo>=0 then begin

      if not RVData.GetRVStyle.TextStyles[StyleNo].Unicode then begin

        RVData.SetItemText(i, RVU_GetRawUnicode(RVData.GetItemTextW(i)));

        Include(RVData.GetItem(i).ItemOptions, rvioUnicode);

      end;

      end

    else if RVData.GetItemStyle(i)=rvsTable then begin

      table := TRVTableItemInfo(RVData.GetItem(i));

      for r := 0 to table.Rows.Count-1 do

        for c := 0 to table.Rows[r].Count-1 do

          if table.Cells[r,c]<>nil then

            ConvertRVToUnicode(table.Cells[r,c].GetRVData);

    end;

  end;

end;


procedure ConvertToUnicode(rv: TCustomRichView);

var i: Integer;

begin

  ConvertRVToUnicode(rv.RVData);

  for i := 0 to rv.Style.TextStyles.Count-1 do

    rv.Style.TextStyles[i].Unicode := True;

end;


>

>

> 1. Run "richviewactions Demo"

> 2. Load "readme.rvf" file.

> 2. typing any text. (language Korean, China, japaness)

>

> Then...

>

> Access violation Error...

>

> and...

>

> List of out of bounds (100000) Error.

>

> Please bug fix.

>





Powered by ABC Amber Outlook Express Converter