]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetspace.C
The speed patch: redraw only rows that have changed
[lyx.git] / src / insets / insetspace.C
index 5382ed330d4e5e8379b9b54a6b94179df4d9ad44..0ca675b1bb77a3b2fd9f1e2e373096c1c40d66fb 100644 (file)
 #include "insetspace.h"
 
 #include "debug.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxlex.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 
 #include "frontends/font_metrics.h"
 #include "frontends/Painter.h"
@@ -106,13 +106,13 @@ void InsetSpace::write(Buffer const &, ostream & os) const
        string command;
        switch (kind_) {
        case NORMAL:
-               command = "\\space";
+               command = "\\space{}";
                break;
        case PROTECTED:
                command = "~";
                break;
        case THIN:
-               command = "\\,";
+               command = "\\thinspace{}";
                break;
        case QUAD:
                command = "\\quad{}";
@@ -134,17 +134,16 @@ void InsetSpace::write(Buffer const &, ostream & os) const
 }
 
 
-// This function will not be necessary when lyx3
 void InsetSpace::read(Buffer const &, LyXLex & lex)
 {
-       lex.nextToken();
+       lex.next();
        string const command = lex.getString();
 
-       if (command == "\\space")
+       if (command == "\\space{}")
                kind_ = NORMAL;
        else if (command == "~")
                kind_ = PROTECTED;
-       else if (command == "\\,")
+       else if (command == "\\thinspace{}")
                kind_ = THIN;
        else if (command == "\\quad{}")
                kind_ = QUAD;
@@ -162,7 +161,7 @@ void InsetSpace::read(Buffer const &, LyXLex & lex)
 
 
 int InsetSpace::latex(Buffer const &, ostream & os,
-                     LatexRunParams const & runparams) const
+                     OutputParams const & runparams) const
 {
        switch (kind_) {
        case NORMAL:
@@ -194,7 +193,8 @@ int InsetSpace::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetSpace::ascii(Buffer const &, ostream & os, int) const
+int InsetSpace::plaintext(Buffer const &, ostream & os,
+                     OutputParams const &) const
 {
        switch (kind_) {
        case NORMAL:
@@ -212,7 +212,8 @@ int InsetSpace::ascii(Buffer const &, ostream & os, int) const
 }
 
 
-int InsetSpace::linuxdoc(Buffer const &, ostream & os) const
+int InsetSpace::linuxdoc(Buffer const &, ostream & os,
+                        OutputParams const &) const
 {
        switch (kind_) {
        case NORMAL:
@@ -232,7 +233,8 @@ int InsetSpace::linuxdoc(Buffer const &, ostream & os) const
 }
 
 
-int InsetSpace::docbook(Buffer const &, ostream & os, bool) const
+int InsetSpace::docbook(Buffer const &, ostream & os,
+                       OutputParams const &) const
 {
        switch (kind_) {
        case NORMAL:
@@ -252,7 +254,14 @@ int InsetSpace::docbook(Buffer const &, ostream & os, bool) const
 }
 
 
-auto_ptr<InsetBase>  InsetSpace::clone() const
+int InsetSpace::textString(Buffer const & buf, ostream & os,
+                      OutputParams const & op) const
+{
+       return plaintext(buf, os, op);
+}
+
+
+auto_ptr<InsetBase> InsetSpace::doClone() const
 {
        return auto_ptr<InsetBase>(new InsetSpace(kind_));
 }
@@ -272,8 +281,3 @@ bool InsetSpace::isSpace() const
 {
        return true;
 }
-
-bool InsetSpace::isLineSeparator() const
-{
-       return false;
-}