From d601aa4223a5da62a15d834c0145d5efd98336d4 Mon Sep 17 00:00:00 2001 From: "Neil Voss (fourier)" Date: Fri, 24 May 2013 08:19:03 -0500 Subject: [PATCH] autofit fix for bug #42134 Change-Id: I7706bf5c05560d0f13f0a03304b975b8cb47005f --- svx/source/svdraw/svdotext.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 7a662aa..667e40d 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1277,6 +1277,12 @@ void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner, const Size& rTextSize, fFactor = double(rTextSize.Width())/aCurrTextSize.Width(); else 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 + // - taking sqrt scales long paragraphs the best + // - bulleted words will have to go through more iterations + fFactor = std::sqrt(fFactor); sal_uInt16 nCurrStretchX, nCurrStretchY; rOutliner.GetGlobalCharStretching(nCurrStretchX, nCurrStretchY); -- 1.7.11.7