]> git.lyx.org Git - features.git/commitdiff
BufferParams.cpp: make the suppress date feature safer because we cannot be sure...
authorUwe Stöhr <uwestoehr@web.de>
Sat, 15 Aug 2009 23:43:59 +0000 (23:43 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Sat, 15 Aug 2009 23:43:59 +0000 (23:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31071 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferParams.cpp

index 90c2a187d666a6fa2475cca151d113f2ea16f35f..66dadbee583f65965169df8189b34370ac01bc49 100644 (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