X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetspecialchar.C;h=0c03dde33cea8adad5b0a3fd02d71bdd545a99de;hb=4a5b7a5952ad2381fcdf4830511293e184c7c5a1;hp=f328320c227ba8c79c8b97068530f9acb75c2089;hpb=2470d9297d3f2c303f555c8f235d022b19396679;p=lyx.git diff --git a/src/insets/insetspecialchar.C b/src/insets/insetspecialchar.C index f328320c22..0c03dde33c 100644 --- a/src/insets/insetspecialchar.C +++ b/src/insets/insetspecialchar.C @@ -20,6 +20,7 @@ #include "Painter.h" #include "font.h" #include "lyxlex.h" +#include "lyxfont.h" using std::ostream; using std::max; @@ -263,15 +264,49 @@ int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const } -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; } @@ -284,6 +319,30 @@ Inset * InsetSpecialChar::clone(Buffer const &, bool) const 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; +}