Page 1 of 1

TRVEditRVData.ApplyParaStyle feature?

Posted: Mon Apr 28, 2008 5:49 am
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

Posted: Tue Apr 29, 2008 9:43 am
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.

Posted: Tue May 06, 2008 3:04 am
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

Posted: Tue May 06, 2008 3:08 pm
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?

Posted: Wed May 07, 2008 3:31 am
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.