]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpecialChar.cpp
Cocoa based Qt-4.6 needs to paint every character separately to match metrics computa...
[lyx.git] / src / insets / InsetSpecialChar.cpp
index 91c13645b535af7e541e949f2c71748b8fce16b2..1fe6840df59f20cbe69af8a86b51dbf71d2dc84b 100644 (file)
@@ -205,8 +205,8 @@ void InsetSpecialChar::read(Lexer & lex)
 }
 
 
-int InsetSpecialChar::latex(odocstream & os,
-                           OutputParams const & rp) const
+void InsetSpecialChar::latex(otexstream & os,
+                            OutputParams const & rp) const
 {
        switch (kind_) {
        case HYPHENATION:
@@ -236,7 +236,6 @@ int InsetSpecialChar::latex(odocstream & os,
                os << "\\nobreakdash-";
                break;
        }
-       return 0;
 }
 
 
@@ -302,13 +301,13 @@ docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const
                xs << '.';
                break;
        case LDOTS:
-               xs << XHTMLStream::NextRaw() << "&hellip;";
+               xs << XHTMLStream::ESCAPE_NONE << "&hellip;";
                break;
        case MENU_SEPARATOR:
-               xs << XHTMLStream::NextRaw() << "&rArr;";
+               xs << XHTMLStream::ESCAPE_NONE << "&rArr;";
                break;
        case SLASH:
-               xs << XHTMLStream::NextRaw() << "&frasl;";
+               xs << XHTMLStream::ESCAPE_NONE << "&frasl;";
                break;
        case NOBREAKDASH:
                xs << '-';
@@ -318,12 +317,20 @@ docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const
 }
 
 
-void InsetSpecialChar::tocString(odocstream & os) const
+void InsetSpecialChar::toString(odocstream & os) const
 {
        plaintext(os, OutputParams(0));
 }
 
 
+void InsetSpecialChar::forToc(docstring & os, size_t) const
+{
+       odocstringstream ods;
+       plaintext(ods, OutputParams(0));
+       os += ods.str();
+}
+
+
 void InsetSpecialChar::validate(LaTeXFeatures & features) const
 {
        if (kind_ == MENU_SEPARATOR)
@@ -335,7 +342,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;
 }
 
 
@@ -346,7 +354,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