From 9f2fcf20a51af2b63161a3290cf5fb02474b42b9 Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Tue, 20 Dec 2016 00:15:58 +0100 Subject: [PATCH] Fix compilation with Qt5.8dev (cherry picked from commit 6d375ddeac49ac8c6340398c9797354edca3f5d1) --- src/frontends/qt4/GuiViewSource.cpp | 9 ++------- status.22x | 4 +++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp index 660da59cdb..8785c897da 100644 --- a/src/frontends/qt4/GuiViewSource.cpp +++ b/src/frontends/qt4/GuiViewSource.cpp @@ -223,14 +223,9 @@ void ViewSourceWidget::realUpdateView() if (changed && !texrow_.get()) { // position-to-row is unavailable // we jump to the first modification - const QChar * oc = old.constData(); - const QChar * nc = qcontent.constData(); + int length = min(old.length(), qcontent.length()); int pos = 0; - while (*oc != '\0' && *nc != '\0' && *oc == *nc) { - ++oc; - ++nc; - ++pos; - } + for (; pos < length && old.at(pos) == qcontent.at(pos); ++pos) {} QTextCursor c = QTextCursor(viewSourceTV->document()); //get some space below the cursor c.setPosition(pos); diff --git a/status.22x b/status.22x index a19285c1e9..9ba3589fa6 100644 --- a/status.22x +++ b/status.22x @@ -247,4 +247,6 @@ What's new - Update boost source to 1.62. -- fix compiler warnings from clang 3.9 and gcc 6. +- Fix compiler warnings from clang 3.9 and gcc 6. + +- Fix compilation with Qt 5.8.