]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpecialChar.cpp
* add PreBabelPreamble to Language definition (fixes #4786).
[lyx.git] / src / insets / InsetSpecialChar.cpp
index 8e107d4c0d83b83112070822b09d025029065221..91c13645b535af7e541e949f2c71748b8fce16b2 100644 (file)
 #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() << "&hellip;";
+               break;
+       case MENU_SEPARATOR:
+               xs << XHTMLStream::NextRaw() << "&rArr;";
+               break;
+       case SLASH:
+               xs << XHTMLStream::NextRaw() << "&frasl;";
+               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;