]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetspace.C
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / insetspace.C
index ec1192d4d30b17c3adc690b16d49db8f1db6cd43..801bf188bd99d602ac500d167d3fa77063ba8f99 100644 (file)
@@ -8,7 +8,7 @@
  * \author Lars Gullik Bjønnes
  * \author Juergen Spitzmueller
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
@@ -28,6 +28,7 @@
 
 using std::ostream;
 using std::max;
+using std::auto_ptr;
 
 
 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,7 +135,7 @@ 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();
        string const command = lex.getString();
@@ -159,7 +161,7 @@ void InsetSpace::read(Buffer const *, LyXLex & lex)
 }
 
 
-int InsetSpace::latex(Buffer const *, ostream & os,
+int InsetSpace::latex(Buffer const &, ostream & os,
                      LatexRunParams const & runparams) const
 {
        switch (kind_) {
@@ -192,7 +194,7 @@ int InsetSpace::latex(Buffer const *, ostream & os,
 }
 
 
-int InsetSpace::ascii(Buffer const *, ostream & os, int) const
+int InsetSpace::ascii(Buffer const &, ostream & os, int) const
 {
        switch (kind_) {
        case NORMAL:
@@ -210,10 +212,9 @@ int InsetSpace::ascii(Buffer const *, ostream & os, int) const
 }
 
 
-int InsetSpace::linuxdoc(Buffer const *, ostream & os) const
+int InsetSpace::linuxdoc(Buffer const &, ostream & os) const
 {
        switch (kind_) {
-       // fixme: correct?
        case NORMAL:
        case QUAD:
        case QQUAD:
@@ -231,10 +232,9 @@ int InsetSpace::linuxdoc(Buffer const *, ostream & os) const
 }
 
 
-int InsetSpace::docbook(Buffer const *, ostream & os, bool) const
+int InsetSpace::docbook(Buffer const &, ostream & os, bool) const
 {
        switch (kind_) {
-       // fixme: correct?
        case NORMAL:
        case QUAD:
        case QQUAD:
@@ -252,18 +252,12 @@ int InsetSpace::docbook(Buffer const *, ostream & os, bool) const
 }
 
 
-Inset * InsetSpace::clone(Buffer const &) const
+auto_ptr<InsetBase>  InsetSpace::clone() const
 {
-       return new InsetSpace(kind_);
+       return auto_ptr<InsetBase>(new InsetSpace(kind_));
 }
 
 
-// Inset * InsetSpace::clone(Buffer const &, bool) const
-// {
-//     return new InsetSpace(kind_);
-// }
-
-
 bool InsetSpace::isChar() const
 {
        return true;