#include "Painter.h"
#include "font.h"
#include "lyxlex.h"
+#include "lyxfont.h"
using std::ostream;
using std::max;
}
-int InsetSpecialChar::linuxdoc(Buffer const * buf, ostream & os) const
+int InsetSpecialChar::linuxdoc(Buffer const *, ostream & os) const
{
- return ascii(buf, os, 0);
+ switch (kind_) {
+ case HYPHENATION:
+ case LIGATURE_BREAK:
+ break;
+ case END_OF_SENTENCE:
+ os << ".";
+ break;
+ case LDOTS:
+ os << "...";
+ break;
+ case MENU_SEPARATOR:
+ os << "&lyxarrow;";
+ break;
+ case PROTECTED_SEPARATOR:
+ os << " ";
+ break;
+ }
+ return 0;
}
-int InsetSpecialChar::docBook(Buffer const * buf, ostream & os) const
+int InsetSpecialChar::docbook(Buffer const *, ostream & os) const
{
- return ascii(buf, os, 0);
+ switch (kind_) {
+ case HYPHENATION:
+ case LIGATURE_BREAK:
+ break;
+ case END_OF_SENTENCE:
+ os << ".";
+ break;
+ case LDOTS:
+ os << "...";
+ break;
+ case MENU_SEPARATOR:
+ os << "&lyxarrow;";
+ break;
+ case PROTECTED_SEPARATOR:
+ os << " ";
+ break;
+ }
+ return 0;
}
void InsetSpecialChar::validate(LaTeXFeatures & features) const
{
if (kind_ == MENU_SEPARATOR) {
- features.lyxarrow = true;
+ features.require("lyxarrow");
}
}
+
+
+bool InsetSpecialChar::isChar() const
+{
+ return true;
+}
+
+
+bool InsetSpecialChar::isLetter() const
+{
+ return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
+}
+
+
+bool InsetSpecialChar::isSpace() const
+{
+ return kind_ == PROTECTED_SEPARATOR;
+}
+
+
+bool InsetSpecialChar::isLineSeparator() const
+{
+ return kind_ == HYPHENATION || kind_ == MENU_SEPARATOR;
+}