svx/source/svdraw/svdotextdecomposition.cxx |   39 +++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 06ee5333d625bc56a7401d824dc6df6490cdde26
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Jun 22 16:08:58 2015 -0400

    Underflow handling in static mode
    
    Change-Id: I2540ee4d5f26e7515bcedd127f6464ef81591443

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index caa361e..37c2384 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1667,7 +1667,44 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
     // Sets original text
     rOutliner.SetText(*pOutlinerParaObject);
 
-    /* Begin overflow handling */
+    /* Begin underflow handling */
+
+    bool bIsPageUnderflow = rOutliner.IsPageOverflow() && !IsInEditMode();
+    if (bIsPageUnderflow) {
+
+        SdrTextObj *pNextLink = GetNextLinkInChain();
+        if (pNextLink && pNextLink->HasText()) {
+            OutlinerParaObject *pNextLinkWholeText = 
pNextLink->GetOutlinerParaObject();
+
+            // making whole text
+
+            OutlinerParaObject *pCurText;
+            pCurText = rOutliner.CreateParaObject(); // XXX: this is editing 
outliner in editing version
+
+            // NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox)
+            rOutliner.SetText(*pCurText);
+            rOutliner.AddText(*pNextLinkWholeText);
+            OutlinerParaObject *pNewText = rOutliner.CreateParaObject();
+
+            // 2) Set the text of the next guy to what is left
+            // (since this happens automatically by overflow we just "order 
to" reset the destination box's text)
+            GetTextChain()->SetOverwriteOnOverflow(pNextLink, true);
+
+            // We make sure we don't handle underflow while handling underflow
+            //GetTextChain()->SetLinkHandlingUnderflow(this, true); // we 
don't need this in static decomp.
+
+            // Set the other box empty so if overflow does not occur we are 
fine
+            if (!GetPreventChainable())
+                
pNextLink->NbcSetOutlinerParaObject(rOutliner.GetEmptyParaObject());
+
+            const_cast<SdrTextObj*>(this)->NbcSetOutlinerParaObject(pNewText);
+        }
+    } // You might be done at this point, unless there is an overflow and 
that's handled in std way.
+
+    /* End underflow handling */
+
+
+    /* Begin overflow handling */ // might be caused from underflow handling 
above
 
     // If overflow occurs we have to cut the text at the right point
     // If in edit mode ImpEditEngine should have taken care of this
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to