[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - svx/source

Neil Voss (fourier) vossman77 at yahoo.com
Fri Jun 21 19:05:04 PDT 2013


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

New commits:
commit aaa8271292afd913b9aef20f444ef261928943df
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
    (cherry picked from commit bddf3bba1fa13b57a69f2bd5f7c7f96bb945066d)
    
    Signed-off-by: Thorsten Behrens <tbehrens at suse.com>

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