mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
traversing math tables should be at least as fast as for ordinary table by
now... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3732 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3c416fd6bf
commit
82121d83da
@ -945,6 +945,7 @@ void MathCursor::touch()
|
||||
|
||||
void MathCursor::normalize()
|
||||
{
|
||||
#if 0
|
||||
// rebreak
|
||||
{
|
||||
MathIterator it = ibegin(formula()->par().nucleus());
|
||||
@ -953,6 +954,7 @@ void MathCursor::normalize()
|
||||
if (it.par()->asBoxInset())
|
||||
it.par()->asBoxInset()->rebreak();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (idx() >= par()->nargs()) {
|
||||
lyxerr << "this should not really happen - 1: "
|
||||
|
@ -1,26 +0,0 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "math_diminset.h"
|
||||
|
||||
|
||||
MathDimInset::MathDimInset()
|
||||
: MathInset(), width_(0), ascent_(0), descent_(0)
|
||||
{}
|
||||
|
||||
|
||||
int MathDimInset::ascent() const
|
||||
{
|
||||
return ascent_;
|
||||
}
|
||||
|
||||
|
||||
int MathDimInset::descent() const
|
||||
{
|
||||
return descent_;
|
||||
}
|
||||
|
||||
|
||||
int MathDimInset::width() const
|
||||
{
|
||||
return width_;
|
||||
}
|
@ -8,13 +8,14 @@
|
||||
|
||||
class MathDimInset : public MathInset {
|
||||
public:
|
||||
MathDimInset();
|
||||
///
|
||||
int ascent() const;
|
||||
///
|
||||
int descent() const;
|
||||
///
|
||||
int width() const;
|
||||
/// not sure whether the initialization is really necessary
|
||||
MathDimInset() : width_(0), ascent_(0), descent_(0) {}
|
||||
/// read ascent value (should be inline according to gprof)
|
||||
int ascent() const { return ascent_; }
|
||||
/// read descent
|
||||
int descent() const { return descent_; }
|
||||
/// read width
|
||||
int width() const { return width_; }
|
||||
|
||||
protected:
|
||||
///
|
||||
|
@ -78,14 +78,16 @@ void MathXArray::draw(Painter & pain, int x, int y) const
|
||||
yo_ = y;
|
||||
drawn_ = true;
|
||||
|
||||
if (data_.empty()) {
|
||||
const_iterator it = begin(), et = end();
|
||||
|
||||
if (it == et) {
|
||||
pain.rectangle(x, y - ascent_, width_, height(), LColor::mathline);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const_iterator it = begin(); it != end(); ++it) {
|
||||
for (; it != et; ++it) {
|
||||
MathInset const * p = it->nucleus();
|
||||
MathScriptInset const * q = (it + 1 == end()) ? 0 : asScript(it);
|
||||
MathScriptInset const * q = (it + 1 == et) ? 0 : asScript(it);
|
||||
if (q) {
|
||||
q->draw(p, pain, x, y);
|
||||
x += q->width2(p);
|
||||
|
Loading…
Reference in New Issue
Block a user