commit 174dc2c8be3c0098e28bf5676819c7ca1c65d74f Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Thu Oct 12 11:09:46 2023 +0200
Use Color_selectionmath as needed for multi-cell selection in math This is complementary to partial selection implemented at 65cb9fa4. --- src/mathed/MathData.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index eee53d2..24b4d86 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -239,6 +239,18 @@ bool MathData::addToMathRow(MathRow & mrow, MetricsInfo & mi) const if (s1.idx() == s2.idx() && &inset->cell(s1.idx()) == this) { bspos = s1.pos(); espos = s2.pos(); + } else if (s1.idx() != s2.idx()) { + // search for this math data and check whether it is selected + for (idx_type idx = 0; idx < inset->nargs(); ++idx) { + MathData const & c = inset->cell(idx); + if (&c == this && inset->idxBetween(idx, s1.idx(), s2.idx())) { + // whole cell is selected + bspos = 0; + espos = size(); + // no need to continue searchning + break; + } + } } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs