summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-09-06 17:28:24 +0300
committerTor Lillqvist <tml@iki.fi>2012-09-06 17:32:57 +0300
commit31c1971f8e80a2bf03efef77ba5db32ac7871b12 (patch)
tree41733d743147b6cf1564dda67dac44d6d61bd546 /sw
parentddeeac32bf2af605ee6fd140e9a4e5ee45684317 (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.cxx9
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);