diff options
-rw-r--r-- | doc/ScintillaHistory.html | 3 | ||||
-rw-r--r-- | src/EditView.cxx | 14 |
2 files changed, 11 insertions, 6 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 0b78539ee..b8a1ad66b 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -588,6 +588,9 @@ Fix bad background colour for additional, secondary, and inactive selections when printing. <a href="https://sourceforge.net/p/scintilla/bugs/2335/">Bug #2335</a>. </li> + <li> + Fix crash when printing on Win32 in bidirectional mode with a non-empty selection. + </li> </ul> <h3> <a href="https://www.scintilla.org/scintilla523.zip">Release 5.2.3</a> diff --git a/src/EditView.cxx b/src/EditView.cxx index c24adeb12..5a793f16c 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1980,12 +1980,14 @@ static void DrawTranslucentSelection(Surface *surface, const EditModel &model, c const ScreenLine screenLine(ll, subLine, vsDraw, rcLine.right, tabWidthMinimumPixels); std::unique_ptr<IScreenLineLayout> slLayout = surface->Layout(&screenLine); - const std::vector<Interval> intervals = slLayout->FindRangeIntervals(selectionStart, selectionEnd); - for (const Interval &interval : intervals) { - const XYPOSITION rcRight = interval.right + xStart; - const XYPOSITION rcLeft = interval.left + xStart; - const PRectangle rcSelection(rcLeft, rcLine.top, rcRight, rcLine.bottom); - surface->FillRectangleAligned(rcSelection, selectionBack); + if (slLayout) { + const std::vector<Interval> intervals = slLayout->FindRangeIntervals(selectionStart, selectionEnd); + for (const Interval &interval : intervals) { + const XYPOSITION rcRight = interval.right + xStart; + const XYPOSITION rcLeft = interval.left + xStart; + const PRectangle rcSelection(rcLeft, rcLine.top, rcRight, rcLine.bottom); + surface->FillRectangleAligned(rcSelection, selectionBack); + } } if (portion.end.VirtualSpace()) { |