From dfd1febe0861f6481939bf056c312eaf7a86fab1 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sat, 22 Apr 2017 14:20:45 +0000 Subject: [PATCH] lyx: fix build --- .../0001-Fix-compilation-with-Qt5.8dev.patch | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 srcpkgs/lyx/patches/0001-Fix-compilation-with-Qt5.8dev.patch diff --git a/srcpkgs/lyx/patches/0001-Fix-compilation-with-Qt5.8dev.patch b/srcpkgs/lyx/patches/0001-Fix-compilation-with-Qt5.8dev.patch new file mode 100644 index 00000000000..f79a03482fc --- /dev/null +++ b/srcpkgs/lyx/patches/0001-Fix-compilation-with-Qt5.8dev.patch @@ -0,0 +1,33 @@ +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 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 +