[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/source

Zolnai Tamás zolnaitamas2000 at gmail.com
Wed Jan 7 05:21:30 PST 2015


 sw/source/core/layout/fly.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 6d62f6484c0ecb4a09332ad442f5cc53e6da9401
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Jan 7 02:43:48 2015 +0100

    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/13784
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 554144b..b8e8d76 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1737,7 +1737,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 )


More information about the Libreoffice-commits mailing list