From 5f877e218a2e35e2e4a8a97b0fa60626c5b73abf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sat, 15 Aug 2009 23:43:59 +0000 Subject: [PATCH] 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 --- src/BufferParams.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 90c2a187d6..66dadbee58 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -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 -- 2.39.5