tex2lyx/preamble.cpp: fix the import of paragraph settings, fixes http://bugzilla.lyx.org/show_bug.cgi?id=4773

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24404 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2008-04-20 23:22:36 +00:00
parent b6eed01602
commit d4355c552b

View File

@ -332,6 +332,8 @@ void handle_package(string const & name, string const & opts)
else if (name == "graphicx")
; // ignore this
else if (name == "setspace")
; // ignore this
else if (is_known(name, known_languages)) {
if (is_known(name, known_french_languages))
h_language = "french";
@ -640,15 +642,32 @@ void parse_preamble(Parser & p, ostream & os,
else if (t.cs() == "setlength") {
string const name = p.verbatim_item();
string const content = p.verbatim_item();
// Is this correct?
if (name == "parskip")
h_paragraph_separation = "skip";
else if (name == "parindent")
h_paragraph_separation = "skip";
else
// the paragraphs are only not indented when \parindent is set to zero
if (name == "\\parindent" && content != "") {
if (content[0] == '0')
h_paragraph_separation = "skip";
} else if (name == "\\parskip") {
if (content == "\\smallskipamount")
h_defskip = "smallskip";
else if (content == "\\medskipamount")
h_defskip = "medskip";
else if (content == "\\bigskipamount")
h_defskip = "bigskip";
else
h_defskip = content;
} else
h_preamble << "\\setlength{" << name << "}{" << content << "}";
}
else if (t.cs() =="onehalfspacing")
h_spacing = "onehalf";
else if (t.cs() =="doublespacing")
h_spacing = "double";
else if (t.cs() =="setstretch")
h_spacing = "other " + p.verbatim_item();
else if (t.cs() == "begin") {
string const name = p.getArg('{', '}');
if (name == "document")