lyx: fix build

This commit is contained in:
Michael Gehring 2017-04-22 14:20:45 +00:00
parent b10f7ea129
commit dfd1febe08

View file

@ -0,0 +1,33 @@
From 6d375ddeac49ac8c6340398c9797354edca3f5d1 Mon Sep 17 00:00:00 2001
From: Guillaume Munch <gm@lyx.org>
Date: Tue, 20 Dec 2016 00:15:58 +0100
Subject: [PATCH] Fix compilation with Qt5.8dev
---
src/frontends/qt4/GuiViewSource.cpp | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp
index 9c0ea1d707..fe593875e6 100644
--- src/frontends/qt4/GuiViewSource.cpp
+++ 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);
--
2.12.2