* src/tex2lyx/tex2lyx.C
(tex2lyx): output an empty paragraph if the document is empty
* src/tex2lyx/context.C
(Context::check_layout): set empty to false
* src/tex2lyx/context.[Ch]
(empty): new flag, tells whether all contexts are empty
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14469
a592a061-630c-0410-9148-
cb99ea01b6c8
Font Context::normalfont;
+bool Context::empty = true;
Context::Context(bool need_layout_,
extra_stuff.erase();
}
os << "\n";
+ empty = false;
}
}
* would not work.
*/
bool new_layout_allowed;
+ /// Did we output anything yet in any context?
+ static bool empty;
/// The textclass of the document. Could actually be a global variable
LyXTextClass const & textclass;
active_environments.push_back("document");
Context context(true, textclass);
parse_text(p, ss, FLAG_END, true, context);
+ if (Context::empty)
+ // Empty document body. LyX needs at least one paragraph.
+ context.check_layout(ss);
context.check_end_layout(ss);
ss << "\n\\end_body\n\\end_document\n";
active_environments.pop_back();