mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
get rid of some foreach and Q_FOREACH constructs
See https://www.kdab.com/goodbye-q_foreach/ This is reduced to the places where the container is const or can be made const without the need to always introduce an extra variable. Sadly qAsConst (Qt 5.7) and std::as_const (C++17) are not available in all supported setups. Also do some minor cleanups along the way. Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
This commit is contained in:
parent
2b9ca488fd
commit
c4c8094e32
21 changed files with 62 additions and 49 deletions
|
@ -77,8 +77,8 @@ void Printer::flowRender()
|
|||
// get all references to dontbreak divs
|
||||
int start = 0, end = 0;
|
||||
int fullPageResolution = webView->page()->mainFrame()->contentsSize().height();
|
||||
QWebElementCollection dontbreak = webView->page()->mainFrame()->findAllElements(".dontbreak");
|
||||
foreach (QWebElement dontbreakElement, dontbreak) {
|
||||
const QWebElementCollection dontbreak = webView->page()->mainFrame()->findAllElements(".dontbreak");
|
||||
for (QWebElement dontbreakElement: dontbreak) {
|
||||
if ((dontbreakElement.geometry().y() + dontbreakElement.geometry().height()) - start < pageSize.height()) {
|
||||
// One more element can be placed
|
||||
end = dontbreakElement.geometry().y() + dontbreakElement.geometry().height();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue