commit 3736869b1b0c5d7309e5926314375a2f76d02ca3
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Mon Apr 28 14:31:37 2025 +0200

    Finish MathArray->MathData transition (4/4): loose ends
    
    Inspect each occurence of "array" and replace it with data or cell
    when necessary.
---
 src/mathed/InsetMath.h        |  4 ++--
 src/mathed/InsetMathHull.cpp  |  2 +-
 src/mathed/InsetMathMacro.cpp |  2 +-
 src/mathed/InsetMathNest.cpp  |  4 ++--
 src/mathed/MathData.cpp       |  6 +++---
 src/mathed/MathData.h         |  4 ++--
 src/mathed/MathExtern.cpp     | 10 +++++-----
 src/mathed/MathRow.cpp        | 18 +++++++++---------
 src/mathed/MathRow.h          |  4 ++--
 9 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h
index 34484028bb..f812bac8e2 100644
--- a/src/mathed/InsetMath.h
+++ b/src/mathed/InsetMath.h
@@ -225,9 +225,9 @@ public:
        virtual void replace(ReplaceData &) {}
        /// do we contain a given subsequence?
        virtual bool contains(MathData const &) const { return false; }
-       /// access to the lock (only nest array have one)
+       /// access to the lock (only inset with cells have one)
        virtual bool lock() const { return false; }
-       /// access to the lock (only nest array have one)
+       /// access to the lock (only insets with cells have one)
        virtual void lock(bool) {}
 
        // Indicate that we do not want to hide the normal version of
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index faf80a6a26..5179bdf5dd 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -104,7 +104,7 @@ namespace {
        }
 
 
