trichview.com

trichview.support




Re: ApplyTextStyle


Return to index


Author

Message

Sergey Tkachenko

Posted: 11/28/2002 22:58:07


Something like this (this example assumes that text styles for fields are

fixed):


uses CRVData, RVTable;


procedure ReplaceStyles(RVData: TCustomRVData);

var i,r,c: Integer;

    table: TRVTableItemInfo;

begin

  for i := 0 to RVData.Items.Count-1 do

    if RVData.GetItemStyle(i)=FIELD_RED_STYLENO then

      RVData.GetItem(i).StyleNo := FIELD_BLACK_STYLENO

    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

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

    end;

end;


call: ReplaceStyles(RichViewEdit.RVData) just after loading document with

fields.


As for protection: see Protection property for text style

(TFontInfo.Protection).



>





Powered by ABC Amber Outlook Express Converter