summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2015-01-07 02:14:33 +0100
committerAndras Timar <andras.timar@collabora.com>2015-01-08 15:09:32 +0100
commitfd98ffb57d5bac1b63abcb46bf373ba49e2cf004 (patch)
treed3ed97ed4dfc71954680d0d10d7f165aabfde644 /sw
parent2633c8762a87c8f71c438267a64e8895338cab7e (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 (cherry picked from commit 89a81a6610cf316666291750e7300bcd1a97d062) Change-Id: I45570a71f0597847820ce77e8dcec4a5b0c6785d Reviewed-on: https://gerrit.libreoffice.org/13783 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 32dce67106c9f6ddbb91daf4dd84308974ebe309)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/fly.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 6c541c747f7c..2a119b56a0a9 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1705,7 +1705,12 @@ void SwFlyFrm::MakeContentPos( const SwBorderAttrs &rAttrs )
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 )