BufferParams.cpp: make the suppress date feature safer because we cannot be sure that every document class has a \date command

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31071 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2009-08-15 23:43:59 +00:00
parent f7aa1c1c5d
commit 5f877e218a

View File

@ -1463,10 +1463,6 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
// Line spacing
lyxpreamble += from_utf8(spacing().writePreamble(tclass.provides("SetSpace")));
// date
if (suppress_date)
lyxpreamble += "\\date{}\n";
// PDF support.
// * Hyperref manual: "Make sure it comes last of your loaded
// packages, to give it a fighting chance of not being over-written,
@ -1500,6 +1496,12 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
"Textclass specific LaTeX commands.\n"
+ tmppreamble + '\n';
// suppress date if selected
// use \@ifundefined because we cannot be sure that every document class
// has a \date command
if (suppress_date)
atlyxpreamble += "\\@ifundefined{date}{}{\\date{}}\n";
/* the user-defined preamble */
if (!containsOnly(preamble, " \n\t"))
// FIXME UNICODE