lyx: fix for Qt 5.8.

This commit is contained in:
Jerome Duval
2017-04-08 13:00:48 +02:00
parent 272811a752
commit 0e22dd640f
2 changed files with 32 additions and 1 deletions

View File

@@ -15,10 +15,11 @@ cross-referenced PDF, just as readily produced - looks like nothing else."
HOMEPAGE="http://www.lyx.org"
LICENSE="GNU GPL v2"
COPYRIGHT="the lyx community"
REVISION="2"
REVISION="3"
SOURCE_URI="ftp://ftp.lyx.org/pub/lyx/stable/2.2.x/lyx-$portVersion.tar.gz"
CHECKSUM_SHA256="7f6a0aeeeb7e9b1405e27394d1b7192e4abebba2491e5d0ffc6a4cb993803a45"
ADDITIONAL_FILES="lyx.rdef.in"
PATCHES="lyx-$portVersion.patchset"
ARCHITECTURES="?x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="?x86"

View File

@@ -0,0 +1,30 @@
From 40dd98fb1c46e0b9773ff4448d863425c80cdcce Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 7 Apr 2017 19:20:49 +0200
Subject: upstream fix for qt 5.8
diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp
index d583897..60792dc 100644
--- a/src/frontends/qt4/GuiViewSource.cpp
+++ b/src/frontends/qt4/GuiViewSource.cpp
@@ -219,14 +219,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);
--
2.11.0