]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpecialChar.cpp
The last commit was, uhh, not what I intended.
[lyx.git] / src / insets / InsetSpecialChar.cpp
index bc62e4e7651575325a969a37c71cd57326c75853..1dd92c5901a1d46a0f078fdfde7dfe8988a5afff 100644 (file)
@@ -148,7 +148,7 @@ void InsetSpecialChar::draw(PainterInfo & pi, int x, int y) const
 
 
 // In lyxf3 this will be just LaTeX
-void InsetSpecialChar::write(Buffer const &, ostream & os) const
+void InsetSpecialChar::write(ostream & os) const
 {
        string command;
        switch (kind_) {
@@ -179,7 +179,7 @@ void InsetSpecialChar::write(Buffer const &, ostream & os) const
 
 
 // This function will not be necessary when lyx3
-void InsetSpecialChar::read(Buffer const &, Lexer & lex)
+void InsetSpecialChar::read(Lexer & lex)
 {
        lex.next();
        string const command = lex.getString();
@@ -203,8 +203,8 @@ void InsetSpecialChar::read(Buffer const &, Lexer & lex)
 }
 
 
-int InsetSpecialChar::latex(Buffer const &, odocstream & os,
-                           OutputParams const &) const
+int InsetSpecialChar::latex(odocstream & os,
+                           OutputParams const & rp) const
 {
        switch (kind_) {
        case HYPHENATION:
@@ -226,6 +226,8 @@ int InsetSpecialChar::latex(Buffer const &, odocstream & os,
                os << "\\slash{}";
                break;
        case NOBREAKDASH:
+               if (rp.moving_arg)
+                       os << "\\protect";
                os << "\\nobreakdash-";
                break;
        }
@@ -233,8 +235,7 @@ int InsetSpecialChar::latex(Buffer const &, odocstream & os,
 }
 
 
-int InsetSpecialChar::plaintext(Buffer const &, odocstream & os,
-                               OutputParams const &) const
+int InsetSpecialChar::plaintext(odocstream & os, OutputParams const &) const
 {
        switch (kind_) {
        case HYPHENATION:
@@ -260,8 +261,7 @@ int InsetSpecialChar::plaintext(Buffer const &, odocstream & os,
 }
 
 
-int InsetSpecialChar::docbook(Buffer const &, odocstream & os,
-                             OutputParams const &) const
+int InsetSpecialChar::docbook(odocstream & os, OutputParams const &) const
 {
        switch (kind_) {
        case HYPHENATION:
@@ -287,15 +287,9 @@ int InsetSpecialChar::docbook(Buffer const &, odocstream & os,
 }
 
 
-void InsetSpecialChar::textString(Buffer const & buf, odocstream & os) const
+void InsetSpecialChar::textString(odocstream & os) const
 {
-       plaintext(buf, os, OutputParams(0));
-}
-
-
-Inset * InsetSpecialChar::clone() const
-{
-       return new InsetSpecialChar(kind_);
+       plaintext(os, OutputParams(0));
 }