diff options
-rw-r--r-- | include/tools/gen.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/chart/converterbase.cxx | 16 | ||||
-rw-r--r-- | tools/source/generic/gen.cxx | 7 |
3 files changed, 16 insertions, 9 deletions
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx index 9dea74be4caa..b8ee06c8031e 100644 --- a/include/tools/gen.hxx +++ b/include/tools/gen.hxx @@ -457,7 +457,7 @@ public: /// Returns the difference between right and left, assuming the range includes one end, but not the other. long getWidth() const; /// Returns the difference between bottom and top, assuming the range includes one end, but not the other. - long getHeight() const { return nBottom - nTop; } + long getHeight() const; /// Set the left edge of the rectangle to x, preserving the width void setX( long x ); /// Set the top edge of the rectangle to y, preserving the height diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index 7faeb36576d1..7f12741c568e 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -350,18 +350,18 @@ bool LayoutConverter::calcAbsRectangle( awt::Rectangle& orRect ) const { if( !mrModel.mbAutoLayout ) { - awt::Size rChartSize=getChartSize(); - if( (rChartSize.Width < 0) || (rChartSize.Height < 0) ) + awt::Size aChartSize=getChartSize(); + if( aChartSize.Width <= 0 || aChartSize.Height <= 0 ) { - rChartSize.Width = 16000; - rChartSize.Height = 9000; + aChartSize.Width = 16000; + aChartSize.Height = 9000; } - orRect.X = lclCalcPosition( rChartSize.Width, mrModel.mfX, mrModel.mnXMode ); - orRect.Y = lclCalcPosition( rChartSize.Height, mrModel.mfY, mrModel.mnYMode ); + orRect.X = lclCalcPosition( aChartSize.Width, mrModel.mfX, mrModel.mnXMode ); + orRect.Y = lclCalcPosition( aChartSize.Height, mrModel.mfY, mrModel.mnYMode ); if( (orRect.X >= 0) && (orRect.Y >= 0) ) { - orRect.Width = lclCalcSize( orRect.X, rChartSize.Width, mrModel.mfW, mrModel.mnWMode ); - orRect.Height = lclCalcSize( orRect.Y, rChartSize.Height, mrModel.mfH, mrModel.mnHMode ); + orRect.Width = lclCalcSize( orRect.X, aChartSize.Width, mrModel.mfW, mrModel.mnWMode ); + orRect.Height = lclCalcSize( orRect.Y, aChartSize.Height, mrModel.mfH, mrModel.mnHMode ); return (orRect.Width > 0) && (orRect.Height > 0); } } diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 5755929bd502..0a488a4e51b4 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -308,4 +308,11 @@ long tools::Rectangle::getWidth() const { return nRight == RECT_EMPTY ? 0 : nRight - nLeft; } + +/// Returns the difference between bottom and top, assuming the range includes one end, but not the other. +long tools::Rectangle::getHeight() const +{ + return nBottom == RECT_EMPTY ? 0 : nBottom - nTop; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |