namespace {
- void stripFromLastEqualSign(MathArray & ar)
- {
- // find position of last '=' in the array
- MathArray::size_type pos = ar.size();
- for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it)
- if ((*it)->getChar() == '=')
- pos = it - ar.begin();
-
- // delete everything behind this position
- ar.erase(pos, ar.size());
- }
-
-
string captureOutput(string const & cmd, string const & data)
{
string outfile = lyx::tempName(string(), "mathextern");
mathcursor->selGet(ar);
lyxerr << "use selection: " << ar << "\n";
} else {
- mathcursor->end();
+ mathcursor->stripFromLastEqualSign();
ar = mathcursor->cursor().cell();
- stripFromLastEqualSign(ar);
mathcursor->insert(MathAtom(new MathCharInset('=', LM_TC_VAR)));
//lyxerr << "use whole cell: " << ar << "\n";
}
}
+void MathCursor::stripFromLastEqualSign()
+{
+ // find position of last '=' in the array
+ MathArray & ar = cursor().cell();
+ MathArray::const_iterator et = ar.end();
+ for (MathArray::const_iterator it = ar.begin(); it != ar.end(); ++it)
+ if ((*it)->getChar() == '=')
+ et = it;
+
+ // delete everything behind this position
+ ar.erase(et - ar.begin(), ar.size());
+ pos() = ar.size();
+}
+
+
void seldump(char const * str) const;
///
void dump(char const * str) const;
+ ///
+ void stripFromLastEqualSign();
///
friend class Selection;
void MathFuncInset::metrics(MathMetricsInfo const & mi) const
{
mi_ = mi;
- mathed_string_dim(LM_TC_TEX, mi_, name_, ascent_, descent_, width_);
+ mathed_string_dim(LM_TC_TEXTRM, mi_, name_, ascent_, descent_, width_);
}
void MathFuncInset::draw(Painter & pain, int x, int y) const
{
- drawStr(pain, LM_TC_TEX, mi_, x, y, name_);
+ drawStr(pain, LM_TC_TEXTRM, mi_, x, y, name_);
+}
+
+
+string MathFuncInset::octavize() const
+{
+ return name_;
}
#include "math_diminset.h"
#include "math_defs.h"
-#include "LString.h"
#ifdef __GNUG__
#pragma interface
string const & name() const;
///
void setName(string const & n);
+ ///
+ string octavize() const;
private:
///
string name_;