]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_textinset.C
Jean-Marc's fix for wrong descent
[lyx.git] / src / mathed / math_textinset.C
index 494fc753a7e942c6d910de08f7728ed23d2b3ea7..aa1e2e26381af42caa2b20a04be4fe3a3f733388 100644 (file)
@@ -17,7 +17,7 @@ MathInset * MathTextInset::clone() const
 
 MathInset::idx_type MathTextInset::pos2row(pos_type pos) const
 {
-       for (pos_type r = 0, n = cache_.nargs(); r < n; ++r) 
+       for (pos_type r = 0, n = cache_.nargs(); r < n; ++r)
                if (pos >= cache_.cellinfo_[r].begin_ && pos <= cache_.cellinfo_[r].end_)
                        return r;
        lyxerr << "illegal row for pos " << pos << "\n";
@@ -28,13 +28,13 @@ MathInset::idx_type MathTextInset::pos2row(pos_type pos) const
 void MathTextInset::getPos(idx_type, pos_type pos, int & x, int & y) const
 {
        idx_type const i = pos2row(pos);
-       pos_type const p = pos - cache_.cellinfo_[i].begin_; 
+       pos_type const p = pos - cache_.cellinfo_[i].begin_;
        cache_.getPos(i, p, x, y);
 }
 
 
 bool MathTextInset::idxUpDown(idx_type &, pos_type & pos, bool up,
-       int targetx) const
+       int /*targetx*/) const
 {
        // try to move only one screen row up or down if possible
        idx_type i = pos2row(pos);
@@ -50,14 +50,14 @@ bool MathTextInset::idxUpDown(idx_type &, pos_type & pos, bool up,
                        return false;
        }
        MathGridInset::CellInfo const & cell2 = cache_.cellinfo_[i];
-       pos = xcell(0).x2pos(cell2.begin_, x, cell2.glue_);
+       pos = cell(0).x2pos(cell2.begin_, x, cell2.glue_);
        return true;
 }
 
 
 void MathTextInset::metrics(MathMetricsInfo & mi) const
 {
-       xcell(0).metrics(mi);
+       cell(0).metrics(mi);
 
        // we do our own metrics fiddling
        // delete old cache
@@ -97,14 +97,14 @@ void MathTextInset::metrics(MathMetricsInfo & mi) const
                        // This is a regular char. Go on if we either don't care for
                        // the width limit or have not reached that limit.
                        curr += cell(0)[i]->width();
-                       if (!mi.base.restrictwidth || curr + safe <= mi.base.textwidth) 
+                       if (!mi.base.restrictwidth || curr + safe <= mi.base.textwidth)
                                continue;
                }
 
                // We passed the limit. Create a row entry.
                //lyxerr << "passed limit\n";
                cache_.appendRow();
-               MathXArray & ar = cache_.xcell(cache_.nargs() - 1);
+               MathArray & ar = cache_.cell(cache_.nargs() - 1);
                MathGridInset::CellInfo & row = cache_.cellinfo_.back();
                if (c == '\n') {
                        // we are here because we hit a hard newline
@@ -129,8 +129,7 @@ void MathTextInset::metrics(MathMetricsInfo & mi) const
                        row.end_   = i + 1;
                        begin      = i + 1;
                }
-               ar.data() =
-                       MathArray(cell(0).begin() + row.begin_, cell(0).begin() + row.end_);
+               ar = MathArray(cell(0).begin() + row.begin_, cell(0).begin() + row.end_);
                //lyxerr << "line: " << ar << "\n";
                // in any case, start the new row with empty boxes
                curr = 0;
@@ -138,12 +137,11 @@ void MathTextInset::metrics(MathMetricsInfo & mi) const
        }
        // last row: put in everything else
        cache_.appendRow();
-       MathXArray & ar = cache_.xcell(cache_.nargs() - 1);
+       MathArray & ar = cache_.cell(cache_.nargs() - 1);
        MathGridInset::CellInfo & row = cache_.cellinfo_.back();
        row.begin_ = begin;
        row.end_   = cell(0).size();
-       ar.data()  =
-               MathArray(cell(0).begin() + row.begin_, cell(0).begin() + row.end_);
+       ar = MathArray(cell(0).begin() + row.begin_, cell(0).begin() + row.end_);
        //lyxerr << "last line: " << ar.data() << "\n";
 
        // what to report?
@@ -162,5 +160,5 @@ void MathTextInset::draw(MathPainterInfo & pi, int x, int y) const
 void MathTextInset::drawSelection(MathPainterInfo & pi,
                idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) const
 {
-       cache_.drawSelection(pi, idx1, pos1, idx2, pos2);       
+       cache_.drawSelection(pi, idx1, pos1, idx2, pos2);
 }