Пример #1
0
void stylesheet_save_style(const ustring & stylesheet, const Style & style_in)
{
  extern Styles * styles;
  Stylesheet * sheet = styles->stylesheet (stylesheet);
  Style * style_out = sheet->style (style_in.marker);
  if (style_out) { (*style_out) = style_in; } // deep copy
  sheet->save();
}
Пример #2
0
void stylesheet_load_style(const ustring & stylesheet, Style& style_to_load)
/*
Reads one Style.
stylesheet: which stylesheet to read from. If no stylesheet is given, it reads from the template.
style: the Style object to read. The marker is given in it.
*/
{
  extern Styles * styles;
  Stylesheet * sheet = styles->stylesheet (stylesheet);
  Style * style = sheet->style (style_to_load.marker);
  if (style) { style_to_load = (*style); } // deep copy
}
Пример #3
0
void stylesheet_save_style(const ustring & stylesheet, const ustring & marker, const ustring & name, const ustring & info, StyleType type, int subtype, double fontsize, const ustring & italic, const ustring & bold, const ustring & underline, const ustring & smallcaps, bool superscript, const ustring & justification, double spacebefore, double spaceafter, double leftmargin, double rightmargin, double firstlineindent, bool spancolumns, unsigned int color, bool print, bool userbool1, bool userbool2, bool userbool3, int userint1, int userint2, int userint3, ustring userstring1, ustring userstring2, ustring userstring3)
// Saves style information.
{
  extern Styles * styles;
  Stylesheet * sheet = styles->stylesheet (stylesheet);
  Style * style = sheet->style(marker);
  style->name = name;
  style->info = info;
  style->type = type;
  style->subtype = subtype;
  style->fontsize = fontsize;
  style->italic = italic;
  style->bold = bold;
  style->underline = underline;
  style->smallcaps = smallcaps;
  style->superscript = superscript;
  style->justification = justification;
  style->spacebefore = spacebefore;
  style->spaceafter = spaceafter;
  style->leftmargin = leftmargin;
  style->rightmargin = rightmargin;
  style->firstlineindent = firstlineindent;
  style->spancolumns = spancolumns;
  style->color = color;
  style->print = print;
  style->userbool1 = userbool1;
  style->userbool2 = userbool2;
  style->userbool3 = userbool3;
  style->userint1 = userint1;
  style->userint2 = userint2;
  style->userint3 = userint3;
  style->userstring1 = userstring1;
  style->userstring2 = userstring2;
  style->userstring3 = userstring3;
  sheet->save();  
}