diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-09-06 17:28:24 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-09-06 17:32:57 +0300 |
commit | 31c1971f8e80a2bf03efef77ba5db32ac7871b12 (patch) | |
tree | 41733d743147b6cf1564dda67dac44d6d61bd546 /sw | |
parent | ddeeac32bf2af605ee6fd140e9a4e5ee45684317 (diff) |
Avoid assertion failure when rendering thumbnails of some pages
Change-Id: I5331ae27d8e492a8094e1904ba3af143c7c1a0e5
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 0af0b447774f..b3efb8826a1d 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4614,6 +4614,15 @@ lcl_MakeBorderLine(SwRect const& rRect, aEnd.setY(fStartY); } + // WHen rendering to very small (virtual) devices, like when producing + // page thumbnails in a mobile device app, the line geometry can end up + // bogus (negative width or height), so just ignore such border lines. + // Otherwise we will run into assertions later in lcl_TryMergeBorderLine() + // at least. + if (aEnd.getX() < aStart.getX() || + aEnd.getY() < aStart.getY()) + return; + double const nExtentLeftStart = (isLeftOrTopBorder == isVertical) ? lcl_GetExtent(pStartNeighbour, 0) : lcl_GetExtent(0, pStartNeighbour); |