mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 05:37:11 +00:00
Fixup 91d1ad31: beware of the reurn values of getPosNearX
The pair returned by TextMetrics;;getPosNearX is (position, boundary). Here one had to use short variable names p and b because 'pos' and 'boundary' are a members of Cursor, and [b, p] was use dinstead of [p,b]. Here, we added a bool & version of boundary() instead to the usual getter/setter paradigm, because pos() is already like that. It might be that the setter should be removed later. Using these two members, it is now possible to use std::tie instead of auto [,].
This commit is contained in:
parent
629a692ce2
commit
8e29ad433d
@ -2286,9 +2286,7 @@ bool Cursor::upDownInText(bool up)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Row const & real_next_row = tm.parMetrics(pit()).rows()[next_row];
|
Row const & real_next_row = tm.parMetrics(pit()).rows()[next_row];
|
||||||
auto [b, p] = tm.getPosNearX(real_next_row, xo);
|
tie(pos(), boundary()) = tm.getPosNearX(real_next_row, xo);
|
||||||
pos() = p;
|
|
||||||
boundary(b);
|
|
||||||
// When selection==false, this is done by TextMetrics::editXY
|
// When selection==false, this is done by TextMetrics::editXY
|
||||||
setCurrentFont();
|
setCurrentFont();
|
||||||
|
|
||||||
|
@ -129,6 +129,8 @@ public:
|
|||||||
///
|
///
|
||||||
bool boundary() const { return boundary_; }
|
bool boundary() const { return boundary_; }
|
||||||
///
|
///
|
||||||
|
bool & boundary() { return boundary_; }
|
||||||
|
///
|
||||||
void boundary(bool b) { boundary_ = b; }
|
void boundary(bool b) { boundary_ = b; }
|
||||||
|
|
||||||
// the two methods below have been inlined out because of
|
// the two methods below have been inlined out because of
|
||||||
|
Loading…
x
Reference in New Issue
Block a user