TRVEditRVData.ApplyParaStyle feature?

General TRichView support forum. Please post your questions here
Post Reply
Michael Pro
Posts: 42
Joined: Wed Feb 28, 2007 4:14 am

TRVEditRVData.ApplyParaStyle feature?

Post by Michael Pro »

Greetings!
Sergey, I've found some unintelligible moments in this routine.

When we select table partially - and make parastyle conversion to partial selected table (not for all cells) - it works fine in part of

Code: Select all

  if FPartialSelectedItem<>nil then begin
    FPartialSelectedItem.ApplyStyleConversionToSubRVDatas(ParaStyleNo, True, ConvType);
    exit;
  end;
But when whole table is selected - it changes parastyle for table and for all of cells

Code: Select all

  for i := SelStartNo to SelEndNo do
      GetItem(i).ApplyStyleConversionToSubRVDatas(ParaStyleNo, False, ConvType);
It looks strange due to its behaviour - it's not MS Word style, and it's strange - because table selected from outside and its cells haven't be affected by outside parastyle conversion.

I think, it's necessary to exclude this part of code or change it in following way

Code: Select all

  for i := SelStartNo to SelEndNo do
  begin
    if GetItem(i).StyleNo <> -60 then
      GetItem(i).ApplyStyleConversionToSubRVDatas(ParaStyleNo, False, ConvType);
  end;
PS This part of code works fine, when making selection inside the table

Best regards,
Michael
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

In MS Word, even if you select table as a part of larger selection, applying paragraph attributes to the selection applies them to all table cells.
Michael Pro
Posts: 42
Joined: Wed Feb 28, 2007 4:14 am

Post by Michael Pro »

Sergey Tkachenko wrote:In MS Word, even if you select table as a part of larger selection, applying paragraph attributes to the selection applies them to all table cells.
Sorry, my fault.
But in one case it won't work in MS Style - when you select only one table "outside" - in MS-style it won't affect para styles of cells
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Quite inconsistent, IMHO.
Is there any logic that if I select only table, paragraph is applied to table, but if I select table+something, paragraph is applied to table cells?
Michael Pro
Posts: 42
Joined: Wed Feb 28, 2007 4:14 am

Post by Michael Pro »

Sergey Tkachenko wrote:Quite inconsistent, IMHO.
Is there any logic that if I select only table, paragraph is applied to table, but if I select table+something, paragraph is applied to table cells?
Yeah, I'm think so too :)
MS-logic in this case looks strange :)
Despite of this, I've changed sources in first style - increasing/decreasing idents for table outside selection doesn't look nice.
Sergey, in your components, there is a nice idea - "inside" and "outside" selection for tables, MS implemented cells and tables in different way - they didn't implement inside selection.
IMHO, for your tables implementation logically when we selecting tables from inside, it should modify contents of cells, but when we selecting table from outside - table is single entity - and it is part of paragraph - in this case we don't have to look inside table cells in paragraph case (but not for styles - font sizes, font names).
IMHO, para styles and text styles must have different parse logic.
Post Reply