editeng/source/editeng/impedit3.cxx         |    8 +++++++-
 svx/source/svdraw/svdotextdecomposition.cxx |    4 +++-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit f43791f1a6e6f3d978eeb46479b3a26b51b53ec6
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Jun 15 15:47:45 2015 -0400

    No overflow if only empty para (prevents infinite loop)
    
    Change-Id: Ic11b127239542bf3cd8fde725ff9d88db4a29928

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 91c6d58..13e6030 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -592,7 +592,13 @@ void ImpEditEngine::CheckPageOverflow()
 
     sal_uInt32 nTxtHeight = CalcTextHeight(NULL);
 
-    if (nTxtHeight > nBoxHeight)
+    sal_uInt32 nParaCount = GetParaPortions().Count();
+    sal_uInt32 nFirstLineCount = GetLineCount(0);
+    bool bOnlyOneEmptyPara = (nParaCount == 1) &&
+                            (nFirstLineCount == 1) &&
+                            (GetLineLen(0,0) == 0);
+
+    if (nTxtHeight > nBoxHeight && !bOnlyOneEmptyPara)
     {
         // which paragraph is the first to cause higher size of the box?
         ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for 
horizontal text
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 87e0559..45edac2 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -765,10 +765,12 @@ OutlinerParaObject 
*SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut
         if (pNonOverflowingTxt->mpHeadParas != NULL) {
             pOutliner->SetText(*pNonOverflowingTxt->mpHeadParas);
             pOutliner->AddText(*pPObj);
-         } else { // set empty paraObj
+         } else  if (pNonOverflowingTxt->mPreOverflowingTxt != "") { // only 
preoverflowing txt
             //OutlinerParaObject *pEmptyPObj = pOutliner->GetEmptyParaObject();
             //pOutliner->SetText(*pEmptyPObj);
             pOutliner->SetText(*pPObj);
+        } else { // no text // This case is redundant but it doesn't hurt for 
now
+            pOutliner->Clear();
         }
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to