]> git.lyx.org Git - features.git/commitdiff
Fix output of title and clean up a bit.
authorRichard Heck <rgheck@comcast.net>
Mon, 5 Apr 2010 22:02:43 +0000 (22:02 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 5 Apr 2010 22:02:43 +0000 (22:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34061 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index e26381fa81511b430f8210eb92a0bd604f072f8e..4a278219e7b4a415675dc09a189816984a2c0e63 100644 (file)
@@ -1563,20 +1563,24 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
        updateMacroInstances();
 
        if (!only_body) {
-               os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-               os << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" \"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd\">\n";
-               // FIXME Language should be set properly.
-               os << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
-               os << "<head>\n";
-               os << "<meta name=\"GENERATOR\" content=\"" << PACKAGE_STRING << "\" />\n";
-               // FIXME Presumably need to set this right
-               os << "<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\" />\n";
-               os << "<title>" << features.htmlTitle() << "</title>\n";
+               os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+                  << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" \"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd\">\n"
+                  // FIXME Language should be set properly.
+                  << "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
+                  << "<head>\n"
+                  << "<meta name=\"GENERATOR\" content=\"" << PACKAGE_STRING << "\" />\n"
+                  // FIXME Presumably need to set this right
+                  << "<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\" />\n";
+
+               docstring const & doctitle = features.htmlTitle();
+               os << "<title>"
+                  << (doctitle.empty() ? from_ascii("LyX Document") : doctitle)
+                  << "</title>\n";
 
                os << "\n<!-- Text Class Preamble -->\n"
-                       << features.getTClassHTMLPreamble()
-                       << "\n<!-- Premable Snippets -->\n"
-                       << from_utf8(features.getPreambleSnippets());
+                  << features.getTClassHTMLPreamble()
+                  << "\n<!-- Premable Snippets -->\n"
+                  << from_utf8(features.getPreambleSnippets());
 
                os << "\n<!-- Layout-provided Styles -->\n";
                docstring const styleinfo = features.getTClassHTMLStyles();