Commits

Yuya Nishihara committed 8e30381

qscilib: don't pass negative int as argument 2 of SendScintilla (fixes #3358)

It seems old QsciScintilla (or sip) can't accept negative integer as unsigned
long type. To be precise, it should do `static_cast<unsigned long>(x)`, but
it can simply ignore negative value, which is invalid position anyway.

  • Participants
  • Parent commits 76bd52d
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/qscilib.py

         but returns valid line number even if no character fount at point"""
         # lineAt() uses the strict request, SCI_POSITIONFROMPOINTCLOSE
         chpos = self.SendScintilla(self.SCI_POSITIONFROMPOINT,
-                                   point.x(), point.y())
+                                   # no implicit cast to ulong in old QScintilla
+                                   # unsigned long wParam, long lParam
+                                   max(point.x(), 0), point.y())
         return self.SendScintilla(self.SCI_LINEFROMPOSITION, chpos)
 
     # compability mode with QScintilla from Ubuntu 10.04