trichview.com

trichview.support




Re: Are there some pictures ?


Return to index


Author

Message

rafaellop

Posted: 09/21/2002 17:14:34


Hello,


The function doesn't work. The function header should

be:


function HasPictures(RVData: TCustomRVData): Boolean;


instead of yours:


function HasPictures(RVData: TCustomFormattedRVData): Boolean;


because of the line:


Result := HasPictures(table.Cells[r,c].GetRVData);


In the uses list there should be one more unit added: RVTable.


Now it works :)


The correct function looks like:


uses CRVData, RVTable;


function HasPictures(RVData: TCustomRVData): Boolean;

var i,r,c: Integer;

     table: TRVTableItemInfo;

begin

  Result := False;

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

    case RVData.GetItemStyle(i) of

    rvsPicture, rvsHotpicture, rvsBullet, rvsHotspot:

      begin

        Result := True;

        exit;

      end;

    rvsTable:

      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 begin

              Result := HasPictures(table.Cells[r,c].GetRVData);

              if Result then exit;

            end;

      end;

    end;

end;



Regards,

Rafal







Powered by ABC Amber Outlook Express Converter