From 6d375ddeac49ac8c6340398c9797354edca3f5d1 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 --- src/frontends/qt4/GuiViewSource.cpp | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp index 9c0ea1d..fe59387 100644 --- a/src/frontends/qt4/GuiViewSource.cpp +++ b/src/frontends/qt4/GuiViewSource.cpp @@ -218,14 +218,9 @@ void ViewSourceWidget::updateView(BufferView const * bv) if (changed && !texrow_) { // 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); -- 1.7.1