Page 1 of 1

"get.cell.fontsize"

Posted: Thu May 24, 2007 6:04 pm
by j&b
Hello ,

I have a rveTable with "cell.font.size" of 9.

Now I write something in the 2. col:


....

for r := 0 to rveTable.Rows.Count-1 do begin
try
if (rveTable.Cells[r,2]<>nil) and (rveTable.Cells[r,i].GetRVData.GetItemStyle(0)>=0) then begin
rveTable.Cells[r,2].clear;
rveTable.Cells[r,2].AddNL('Paul',0,1); // I think AddNl is wrong
end;
except
break;
end;
end;

finally
if rveTable<>nil then begin
memo.EndItemModify(ItemNo, Data);
memo.Change;
end;
...

end;


After cells are modified the fontsize of the new written text is 12 (and not 9 as before).

I want that program "get.cell.font.size" and write text back (memo.change) in the same font.size.


Who can help me ?

(Sergey ?)

Posted: Fri May 25, 2007 6:56 am
by Sergey Tkachenko

Code: Select all

var StyleNo, ParaNo: Integer;

if (rveTable.Cells[r,2]<>nil) and 
  (rveTable.Cells[r,2].GetRVData.GetItemStyle(0)>=0) then begin 
  StyleNo := rveTable.Cells[r,2].GetRVData.GetItemStyle(0);
  ParaNo := rveTable.Cells[r,2].GetRVData.GetItemPara(0);
  rveTable.Cells[r,2].Clear; 
  rveTable.Cells[r,2].AddNL('Paul',StyleNo,ParaNo);
end;
// I changed [r,i] to [r,2]

Posted: Fri May 25, 2007 11:04 am
by j&b
THANKS, Sergey