Page 1 of 1

Load styles from ini witout deleting existing styles?

Posted: Wed Jul 25, 2007 4:42 pm
by Usch Wildt
Hi,

I developed an application where users can generate text modules and build together documents from several of these text modules.
Now I would like add a possibility for the users to configure some standard styles, e.g. one for "normal text", one for "heading", one "standard list" (they shall not be able to generate new standard styles).
When the user changes one of these standard styles, the existing text modules shall change: the text parts that use the standard style shall change to the new appearance.
I tried to to assign the changed styles with LoadIni, which is fine, if the text module uses only the standard formats. But if the user formatted some text parts individually, these individual styles vanish when I call LoadIni.
Is there a possibility to merge the styles: substitute existing styles by the ones from the ini file, but keep the others?

Thanks for help,

Usch

Posted: Thu Jul 26, 2007 6:12 pm
by Sergey Tkachenko
Load INI in another RVStyle, then copy styles:

Code: Select all

for i := 0 to RVStyle2.TextStyles.Count-1 do
  RVStyle1.TextStyles[i].Assign(RVStyle2.TextStyles[i]);