]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloat.C
reformatting and remove using delc
[lyx.git] / src / insets / insetfloat.C
index 9d75be1225a2c61df7e495c2323fc3fb3c61afc4..e4f9803d484882f3a47c8d96e59ae5fca8cd728a 100644 (file)
@@ -132,7 +132,7 @@ void InsetFloat::Read(Buffer const * buf, LyXLex & lex)
 {
        if (lex.IsOK()) {
                lex.next();
-               string token = lex.GetString();
+               string const token = lex.GetString();
                if (token == "placement") {
                        lex.next();
                        floatPlacement_ = lex.GetString();
@@ -154,7 +154,7 @@ void InsetFloat::Validate(LaTeXFeatures & features) const
 Inset * InsetFloat::Clone(Buffer const &) const
 {
        InsetFloat * result = new InsetFloat(floatType_);
-       result->inset->init(inset);
+       result->inset.init(&inset);
 
        result->collapsed = collapsed;
        return result;
@@ -176,13 +176,23 @@ int InsetFloat::Latex(Buffer const * buf,
                os << "[" << floatPlacement_ << "]";
        os << "%\n";
     
-       int const i = inset->Latex(buf, os, fragile, fp);
+       int const i = inset.Latex(buf, os, fragile, fp);
        os << "\\end{" << floatType_ << "}%\n";
        
        return i + 2;
 }
 
 
+int InsetFloat::DocBook(Buffer const * buf, ostream & os) const
+{
+       os << "<" << floatType_ << ">";
+       int const i = inset.DocBook(buf, os);
+       os << "</" << floatType_ << ">";
+
+       return i;
+}
+
+
 bool InsetFloat::InsertInsetAllowed(Inset * in) const
 {
        if ((in->LyxCode() == Inset::FOOT_CODE) ||
@@ -195,7 +205,7 @@ bool InsetFloat::InsertInsetAllowed(Inset * in) const
 
 void InsetFloat::InsetButtonRelease(BufferView * bv, int x, int y, int button)
 {
-       if (x >= 0
+       if (x >= top_x
            && x < button_length
            && y >= button_top_y
            && y < button_bottom_y
@@ -203,6 +213,7 @@ void InsetFloat::InsetButtonRelease(BufferView * bv, int x, int y, int button)
                // This obviously need to change.
                lyxerr << "InsetFloat: Let's edit this floats parameters!"
                       << endl;
+               //bv->owner()->getDialogs()->showFloat(this);
        } else {
                InsetCollapsable::InsetButtonRelease(bv, x, y, button);
        }