qtbug-69310.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From fcba9fa861574f33e1d2e54d8c8d6da8062927cd Mon Sep 17 00:00:00 2001
  2. From: Allan Sandfeld Jensen <allan.jensen@qt.io>
  3. Date: Wed, 23 Jan 2019 10:42:12 +0100
  4. Subject: Fix regression in QPlainTextEdit updating
  5. It was incorrectly counting a block having more than one line as having
  6. changed visibility.
  7. Fixes: QTBUG-69310
  8. Change-Id: I502cda1d3e8a4efb1c14122353cc0a4731d8581c
  9. Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
  10. ---
  11. src/widgets/widgets/qplaintextedit.cpp | 7 ++++---
  12. 1 file changed, 4 insertions(+), 3 deletions(-)
  13. diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
  14. index d6f6a364a8..57f2dec8f7 100644
  15. --- a/src/widgets/widgets/qplaintextedit.cpp
  16. +++ b/src/widgets/widgets/qplaintextedit.cpp
  17. @@ -312,10 +312,11 @@ void QPlainTextDocumentLayout::documentChanged(int from, int charsRemoved, int c
  18. QTextBlock block = changeStartBlock;
  19. do {
  20. block.clearLayout();
  21. - const int lineCount = block.isVisible() ? 1 : 0;
  22. - if (block.lineCount() != lineCount) {
  23. + if (block.isVisible()
  24. + ? (block.lineCount() == 0)
  25. + : (block.lineCount() > 0)) {
  26. blockVisibilityChanged = true;
  27. - block.setLineCount(lineCount);
  28. + block.setLineCount(block.isVisible() ? 1 : 0);
  29. }
  30. if (block == changeEndBlock)
  31. break;
  32. --
  33. cgit v1.2.1