]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.C
IU of drawing phase one without 'semantic changes' as requested by John
[lyx.git] / src / mathed / math_inset.C
index 48763a7526387c4ae9180cd9ba444aa0410696a8..675126d418dd2e94535451991e1b165fafd5e1eb 100644 (file)
 
 #include <config.h>
 
-
 #include "math_inset.h"
-#include "Lsstream.h"
 #include "math_scriptinset.h"
 #include "math_mathmlstream.h"
 #include "math_cursor.h"
-#include "math_parser.h"
 #include "debug.h"
 
 #include "frontends/LyXView.h"
@@ -36,15 +33,7 @@ using std::ostream;
 
 BufferView * MathInset::view() const
 {
-       if (!mathcursor)
-               return 0;
-       return mathcursor->formula()->view();
-}
-
-
-int MathInset::height() const
-{
-       return ascent() + descent();
+       return mathcursor ? mathcursor->formula()->view() : 0;
 }
 
 
@@ -54,13 +43,6 @@ MathInset::size_type MathInset::nargs() const
 }
 
 
-Dimension MathInset::dimensions() const
-{
-       lyxerr << "call MathInset::dimensions()\n";
-       return Dimension(width(), ascent(), descent());
-}
-
-
 MathArray dummyCell;
 
 MathArray & MathInset::cell(idx_type)
@@ -120,6 +102,12 @@ bool MathInset::idxUpDown(idx_type &, pos_type &, bool, int) const
 }
 
 
+bool MathInset::idxUpDown2(idx_type &, pos_type &, bool, int) const
+{
+       return false;
+}
+
+
 bool MathInset::idxFirst(idx_type &, pos_type &) const
 {
        return false;
@@ -166,18 +154,6 @@ bool MathInset::idxBetween(idx_type idx, idx_type from, idx_type to) const
 }
 
 
-void MathInset::metrics(MetricsInfo &) const
-{
-       lyxerr << "MathInset::metrics() called directly!\n";
-}
-
-
-void MathInset::draw(PainterInfo &, int, int) const
-{
-       lyxerr << "MathInset::draw() called directly!\n";
-}
-
-
 void MathInset::drawSelection(PainterInfo &,
        idx_type, pos_type, idx_type, pos_type) const
 {
@@ -185,7 +161,7 @@ void MathInset::drawSelection(PainterInfo &,
 }
 
 
-void MathInset::metricsT(TextMetricsInfo const &) const
+void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
 {
 #ifdef WITH_WARNINGS
        lyxerr << "MathInset::metricsT(Text) called directly!\n";
@@ -270,7 +246,7 @@ int MathInset::docbook(std::ostream &, bool) const
 
 string const & MathInset::getType() const
 {
-       static string t("none");
+       static string const t("none");
        return t;
 }
 
@@ -281,23 +257,6 @@ string MathInset::name() const
 }
 
 
-string asString(MathArray const & ar)
-{
-       std::ostringstream os;
-       WriteStream ws(os);
-       ws << ar;
-       return STRCONV(os.str());
-}
-
-
-MathArray asArray(string const & str)
-{
-       MathArray ar;
-       mathed_parse_cell(ar, str);
-       return ar;
-}
-
-
 ostream & operator<<(ostream & os, MathAtom const & at)
 {
        WriteStream wi(os, false, false);
@@ -305,3 +264,8 @@ ostream & operator<<(ostream & os, MathAtom const & at)
        return os;
 }
 
+
+string MathInset::fileInsetLabel() const
+{
+       return "Formula";
+}