X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetSpecialChar.cpp;h=f342d0f20d0ee24de9a2149da9e495e9b7c7ac0d;hb=6b49b6b129af9417fea7ea907a44a46fbbd38340;hp=106755076b5d556eb3b3c66bc0c798d1dff2d7ae;hpb=d866717ef7503a1373dd1cb3925e1ac97b079192;p=lyx.git diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp index 106755076b..f342d0f20d 100644 --- a/src/insets/InsetSpecialChar.cpp +++ b/src/insets/InsetSpecialChar.cpp @@ -239,12 +239,15 @@ void InsetSpecialChar::latex(otexstream & os, } -int InsetSpecialChar::plaintext(odocstream & os, OutputParams const &) const +int InsetSpecialChar::plaintext(odocstringstream & os, + OutputParams const &, size_t) const { switch (kind_) { case HYPHENATION: - case LIGATURE_BREAK: return 0; + case LIGATURE_BREAK: + os.put(0x200c); + return 1; case END_OF_SENTENCE: os << '.'; return 1; @@ -258,7 +261,7 @@ int InsetSpecialChar::plaintext(odocstream & os, OutputParams const &) const os << '/'; return 1; case NOBREAKDASH: - os << '-'; + os.put(0x2011); return 1; } return 0; @@ -295,7 +298,9 @@ docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const { switch (kind_) { case HYPHENATION: + break; case LIGATURE_BREAK: + xs << XHTMLStream::ESCAPE_NONE << "‌"; break; case END_OF_SENTENCE: xs << '.'; @@ -310,7 +315,7 @@ docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const xs << XHTMLStream::ESCAPE_NONE << "⁄"; break; case NOBREAKDASH: - xs << '-'; + xs << XHTMLStream::ESCAPE_NONE << "‑"; break; } return docstring(); @@ -319,7 +324,17 @@ docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const void InsetSpecialChar::toString(odocstream & os) const { - plaintext(os, OutputParams(0)); + switch (kind_) { + case LIGATURE_BREAK: + // Do not output ZERO WIDTH NON JOINER here + // Spell checker would choke on it. + return; + default: + break; + } + odocstringstream ods; + plaintext(ods, OutputParams(0)); + os << ods.str(); } @@ -342,7 +357,8 @@ void InsetSpecialChar::validate(LaTeXFeatures & features) const bool InsetSpecialChar::isLetter() const { - return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK; + return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK + || kind_ == NOBREAKDASH; } @@ -353,7 +369,8 @@ bool InsetSpecialChar::isLineSeparator() const // Paragraph::stripLeadingSpaces nukes the characters which // have this property. I leave the code here, since it should // eventually be made to work. (JMarc 20020327) - return kind_ == HYPHENATION || kind_ == MENU_SEPARATOR; + return kind_ == HYPHENATION || kind_ == MENU_SEPARATOR + || kind_ == SLASH; #else return false; #endif