summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2015-01-07 01:55:29 +0100
committerZolnai Tamás <zolnaitamas2000@gmail.com>2015-01-07 01:55:29 +0100
commit89a81a6610cf316666291750e7300bcd1a97d062 (patch)
tree0e981a6dfe9150f5d1b034e283fc7563432d5bda
parent585ab75a9344e140c876cb7565d3525a62fb8a73 (diff)
fdo#83354: Chart is truncated - moved down outside the margins of the object
Handle the case when the content height is unitialized (0). When content height is 0 it means there is no content (so we don't need to calculate adjustment) or the content height is uninitialized which leads to wrong calculated value. Regression from: cb19042f4395c97d123a27c6960d5e30d666c010 Change-Id: I45570a71f0597847820ce77e8dcec4a5b0c6785d
-rw-r--r--sw/source/core/layout/fly.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 05ed4c9d790b..80773d3f9b0e 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1732,9 +1732,15 @@ void SwFlyFrm::MakeContentPos( const SwBorderAttrs &rAttrs )
Point aNewContentPos;
aNewContentPos = Prt().Pos();
const SdrTextVertAdjust nAdjust = GetFmt()->GetTextVertAdjust().GetValue();
+
if( nAdjust != SDRTEXTVERTADJUST_TOP )
{
- SwTwips nDiff = (Prt().*fnRect->fnGetHeight)() - CalcContentHeight(&rAttrs, nMinHeight, nUL);
+ const SwTwips nContentHeight = CalcContentHeight(&rAttrs, nMinHeight, nUL);
+ SwTwips nDiff = 0;
+
+ if( nContentHeight != 0)
+ nDiff = (Prt().*fnRect->fnGetHeight)() - nContentHeight;
+
if( nDiff > 0 )
{
if( nAdjust == SDRTEXTVERTADJUST_CENTER )