git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53308
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
/// Find a suitable wrap position.
bool wxRichTextParagraph::FindWrapPosition(const wxRichTextRange& range, wxDC& dc, int availableSpace, long& wrapPosition, wxArrayInt* partialExtents)
{
/// Find a suitable wrap position.
bool wxRichTextParagraph::FindWrapPosition(const wxRichTextRange& range, wxDC& dc, int availableSpace, long& wrapPosition, wxArrayInt* partialExtents)
{
+ if (range.GetLength() <= 0)
+ return false;
+
// Find the first position where the line exceeds the available space.
wxSize sz;
long breakPosition = range.GetEnd();
// Find the first position where the line exceeds the available space.
wxSize sz;
long breakPosition = range.GetEnd();
{
int widthFromStartOfThisRange = (*partialExtents)[i - GetRange().GetStart()] - widthBefore;
{
int widthFromStartOfThisRange = (*partialExtents)[i - GetRange().GetStart()] - widthBefore;
- if (widthFromStartOfThisRange >= availableSpace)
+ if (widthFromStartOfThisRange > availableSpace)
{
breakPosition = i-1;
break;
{
breakPosition = i-1;
break;