Compare commits

..

3 Commits

Author SHA1 Message Date
Stephan Witt
391ed04cd2 support for more modern macos versions 2024-12-02 08:47:28 -08:00
Stephan Witt
bdaf1dbe99 #12224 improved palette change event for macos 2024-12-02 08:46:04 -08:00
Jean-Marc Lasgouttes
8e29ad433d 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 [,].
2024-12-02 15:24:38 +01:00
4 changed files with 6 additions and 5 deletions

View File

@ -390,7 +390,7 @@ DMGNAME="${LyxBase}${LyXGitCommitHash:+-}${LyXGitCommitHash}"
DMGSIZE="550m"
# Check for existing SDKs
SDKs=$(echo ${DEVELOPER_SDKS}/MacOSX1[01]*sdk)
SDKs=$(echo ${DEVELOPER_SDKS}/MacOSX1[0-9]*sdk)
case $SDKs in
*${SDKROOT}*)
;;

View File

@ -2286,9 +2286,7 @@ bool Cursor::upDownInText(bool up)
}
Row const & real_next_row = tm.parMetrics(pit()).rows()[next_row];
auto [b, p] = tm.getPosNearX(real_next_row, xo);
pos() = p;
boundary(b);
tie(pos(), boundary()) = tm.getPosNearX(real_next_row, xo);
// When selection==false, this is done by TextMetrics::editXY
setCurrentFont();

View File

@ -129,6 +129,8 @@ public:
///
bool boundary() const { return boundary_; }
///
bool & boundary() { return boundary_; }
///
void boundary(bool b) { boundary_ = b; }
// the two methods below have been inlined out because of

View File

@ -1797,8 +1797,9 @@ bool GuiView::event(QEvent * e)
// We need to update metrics here to avoid a crash (#12786)
theBufferList().changed(true);
refillToolbars();
return QMainWindow::event(e);
}
return QMainWindow::event(e);
return true;
}
#else
// Pre 6.8: OS-dependent