/////////////////////
-// Constructor for layout
-Layout::Layout ()
+Layout::Layout()
{
margintype = MARGIN_STATIC;
latextype = LATEX_PARAGRAPH;
labelbottomsep = 0.0;
parsep = 0;
align = LYX_ALIGN_BLOCK;
- alignpossible = LYX_ALIGN_BLOCK;
+ alignpossible = LYX_ALIGN_NONE | LYX_ALIGN_LAYOUT;
labeltype = LABEL_NO_LABEL;
endlabeltype = END_LABEL_NO_LABEL;
// Should or should not. That is the question.
}
-// Reads a layout definition from file
bool Layout::read(Lexer & lexrc, TextClass const & tclass)
{
// This table is sorted alphabetically [asierra 30March96]
case LT_OBSOLETEDBY: // replace with a known style
if (lexrc.next()) {
- docstring const style = lexrc.getDocString();
+ docstring const style =
+ subst(lexrc.getDocString(), '_', ' ');
if (tclass.hasLayout(style)) {
docstring const tmpname = name_;
case LT_DEPENDSON:
if (lexrc.next())
- depends_on_ = lexrc.getDocString();
+ depends_on_ = subst(lexrc.getDocString(), '_', ' ');
break;
case LT_MARGIN: // margin style definition.
case LT_LEFTMARGIN: // left margin type
if (lexrc.next())
- leftmargin = lexrc.getString();
+ leftmargin = lexrc.getDocString();
break;
case LT_RIGHTMARGIN: // right margin type
if (lexrc.next())
- rightmargin = lexrc.getString();
+ rightmargin = lexrc.getDocString();
break;
case LT_LABELINDENT: // label indenting flag
if (lexrc.next())
- labelindent = lexrc.getString();
+ labelindent = lexrc.getDocString();
break;
case LT_PARINDENT: // paragraph indent. flag
if (lexrc.next())
- parindent = lexrc.getString();
+ parindent = lexrc.getDocString();
break;
case LT_PARSKIP: // paragraph skip size
case LT_LABELSEP: // label separator
if (lexrc.next()) {
- labelsep = subst(lexrc.getString(), 'x', ' ');
+ labelsep = from_utf8(subst(lexrc.getString(), 'x', ' '));
}
break;
};
lexrc.pushTable(alignTags, AT_LAYOUT);
- alignpossible = LYX_ALIGN_NONE;
+ alignpossible = LYX_ALIGN_NONE | LYX_ALIGN_LAYOUT;
int lineno = lexrc.getLineNo();
do {
int le = lexrc.lex();
}
-namespace {
-
-keyword_item endlabelTypeTags[] = {
+static keyword_item endlabelTypeTags[] =
+{
{ "box", END_LABEL_BOX },
{ "filled_box", END_LABEL_FILLED_BOX },
{ "no_label", END_LABEL_NO_LABEL },
{ "static", END_LABEL_STATIC }
};
-} // namespace anon
-
void Layout::readEndLabelType(Lexer & lexrc)
{
case END_LABEL_BOX:
case END_LABEL_FILLED_BOX:
case END_LABEL_NO_LABEL:
- endlabeltype = static_cast<LYX_END_LABEL_TYPES>(le);
+ endlabeltype = static_cast<EndLabelType>(le);
break;
default:
lyxerr << "Unhandled value " << le
case MARGIN_DYNAMIC:
case MARGIN_FIRST_DYNAMIC:
case MARGIN_RIGHT_ADDRESS_BOX:
- margintype = static_cast<LYX_MARGIN_TYPE>(le);
+ margintype = static_cast<MarginType>(le);
break;
default:
lyxerr << "Unhandled value " << le
case LATEX_ITEM_ENVIRONMENT:
case LATEX_BIB_ENVIRONMENT:
case LATEX_LIST_ENVIRONMENT:
- latextype = static_cast<LYX_LATEX_TYPES>(le);
+ latextype = static_cast<LatexType>(le);
break;
default:
lyxerr << "Unhandled value " << le
}
-void Layout::setName(docstring const & n)
+void Layout::setName(docstring const & name)
{
- name_ = n;
+ name_ = name;
}
return lay;
}
-
-
} // namespace lyx