]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetQuotes.cpp
InsetTabular.cpp: fix #6585 also for wrapped floats - thanks Vincent
[lyx.git] / src / insets / InsetQuotes.cpp
index b287c28dfd98a97904e0467f90db397ebec32e3f..95a71abc45ba499e26950e6cffb6c6d1687d432e 100644 (file)
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Dimension.h"
+#include "Font.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
+#include "output_xhtml.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
@@ -40,7 +42,7 @@ namespace {
 
 /* codes used to read/write quotes to LyX files
  * e    ``english''
- * s    ''spanish''
+ * s    ''swedish''
  * g    ,,german``
  * p    ,,polish''
  * f    <<french>>
@@ -184,12 +186,14 @@ void InsetQuotes::parseString(string const & s)
 
 docstring InsetQuotes::displayString() const
 {
-       Language const * loclang = buffer().params().language;
+       Language const * loclang = 
+               isBufferValid() ? buffer().params().language : 0;
        int const index = quote_index[side_][language_];
        docstring retdisp = docstring(1, display_quote_char[times_][index]);
 
        // in french, spaces are added inside double quotes
-       if (times_ == DoubleQuotes && prefixIs(loclang->code(), "fr")) {
+       // FIXME: this should be done by a separate quote type.
+       if (times_ == DoubleQuotes && loclang && prefixIs(loclang->code(), "fr")) {
                if (side_ == LeftQuote)
                        retdisp += ' ';
                else
@@ -314,9 +318,9 @@ int InsetQuotes::docbook(odocstream & os, OutputParams const &) const
 }
 
 
-docstring InsetQuotes::xhtml(odocstream & os, OutputParams const & op) const
+docstring InsetQuotes::xhtml(XHTMLStream & xs, OutputParams const & op) const
 {
-       docbook(os, op);
+       docbook(xs.os(), op);
        return docstring();
 }