commit 9d9a81b3a575bee52df08443e2ca42f3c10a9b26
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Mon Apr 28 13:33:41 2025 +0200
Rename CoordCache::getXxxx to CoordCache::xxxx
There is no reason to use a different name for the const and the
non-const versions.
---
src/BufferView.cpp | 4 ++--
src/CoordCache.cpp | 4 ++--
src/CoordCache.h | 4 ++--
src/Cursor.cpp | 4 ++--
src/insets/Inset.cpp | 8 ++++----
src/insets/InsetTabular.cpp | 4 ++--
src/mathed/InsetMathMacro.cpp | 4 ++--
src/mathed/InsetMathNest.cpp | 10 +++++-----
src/mathed/MathData.cpp | 20 ++++++++++----------
src/mathed/MathRow.cpp | 2 +-
10 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index fe148b5573..28153bece8 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -735,7 +735,7 @@ string BufferView::contextMenu(int x, int y) const
if (covering_inset) {
if (covering_inset->asInsetMath()) {
CoordCache::Insets const & inset_cache =
- coordCache().getInsets();
+ coordCache().insets();
Inset const * inner_inset = mathContextMenu(
covering_inset->asInsetMath()->asNestInset(),
inset_cache, x, y);
@@ -2774,7 +2774,7 @@ void BufferView::updateHoveredInset() const
if (covering_inset && covering_inset->asInsetMath()) {
Inset const * inner_inset = clickableMathInset(
covering_inset->asInsetMath()->asNestInset(),
- coordCache().getInsets(), x, y);
+ coordCache().insets(), x, y);
if (inner_inset)
covering_inset = inner_inset;
}
diff --git a/src/CoordCache.cpp b/src/CoordCache.cpp
index ce169fe8c2..316cd0959a 100644
--- a/src/CoordCache.cpp
+++ b/src/CoordCache.cpp
@@ -35,13 +35,13 @@ void CoordCache::clear()
void CoordCache::dump() const
{
- if (getInsets().data_.empty()) {
+ if (insets().data_.empty()) {
LYXERR0("InsetCache is empty.");
return;
}
LYXERR0("InsetCache contains:");
- for (auto const & ccd : getInsets().data_) {
+ for (auto const & ccd : insets().data_) {
// Warning: it is not guaranteed that inset is a valid pointer
// (therefore it has type 'void *') (see bug #7376).
void const * inset = ccd.first;
diff --git a/src/CoordCache.h b/src/CoordCache.h
index 6ca58a9330..62ea34ec30 100644
--- a/src/CoordCache.h
+++ b/src/CoordCache.h
@@ -201,11 +201,11 @@ public:
/// A map from MathData to position on the screen
typedef CoordCacheBase<MathData> Arrays;
Arrays & arrays() { return arrays_; }
- Arrays const & getArrays() const { return arrays_; }
+ Arrays const & arrays() const { return arrays_; }
/// A map from insets to positions on the screen
typedef CoordCacheBase<Inset> Insets;
Insets & insets() { return insets_; }
- Insets const & getInsets() const { return insets_; }
+ Insets const & insets() const { return insets_; }
/// Dump the contents of the cache to lyxerr in debugging form
void dump() const;
diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index f4f410c97e..d6f5a8d3c1 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -79,7 +79,7 @@ DocIterator bruteFind(Cursor const & c, int x, int y)
int xo;
int yo;
Inset const * inset = &it.inset();
- CoordCache::Insets const & insetCache =
c.bv().coordCache().getInsets();
+ CoordCache::Insets const & insetCache =
c.bv().coordCache().insets();
// FIXME: in the case where the inset is not in the cache, this
// means that no part of it is visible on screen. In this case
@@ -2558,7 +2558,7 @@ void Cursor::moveToClosestEdge(int const x, bool const
edit)
// (e.g. InsetMathSpace).
if (edit && (inset->hasSettings() ||
!inset->contextMenuName().empty()))
return;
- CoordCache::Insets const & insetCache =
bv().coordCache().getInsets();
+ CoordCache::Insets const & insetCache =
bv().coordCache().insets();
if (!insetCache.has(inset))
return;
int const wid = insetCache.dim(inset).wid;
diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp
index 86252c38dc..ef4b990b28 100644
--- a/src/insets/Inset.cpp
+++ b/src/insets/Inset.cpp
@@ -329,7 +329,7 @@ string Inset::contextMenuName() const
Dimension const Inset::dimension(BufferView const & bv) const
{
- return bv.coordCache().getInsets().dim(this);
+ return bv.coordCache().insets().dim(this);
}
@@ -619,19 +619,19 @@ bool Inset::editing(BufferView const * bv) const
int Inset::xo(BufferView const & bv) const
{
- return bv.coordCache().getInsets().x(this);
+ return bv.coordCache().insets().x(this);
}
int Inset::yo(BufferView const & bv) const
{
- return bv.coordCache().getInsets().y(this);
+ return bv.coordCache().insets().y(this);
}
bool Inset::covers(BufferView const & bv, int x, int y) const
{
- return bv.coordCache().getInsets().covers(this, x, y);
+ return bv.coordCache().insets().covers(this, x, y);
}
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index c06f1857df..915de0e97f 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -6937,7 +6937,7 @@ int InsetTabular::dist(BufferView & bv, idx_type const
cell, int x, int y) const
int xx = 0;
int yy = 0;
Inset const & inset = *tabular.cellInset(cell);
- Point o = bv.coordCache().getInsets().xy(&inset);
+ Point o = bv.coordCache().insets().xy(&inset);
int const xbeg = o.x - tabular.textHOffset(cell);
int const xend = xbeg + tabular.cellWidth(cell);
row_type const row = tabular.cellRow(cell);
@@ -6984,7 +6984,7 @@ idx_type InsetTabular::getNearestCell(BufferView & bv,
int x, int y) const
idx_type idx_min = 0;
int dist_min = numeric_limits<int>::max();
for (idx_type i = 0, n = nargs(); i != n; ++i) {
- if
(bv.coordCache().getInsets().has(tabular.cellInset(i).get())) {
+ if (bv.coordCache().insets().has(tabular.cellInset(i).get())) {
int const d = dist(bv, i, x, y);
if (d < dist_min) {
dist_min = d;
diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp
index 3318799d09..30ddaac9a3 100644
--- a/src/mathed/InsetMathMacro.cpp
+++ b/src/mathed/InsetMathMacro.cpp
@@ -782,7 +782,7 @@ void InsetMathMacro::draw(PainterInfo & pi, int x, int y)
const
// draw definition
d->definition_.draw(pi, x, y);
- Dimension const & defDim =
coords.getArrays().dim(&d->definition_);
+ Dimension const & defDim = coords.arrays().dim(&d->definition_);
y += max(fontDim.des, defDim.des);
// draw parameters
@@ -792,7 +792,7 @@ void InsetMathMacro::draw(PainterInfo & pi, int x, int y)
const
for (idx_type i = 0; i < nargs(); ++i) {
// position of label
- Dimension const & cdim =
coords.getArrays().dim(&cell(i));
+ Dimension const & cdim = coords.arrays().dim(&cell(i));
x = expx + 1;
y += max(fontDim.asc, cdim.asc) + 1;
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 259764411d..078723fcf4 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -148,7 +148,7 @@ void InsetMathNest::cursorPos(BufferView const & bv,
LASSERT(&sl.inset() == this, return);
MathData const & ar = sl.cell();
CoordCache const & coord_cache = bv.coordCache();
- if (!coord_cache.getArrays().has(&ar)) {
+ if (!coord_cache.arrays().has(&ar)) {
// 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 " << &ar << endl;
@@ -156,15 +156,15 @@ void InsetMathNest::cursorPos(BufferView const & bv,
y = 0;
return;
}
- Point const pt = coord_cache.getArrays().xy(&ar);
- if (!coord_cache.getInsets().has(this)) {
+ Point const pt = coord_cache.arrays().xy(&ar);
+ if (!coord_cache.insets().has(this)) {
// same as above
//lyxerr << "no cached data for inset " << this << endl;
x = 0;
y = 0;
return;
}
- Point const pt2 = coord_cache.getInsets().xy(this);
+ Point const pt2 = coord_cache.insets().xy(this);
//lyxerr << "retrieving position cache for MathData "
// << pt.x << ' ' << pt.y << endl;
x = pt.x - pt2.x + ar.pos2x(&bv, sl.pos());
@@ -174,7 +174,7 @@ void InsetMathNest::cursorPos(BufferView const & bv,
// << " ar.asc: " << ar.ascent() << " ar.des: " << ar.descent() <<
endl;
// move cursor visually into empty cells ("blue rectangles");
if (ar.empty() && bv.inputMethod()->preeditString().empty()) {
- Dimension const dim = coord_cache.getArrays().dim(&ar);
+ Dimension const dim = coord_cache.arrays().dim(&ar);
x += dim.wid / 3;
}
}
diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp
index 262f70839b..6f3faec86d 100644
--- a/src/mathed/MathData.cpp
+++ b/src/mathed/MathData.cpp
@@ -396,7 +396,7 @@ void MathData::drawSelection(PainterInfo & pi, int const x,
int const y) const
if (s1.idx() == s2.idx() && &c1 == this) {
// selection inside cell
- Dimension const dim = bv->coordCache().getArrays().dim(&c1);
+ Dimension const dim = bv->coordCache().arrays().dim(&c1);
int const beg = c1.pos2x(bv, s1.pos());
int const end = c1.pos2x(bv, s2.pos());
pi.pain.fillRectangle(x + beg, y - dim.ascent(),
@@ -406,7 +406,7 @@ void MathData::drawSelection(PainterInfo & pi, int const x,
int const y) const
MathData const & c = inset->cell(i);
if (&c == this && inset->idxBetween(i, s1.idx(),
s2.idx())) {
// The whole cell is selected
- Dimension const dim =
bv->coordCache().getArrays().dim(&c);
+ Dimension const dim =
bv->coordCache().arrays().dim(&c);
pi.pain.fillRectangle(x, y - dim.ascent(),
dim.width(), dim.height(),
Color_selection);
@@ -939,7 +939,7 @@ int MathData::pos2x(BufferView const * bv, size_type pos)
const
{
int x = 0;
size_type target = min(pos, size());
- CoordCache::Insets const & coords = bv->coordCache().getInsets();
+ CoordCache::Insets const & coords = bv->coordCache().insets();
for (size_type i = 0; i < target; ++i) {
const_iterator it = begin() + i;
//lyxerr << "char: " << (*it)->getChar()
@@ -955,7 +955,7 @@ MathData::size_type MathData::x2pos(BufferView const * bv,
int targetx) const
const_iterator it = begin();
int lastx = 0;
int currx = 0;
- CoordCache::Insets const & coords = bv->coordCache().getInsets();
+ CoordCache::Insets const & coords = bv->coordCache().insets();
// find first position after targetx
for (; currx < targetx && it != end(); ++it) {
lastx = currx;
@@ -984,7 +984,7 @@ MathData::size_type MathData::x2pos(BufferView const * bv,
int targetx) const
int MathData::dist(BufferView const & bv, int x, int y) const
{
- return bv.coordCache().getArrays().squareDistance(this, x, y);
+ return bv.coordCache().arrays().squareDistance(this, x, y);
}
@@ -997,13 +997,13 @@ void MathData::setXY(BufferView & bv, int x, int y) const
Dimension const & MathData::dimension(BufferView const & bv) const
{
- return bv.coordCache().getArrays().dim(this);
+ return bv.coordCache().arrays().dim(this);
}
int MathData::xm(BufferView const & bv) const
{
- Geometry const & g = bv.coordCache().getArrays().geometry(this);
+ Geometry const & g = bv.coordCache().arrays().geometry(this);
return g.pos.x + g.dim.wid / 2;
}
@@ -1011,7 +1011,7 @@ int MathData::xm(BufferView const & bv) const
int MathData::ym(BufferView const & bv) const
{
- Geometry const & g = bv.coordCache().getArrays().geometry(this);
+ Geometry const & g = bv.coordCache().arrays().geometry(this);
return g.pos.y + (g.dim.des - g.dim.asc) / 2;
}
@@ -1019,13 +1019,13 @@ int MathData::ym(BufferView const & bv) const
int MathData::xo(BufferView const & bv) const
{
- return bv.coordCache().getArrays().x(this);
+ return bv.coordCache().arrays().x(this);
}
int MathData::yo(BufferView const & bv) const
{
- return bv.coordCache().getArrays().y(this);
+ return bv.coordCache().arrays().y(this);
}
diff --git a/src/mathed/MathRow.cpp b/src/mathed/MathRow.cpp
index 6eafe4cf2c..1327660061 100644
--- a/src/mathed/MathRow.cpp
+++ b/src/mathed/MathRow.cpp
@@ -101,7 +101,7 @@ void drawMarkers(PainterInfo const & pi, MathRow::Element
const & e,
return;
CoordCache const & coords = pi.base.bv->coordCache();
- Dimension const dim = coords.getInsets().dim(e.inset);
+ Dimension const dim = coords.insets().dim(e.inset);
// the marker is before/after the inset. Necessary space has been
reserved already.
int const l = x + e.before - (markerMargin(e) > 0 ? 1 : 0);
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs