]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetspace.C
insetcharstyle drawing cosmetics
[lyx.git] / src / insets / insetspace.C
index ced4160a901102d9a55a7ce7a5b65440b1779b98..11cc7925e14f87bf62556a4b40e53632059deaa0 100644 (file)
@@ -6,9 +6,9 @@
  * \author Asger Alstrup Nielsen
  * \author Jean-Marc Lasgouttes
  * \author Lars Gullik Bjønnes
- * \author Juergen Spitzmueller
+ * \author Jürgen Spitzmüller
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 #include "insetspace.h"
 
 #include "debug.h"
-#include "dimension.h"
-#include "LaTeXFeatures.h"
-#include "latexrunparams.h"
-#include "BufferView.h"
-#include "frontends/Painter.h"
-#include "frontends/font_metrics.h"
+#include "LColor.h"
 #include "lyxlex.h"
-#include "lyxfont.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 
-using std::ostream;
+#include "frontends/font_metrics.h"
+#include "frontends/Painter.h"
+
+
+using std::string;
 using std::max;
+using std::auto_ptr;
+using std::ostream;
 
 
 InsetSpace::InsetSpace()
@@ -71,12 +72,13 @@ void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
                        dim.wid = 10;
                        break;
        }
+       dim_ = dim;
 }
 
 
 void InsetSpace::draw(PainterInfo & pi, int x, int y) const
 {
-       int const w = width(pi.base.bv, pi.base.font);
+       int const w = width();
        int const h = font_metrics::ascent('x', pi.base.font);
        int xp[4], yp[4];
 
@@ -99,7 +101,7 @@ void InsetSpace::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-void InsetSpace::write(Buffer const *, ostream & os) const
+void InsetSpace::write(Buffer const &, ostream & os) const
 {
        string command;
        switch (kind_) {
@@ -133,9 +135,9 @@ void InsetSpace::write(Buffer const *, ostream & os) const
 
 
 // This function will not be necessary when lyx3
-void InsetSpace::read(Buffer const *, LyXLex & lex)
+void InsetSpace::read(Buffer const &, LyXLex & lex)
 {
-       lex.nextToken();
+       lex.next();
        string const command = lex.getString();
 
        if (command == "\\space")
@@ -159,8 +161,8 @@ void InsetSpace::read(Buffer const *, LyXLex & lex)
 }
 
 
-int InsetSpace::latex(Buffer const *, ostream & os,
-                     LatexRunParams const & runparams) const
+int InsetSpace::latex(Buffer const &, ostream & os,
+                     OutputParams const & runparams) const
 {
        switch (kind_) {
        case NORMAL:
@@ -192,7 +194,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:
@@ -210,7 +213,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:
@@ -230,7 +234,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:
@@ -250,9 +255,9 @@ int InsetSpace::docbook(Buffer const *, ostream & os, bool) const
 }
 
 
-Inset * InsetSpace::clone() const
+auto_ptr<InsetBase>  InsetSpace::clone() const
 {
-       return new InsetSpace(kind_);
+       return auto_ptr<InsetBase>(new InsetSpace(kind_));
 }
 
 
@@ -270,8 +275,3 @@ bool InsetSpace::isSpace() const
 {
        return true;
 }
-
-bool InsetSpace::isLineSeparator() const
-{
-       return false;
-}