]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpecialChar.cpp
Pure HTML output for math macros.
[lyx.git] / src / insets / InsetSpecialChar.cpp
index 85db15d45273aaf9868c1996e16f23c9434835f1..469e82c1c6712bbcb69cb0adaac560add98b9336 100644 (file)
@@ -5,7 +5,7 @@
  *
  * \author Asger Alstrup Nielsen
  * \author Jean-Marc Lasgouttes
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS.
  */
 #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));