-       // returns position of first relation operator in the array
+       // returns position of first relation operator in the data
        // used for "intelligent splitting"
        size_t firstRelOp(MathData const & md)
        {
diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp
index f18963b715..49fcf56709 100644
--- a/src/mathed/InsetMathMacro.cpp
+++ b/src/mathed/InsetMathMacro.cpp
@@ -364,7 +364,7 @@ bool InsetMathMacro::addToMathRow(MathRow & mrow, 
MetricsInfo & mi) const
        bool has_contents = d->expanded_.addToMathRow(mrow, mi);
        d->macro_->unlock();
 
-       // if there was no contents and the array is editable, then we
+       // if there was no contents and the cell is editable, then we
        // insert a grey box instead.
        if (!has_contents && mi.base.macro_nesting == 1) {
                // mathclass is unknown because it is irrelevant for spacing
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 7fa38f61e0..55d2db4414 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -151,7 +151,7 @@ void InsetMathNest::cursorPos(BufferView const & bv,
        if (!coord_cache.cells().has(&md)) {
                // this can (semi-)legally happen if we just created this cell
                // and it never has been drawn before. So don't ASSERT.
-               //lyxerr << "no cached data for array " << &md << endl;
+               //lyxerr << "no cached data for cell " << &md << endl;
                x = 0;
                y = 0;
                return;
@@ -2355,7 +2355,7 @@ bool InsetMathNest::script(Cursor & cur, bool up,
                cur.pos() = cur.lastpos();
        } else {
                // convert the thing to our left to a scriptinset or create a 
new
-               // one if in the very first position of the array
+               // one if in the very first position of the data
                if (cur.pos() == 0) {
                        //lyxerr << "new scriptinset" << endl;
                        cur.insert(new InsetMathScript(buffer_, up));
diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp
index e840f1a9d5..9be0b6100e 100644
--- a/src/mathed/MathData.cpp
+++ b/src/mathed/MathData.cpp
@@ -478,7 +478,7 @@ void MathData::updateMacros(Cursor * cur, MacroContext 
const & mc,
        InsetMathMacro const * inmacro = inmath ? inmath->asMacro() : 0;
        docstring const edited_name = inmacro ? inmacro->name() : docstring();
 
-       // go over the array and look for macros
+       // go over the data and look for macros
        for (size_t i = 0; i < size(); ++i) {
                InsetMathMacro * macroInset = 
operator[](i).nucleus()->asMacro();
                if (!macroInset || macroInset->macroName().empty()
@@ -638,7 +638,7 @@ void MathData::detachMacroParameters(DocIterator * cur, 
const size_type macroPos
                } else
                        optarg.insert(1, arg);
 
-               // insert it into the array
+               // insert it
                insert(p, optarg);
                p += optarg.size();
 
@@ -963,7 +963,7 @@ MathData::size_type MathData::x2pos(BufferView const * bv, 
int targetx) const
        }
 
        /**
-        * If we are not at the beginning of the array, go to the left
+        * If we are not at the beginning of the data, go to the left
         * of the inset if one of the following two condition holds:
         * - the current inset is editable (so that the cursor tip is
         *   deeper than us): in this case, we want all intermediate
diff --git a/src/mathed/MathData.h b/src/mathed/MathData.h
index 2ad8364ca6..4271b80476 100644
--- a/src/mathed/MathData.h
+++ b/src/mathed/MathData.h
@@ -120,7 +120,7 @@ public:
        /// checked read access
        MathAtom const & operator[](pos_type) const;
 
-       /// Add this array to a math row. Return true if contents got added
+       /// Add this data to a math row. Return true if contents got added
        bool addToMathRow(MathRow &, MetricsInfo & mi) const;
 
        /// rebuild cached metrics information
@@ -159,7 +159,7 @@ public:
        int ym(BufferView const & bv) const;
        /// write access to coordinate;
        void setXY(BufferView & bv, int x, int y) const;
-       /// returns x coordinate of given position in the array
+       /// returns x coordinate of given position in the data
        int pos2x(BufferView const * bv, size_type pos) const;
        /// returns position of given x coordinate
        size_type x2pos(BufferView const * bv, int targetx) const;
diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp
index 49b5de9e11..349aa6a003 100644
--- a/src/mathed/MathExtern.cpp
+++ b/src/mathed/MathExtern.cpp
@@ -331,7 +331,7 @@ void replaceNested(
 {
        Buffer * buf = md.buffer();
        // use indices rather than iterators for the loop  because we are going
-       // to modify the array.
+       // to modify the data.
        for (size_t i = 0; i < md.size(); ++i) {
                // check whether this is the begin of the sequence
                if (!testOpen(md[i]))
@@ -657,7 +657,7 @@ void extractFunctions(MathData & md, ExternalMath kind)
                // replace the function name by a real function inset
                *it = MathAtom(p.release());
 
-               // remove the source of the argument from the array
+               // remove the source of the argument from the data
                md.erase(it + 1, st);
 
                // re-insert exponent
@@ -862,7 +862,7 @@ bool testDiffItem(MathAtom const & at)
 }
 
 
-bool testDiffArray(MathData const & md)
+bool testDiffCell(MathData const & md)
 {
        return !md.empty() && testDiffItem(md.front());
 }
@@ -872,8 +872,8 @@ bool testDiffFrac(MathAtom const & at)
 {
        return
                at->asFracInset()
-                       && testDiffArray(at->asFracInset()->cell(0))
-                       && testDiffArray(at->asFracInset()->cell(1));
+                       && testDiffCell(at->asFracInset()->cell(0))
+                       && testDiffCell(at->asFracInset()->cell(1));
 }
 
 
diff --git a/src/mathed/MathRow.cpp b/src/mathed/MathRow.cpp
index 988d9baff5..36ee2fc11b 100644
--- a/src/mathed/MathRow.cpp
+++ b/src/mathed/MathRow.cpp
@@ -160,7 +160,7 @@ MathRow::MathRow(MetricsInfo & mi, MathData const * md)
        // A MathRow should not be completely empty
        if (!has_contents) {
                Element e(mi, BOX, MC_ORD);
-               // empty arrays are visible when they are editable
+               // empty cells are visible when they are editable
                e.color = mi.base.macro_nesting == 0 ? Color_mathline : 
Color_none;
                push_back(e);
        }
@@ -250,7 +250,7 @@ void MathRow::metrics(MetricsInfo & mi, Dimension & dim)
        // In order to compute the dimension of macros and their
        // arguments, it is necessary to keep track of them.
        vector<pair<InsetMath const *, Dimension>> dim_insets;
-       vector<pair<MathData const *, Dimension>> dim_arrays;
+       vector<pair<MathData const *, Dimension>> dim_cells;
        CoordCache & coords = mi.base.bv->coordCache();
        for (Element & e : elements_) {
                mi.base.macro_nesting = e.macro_nesting;
@@ -273,7 +273,7 @@ void MathRow::metrics(MetricsInfo & mi, Dimension & dim)
                                e.inset->beforeMetrics();
                        }
                        if (e.md)
-                               dim_arrays.push_back(make_pair(e.md, 
Dimension()));
+                               dim_cells.push_back(make_pair(e.md, 
Dimension()));
                        break;
                case END:
                        if (e.inset) {
@@ -289,9 +289,9 @@ void MathRow::metrics(MetricsInfo & mi, Dimension & dim)
                                d.wid = e.before + e.after;
                        }
                        if (e.md) {
-                               LATTEST(dim_arrays.back().first == e.md);
-                               coords.cells().add(e.md, 
dim_arrays.back().second);
-                               dim_arrays.pop_back();
+                               LATTEST(dim_cells.back().first == e.md);
+                               coords.cells().add(e.md, 
dim_cells.back().second);
+                               dim_cells.pop_back();
                        }
                        break;
                case BOX:
@@ -311,8 +311,8 @@ void MathRow::metrics(MetricsInfo & mi, Dimension & dim)
                        // Now add the dimension to current macros and 
arguments.
                        for (auto & dim_macro : dim_insets)
                                dim_macro.second += d;
-                       for (auto & dim_array : dim_arrays)
-                               dim_array.second += d;
+                       for (auto & dim_cell : dim_cells)
+                               dim_cell.second += d;
                }
 
                if (e.compl_text.empty())
@@ -321,7 +321,7 @@ void MathRow::metrics(MetricsInfo & mi, Dimension & dim)
                augmentFont(font, "mathnormal");
                dim.wid += mathed_string_width(font, e.compl_text);
        }
-       LATTEST(dim_insets.empty() && dim_arrays.empty());
+       LATTEST(dim_insets.empty() && dim_cells.empty());
 }
 
 
diff --git a/src/mathed/MathRow.h b/src/mathed/MathRow.h
index 60f737ae3c..c2cd930660 100644
--- a/src/mathed/MathRow.h
+++ b/src/mathed/MathRow.h
@@ -50,8 +50,8 @@ public:
        enum Type {
                INSET, // this element is a plain inset
                BOX, // an empty box
-               BEGIN, // an inset and/or a math array begins here
-               END, // an inset and/or a math array ends here
+               BEGIN, // an inset and/or a cell begins here
+               END, // an inset and/or a cell ends here
                BEGIN_SEL, // the selection begins here
                END_SEL, // the selection ends here
                DUMMY // a dummy element (used before or after row)
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to