Kaydet (Commit) 89a81a66 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

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:
cb19042f

Change-Id: I45570a71f0597847820ce77e8dcec4a5b0c6785d
üst 585ab75a
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment