[Libreoffice-commits] core.git: svx/source

Neil Voss (fourier) vossman77 at yahoo.com
Fri Jun 21 18:54:29 PDT 2013


 svx/source/svdraw/svdotext.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit bddf3bba1fa13b57a69f2bd5f7c7f96bb945066d
Author: Neil Voss (fourier) <vossman77 at yahoo.com>
Date:   Fri May 24 08:19:03 2013 -0500

    fdo#42134 FORMATTING: Autofit does not work properly on long texts
    
    Change-Id: I18e314913122ffbc15659ced9d1b746d10ccc17c

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index efb5227..387a561 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1284,6 +1284,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);


More information about the Libreoffice-commits mailing list