]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_scriptinset.C
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_scriptinset.C
index a8bf9d6b7b64d1c0489437d7c13406c3bc6ba661..5fc4110ca4fbcc011318258a45e6f8fd90e7db54 100644 (file)
@@ -1,6 +1,5 @@
 #include <config.h>
 #include "debug.h"
-#include "support.h"
 #include "support/LOstream.h"
 
 #ifdef __GNUG__
@@ -20,93 +19,12 @@ MathInset * MathScriptInset::clone() const
        return new MathScriptInset(*this);
 }
 
-#if 0
 
-bool MathScriptInset::idxUp(int & idx, int & pos) const
+MathScriptInset const * MathScriptInset::asScriptInset() const
 {
-       if (idx == 0 || !up()) 
-               return false;
-       idx = 0;
-       pos = 0;
-       return true;
+       return this;
 }
 
-bool MathScriptInset::idxDown(int & idx, int & pos) const
-{
-       if (idx == 1 || !down()) 
-               return false;
-       idx = 1;
-       pos = 0;
-       return true;
-}
-
-bool MathScriptInset::idxFirst(int & idx, int & pos) const
-{
-       idx = up() ? 0 : 1;
-       pos = 0;
-       return true;
-}
-
-bool MathScriptInset::idxLast(int & idx, int & pos) const
-{
-       idx = down() ? 1 : 0;
-       pos = cell(idx).size();
-       return true;
-}
-
-
-bool MathScriptInset::idxFirstUp(int & idx, int & pos) const
-{
-       if (!up()) 
-               return false;
-       idx = 0;
-       pos = 0;
-       return true;
-}
-
-
-bool MathScriptInset::idxFirstDown(int & idx, int & pos) const
-{
-       if (!down()) 
-               return false;
-       idx = 1;
-       pos = 0;
-       return true;
-}
-
-
-bool MathScriptInset::idxLastUp(int & idx, int & pos) const
-{
-       if (!up()) 
-               return false;
-       idx = 0;
-       pos = cell(idx).size();
-       return true;
-}
-
-
-bool MathScriptInset::idxLastDown(int & idx, int & pos) const
-{
-       if (!down()) 
-               return false;
-       idx = 1;
-       pos = cell(idx).size();
-       return true;
-}
-
-void MathScriptInset::idxDelete(int & idx, bool & popit, bool & deleteit)
-{
-       if (idx == 0) 
-               up(false);
-       else
-               down(false);
-       popit = true;
-       deleteit = !(up() || down());
-}
-
-#endif
-
-
 void MathScriptInset::write(std::ostream & os, bool fragile) const
 {
        cell(0).write(os, fragile);
@@ -120,6 +38,8 @@ void MathScriptInset::metrics(MathStyles st) const
        width_   = xcell(0).width();
        ascent_  = xcell(0).ascent();
        descent_ = xcell(0).descent();
+       //lyxerr << "MathScriptInset::metrics: w: " << width_ << " a: " << ascent_
+       //      << " d: " << descent_ << "\n";
 }