#include "LyXRC.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
-#include "output_xhtml.h"
#include "Paragraph.h"
#include "ParIterator.h"
#include "texstream.h"
+#include "xml.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
case 0x2019: {// '
if (op == "int")
// This macro is redefined in rtl mode
- res = rtl ? "\\textquoteright" : "\\textquoteleft";
+ res = rtl ? "\\textquoteleft" : "\\textquoteright";
else
res = "'";
break;
case 0x2018: {// `
if (op == "int")
// This macro is redefined in rtl mode
- res = rtl ? "\\textquoteleft" : "\\textquoteright";
+ res = rtl ? "\\textquoteright" : "\\textquoteleft";
else
res = "`";
break;
case 0x201d: {// ''
if (op == "int")
// This macro is redefined in rtl mode
- res = rtl ? "\\textquotedblright" : "\\textquotedblleft";
+ res = rtl ? "\\textquotedblleft" : "\\textquotedblright";
else
res = "''";
break;
case 0x201c: {// ``
if (op == "int")
// This macro is redefined in rtl mode
- res = rtl ? "\\textquotedblleft" : "\\textquotedblright";
+ res = rtl ? "\\textquotedblright" : "\\textquotedblleft";
else
res = "``";
break;
}
// The following are fakes
// This is just to get something symbolic
- // in encodings where this chars would not be used ayway
+ // in encodings where this chars would not be used anyway
case 0x300c: // LEFT CORNER BRACKET
res = "\\ensuremath{\\lceil}";
break;
}
+docstring InsetQuotesParams::getXMLQuote(char_type c) const
+{
+ string res;
+
+ switch (c){
+ case 0x201a: // ,
+ res = "‚";
+ break;
+ case 0x2019: // '
+ res = "’";
+ break;
+ case 0x2018: // `
+ res = "‘";
+ break;
+ case 0x2039: // <
+ res = "‹";
+ break;
+ case 0x203a: // >
+ res = "›";
+ break;
+ case 0x0027: // ' (plain)
+ res = "'";
+ break;
+ case 0x201e: // ,,
+ res = "„";
+ break;
+ case 0x201d: // ''
+ res = "”";
+ break;
+ case 0x201c: // ``
+ res = "“";
+ break;
+ case 0x00ab: // <<
+ res = "«";
+ break;
+ case 0x00bb: // >>
+ res = "»";
+ break;
+ case 0x0022: // "
+ res = """;
+ break;
+ case 0x300c: // LEFT CORNER BRACKET
+ res = "「";
+ break;
+ case 0x300d: // RIGHT CORNER BRACKET
+ res = "」";
+ break;
+ case 0x300e: // LEFT WHITE CORNER BRACKET
+ res = "『";
+ break;
+ case 0x300f: // RIGHT WHITE CORNER BRACKET
+ res = "』";
+ break;
+ case 0x300a: // LEFT DOUBLE ANGLE BRACKET
+ res = "《";
+ break;
+ case 0x300b: // RIGHT DOUBLE ANGLE BRACKET
+ res = "》";
+ break;
+ case 0x3008: // LEFT ANGLE BRACKET
+ res = "〈";
+ break;
+ case 0x3009: // RIGHT ANGLE BRACKET
+ res = "〉";
+ break;
+ default:
+ break;
+ }
+
+ return from_ascii(res);
+}
+
+
map<string, docstring> InsetQuotesParams::getTypes() const
{
map<string, docstring> res;
qstr = from_ascii("\\og");
else
qstr = from_ascii("\\fg");
+ } else if (runparams.use_hyperref && runparams.moving_arg) {
+ // Use internal commands in headings with hyperref
+ // (ligatures not featured in PDF strings)
+ qstr = quoteparams.getLaTeXQuote(quotechar, "int", rtl_);
} else if (fontenc_ == "T1"
&& !runparams.local_font->language()->internalFontEncoding()) {
// Quotation marks for T1 font encoding
}
-docstring InsetQuotes::getQuoteEntity() const {
+docstring InsetQuotes::getQuoteEntity(bool isHTML) const {
InsetQuotesParams::QuoteStyle style =
(style_ == InsetQuotesParams::DynamicQuotes) ? global_style_ : style_;
- docstring res = quoteparams.getHTMLQuote(quoteparams.getQuoteChar(style, level_, side_));
+ docstring res = isHTML ? quoteparams.getHTMLQuote(quoteparams.getQuoteChar(style, level_, side_)) :
+ quoteparams.getXMLQuote(quoteparams.getQuoteChar(style, level_, side_));
// in French, thin spaces are added inside double guillemets
if (prefixIs(context_lang_, "fr")
&& level_ == InsetQuotesParams::PrimaryQuotes
}
-int InsetQuotes::docbook(odocstream & os, OutputParams const &) const
+void InsetQuotes::docbook(XMLStream & xs, OutputParams const &) const
{
- os << getQuoteEntity();
- return 0;
+ xs << XMLStream::ESCAPE_NONE << getQuoteEntity(false);
}
-docstring InsetQuotes::xhtml(XHTMLStream & xs, OutputParams const &) const
+docstring InsetQuotes::xhtml(XMLStream & xs, OutputParams const &) const
{
- xs << XHTMLStream::ESCAPE_NONE << getQuoteEntity();
+ xs << XMLStream::ESCAPE_NONE << getQuoteEntity(true);
return docstring();
}