Menu

#2328 Qt modified signal when scn.text is NULL

Bug
closed-fixed
nobody
5
2022-05-22
2022-05-10
No

The QByteArray passed to needs to have length = 0 if text is NULL under Qt6. Possible patch:

--- a/qt/ScintillaEditBase/ScintillaEditBase.cpp        Thu Apr 14 10:57:03 2022 -0400
+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp        Tue May 10 15:50:22 2022 -0400
@@ -739,7 +739,7 @@
                                emit linesAdded(added ? 1 : -1);
                        }


-                       const QByteArray bytes = QByteArray::fromRawData(scn.text, scn.length);
+                       const QByteArray bytes = QByteArray::fromRawData(scn.text, (scn.text != NULL ? scn.length : 0));
                        emit modified(scn.modificationType, scn.position, scn.length,
                                      scn.linesAdded, bytes, scn.line,
                                      scn.foldLevelNow, scn.foldLevelPrev);

Discussion

  • Neil Hodgson

    Neil Hodgson - 2022-05-11
    • labels: --> scintilla, qt, qt6
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2022-05-11

    Committed fix as [842eb1].

     

    Related

    Commit: [842eb1]

  • Neil Hodgson

    Neil Hodgson - 2022-05-22
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB