X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetSpecialChar.cpp;h=91c13645b535af7e541e949f2c71748b8fce16b2;hb=12c7e7dde3851ad894380fd42ba741dd3d0cbcc7;hp=8e107d4c0d83b83112070822b09d025029065221;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp index 8e107d4c0d..91c13645b5 100644 --- a/src/insets/InsetSpecialChar.cpp +++ b/src/insets/InsetSpecialChar.cpp @@ -15,9 +15,11 @@ #include "InsetSpecialChar.h" #include "Dimension.h" +#include "Font.h" #include "LaTeXFeatures.h" #include "Lexer.h" #include "MetricsInfo.h" +#include "output_xhtml.h" #include "frontends/FontMetrics.h" #include "frontends/Painter.h" @@ -31,7 +33,7 @@ namespace lyx { InsetSpecialChar::InsetSpecialChar(Kind k) - : kind_(k) + : Inset(0), kind_(k) {} @@ -220,7 +222,10 @@ int InsetSpecialChar::latex(odocstream & os, os << "\\ldots{}"; break; case MENU_SEPARATOR: - os << "\\lyxarrow{}"; + if (rp.local_font->isRightToLeft()) + os << "\\lyxarrow*{}"; + else + os << "\\lyxarrow{}"; break; case SLASH: os << "\\slash{}"; @@ -287,6 +292,32 @@ int InsetSpecialChar::docbook(odocstream & os, OutputParams const &) const } +docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const +{ + switch (kind_) { + case HYPHENATION: + case LIGATURE_BREAK: + break; + case END_OF_SENTENCE: + xs << '.'; + break; + case LDOTS: + xs << XHTMLStream::NextRaw() << "…"; + break; + case MENU_SEPARATOR: + xs << XHTMLStream::NextRaw() << "⇒"; + break; + case SLASH: + xs << XHTMLStream::NextRaw() << "⁄"; + break; + case NOBREAKDASH: + xs << '-'; + break; + } + return docstring(); +} + + void InsetSpecialChar::tocString(odocstream & os) const { plaintext(os, OutputParams(0)); @@ -302,12 +333,6 @@ void InsetSpecialChar::validate(LaTeXFeatures & features) const } -bool InsetSpecialChar::isChar() const -{ - return true; -} - - bool InsetSpecialChar::isLetter() const { return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;