]> git.lyx.org Git - features.git/commitdiff
Fix bug #9383. Writing directly to the output stream bypassed the
authorRichard Heck <rgheck@lyx.org>
Mon, 9 Feb 2015 22:24:13 +0000 (17:24 -0500)
committerRichard Heck <rgheck@lyx.org>
Mon, 9 Feb 2015 22:27:37 +0000 (17:27 -0500)
machinery that clears the tag stack.

(cherry picked from commit 5a78a112b6ac14a9cdb0fd5dc0c06aa89578eff5)

src/insets/InsetQuotes.cpp
src/insets/InsetQuotes.h

index 70911fd65940f7dcfcbbe40968fa10ca5a3a2003..3ff490eee291f957e257d41352d208ac116471c5 100644 (file)
@@ -307,26 +307,30 @@ int InsetQuotes::plaintext(odocstringstream & os,
 }
 
 
-int InsetQuotes::docbook(odocstream & os, OutputParams const &) const
-{
+docstring InsetQuotes::getQuoteEntity() const {
        if (times_ == DoubleQuotes) {
                if (side_ == LeftQuote)
-                       os << "&ldquo;";
-               else
-                       os << "&rdquo;";
-       } else {
-               if (side_ == LeftQuote)
-                       os << "&lsquo;";
+                       return from_ascii("&ldquo;");
                else
-                       os << "&rsquo;";
+                       return from_ascii("&rdquo;");
        }
+       if (side_ == LeftQuote)
+               return from_ascii("&lsquo;");
+       else
+               return from_ascii("&rsquo;");
+}
+
+
+int InsetQuotes::docbook(odocstream & os, OutputParams const &) const
+{
+       os << getQuoteEntity();
        return 0;
 }
 
 
 docstring InsetQuotes::xhtml(XHTMLStream & xs, OutputParams const & op) const
 {
-       docbook(xs.os(), op);
+       xs << XHTMLStream::ESCAPE_NONE << getQuoteEntity();
        return docstring();
 }
 
index 743208ff394744380934fff9812b8c4b1b043092..068137eedb969b400318812bce2acec513bc9b03 100644 (file)
@@ -109,6 +109,8 @@ private:
        void parseString(std::string const &);
        ///
        docstring displayString() const;
+       ///
+       docstring getQuoteEntity() const;
 
        ///
        QuoteLanguage language_;