Fix compilation with Qt5.8dev

(cherry picked from commit 6d375ddeac)
This commit is contained in:
Guillaume Munch 2016-12-20 00:15:58 +01:00
parent 857548d33b
commit 9f2fcf20a5
2 changed files with 5 additions and 8 deletions

View File

@ -223,14 +223,9 @@ void ViewSourceWidget::realUpdateView()
if (changed && !texrow_.get()) { if (changed && !texrow_.get()) {
// position-to-row is unavailable // position-to-row is unavailable
// we jump to the first modification // we jump to the first modification
const QChar * oc = old.constData(); int length = min(old.length(), qcontent.length());
const QChar * nc = qcontent.constData();
int pos = 0; int pos = 0;
while (*oc != '\0' && *nc != '\0' && *oc == *nc) { for (; pos < length && old.at(pos) == qcontent.at(pos); ++pos) {}
++oc;
++nc;
++pos;
}
QTextCursor c = QTextCursor(viewSourceTV->document()); QTextCursor c = QTextCursor(viewSourceTV->document());
//get some space below the cursor //get some space below the cursor
c.setPosition(pos); c.setPosition(pos);

View File

@ -247,4 +247,6 @@ What's new
- Update boost source to 1.62. - 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.