summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdotext.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 47696fd28204..104f48bee47d 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1307,9 +1307,16 @@ void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner, const Size& rTextSize,
const Size aCurrTextSize = rOutliner.CalcTextSizeNTP();
double fFactor(1.0);
if( bIsVerticalWriting )
- fFactor = double(rTextSize.Width())/aCurrTextSize.Width();
- else
+ {
+ if (aCurrTextSize.Width() != 0)
+ {
+ fFactor = double(rTextSize.Width())/aCurrTextSize.Width();
+ }
+ }
+ else if (aCurrTextSize.Height() != 0)
+ {
fFactor = double(rTextSize.Height())/aCurrTextSize.Height();
+ }
// fFactor scales in both x and y directions
// - this is fine for bulleted words
// - but it scales too much for a long paragraph