svx/source/svdraw/svdotext.cxx |   68 ++++++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 31 deletions(-)

New commits:
commit 9b37e4a0f460fb81758cb62a38f0c664b3b4d34a
Author: matteocam <matteo.campane...@gmail.com>
Date:   Wed Jun 17 15:56:59 2015 -0400

    Drafted status change logic to support underflow
    
    Change-Id: I8996146dcc3d6c08cdff7c673f43cca829de39a6

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index e67f5e6..173722b 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1966,39 +1966,20 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 
 void SdrTextObj::onOverflowStatusEvent( )
 {
-    if (!IsChainable())
-        return;
-
-    if (!pEdtOutl)
-        return;
-
-    bool bIsPageOverflow = pEdtOutl->IsPageOverflow();
-
-    if ( GetNextLinkInChain() != NULL ) // is there anything to transfer text 
to?
-    {
-        // set whether there is need for chaining
-        // (used in EndTextEdit to crop the overflowing part)
-        // XXX: might be removed later when we remove text in real time
-        SetToBeChained( bIsPageOverflow );
-        fprintf(stderr, "[CHAINING] Need for Chaining is %s\n",
-            bIsPageOverflow ? "TRUE" : "FALSE");
-
-        // Pushes text in next link on the fly
-        if ( bIsPageOverflow ) {
-            SdrOutliner &aDrawOutliner = ImpGetDrawOutliner();
-            if (pEdtOutl != NULL)
-                mpOverflowingText = pEdtOutl->GetOverflowingText();
-            else
-                mpOverflowingText = aDrawOutliner.GetOverflowingText();
+    // Pushes text in next link on the fly
+    if ( mbToBeChained ) {
+        SdrOutliner &aDrawOutliner = ImpGetDrawOutliner();
+        if (pEdtOutl != NULL)
+            mpOverflowingText = pEdtOutl->GetOverflowingText();
+        else
+            mpOverflowingText = aDrawOutliner.GetOverflowingText();
 
-            SdrTextObj *pNextTextObj = GetNextLinkInChain();
+        SdrTextObj *pNextTextObj = GetNextLinkInChain();
 
-            impLeaveOnlyNonOverflowingText(&aDrawOutliner);
-
-            // Transfer overflowing text
-            impMoveChainedTextToNextLink(&aDrawOutliner, pNextTextObj);
-        }
+        impLeaveOnlyNonOverflowingText(&aDrawOutliner);
 
+        // Transfer overflowing text
+        impMoveChainedTextToNextLink(&aDrawOutliner, pNextTextObj);
     }
 }
 
@@ -2097,7 +2078,32 @@ bool SdrTextObj::GetPreventChainable() const
 
 IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText)
 {
-    onOverflowStatusEvent();
+    if (!IsChainable() || GetNextLinkInChain() == NULL)
+        return;
+
+    if (!pEdtOutl)
+        return;
+
+    bool bIsPageOverflow = pEdtOutl->IsPageOverflow();
+
+    // Propagates the need for change
+    SetToBeChained( bIsPageOverflow );
+    fprintf(stderr, "[CHAINING] Need for Chaining is %s\n",
+        bIsPageOverflow ? "TRUE" : "FALSE");
+
+    if ( bIsPageOverflow ) {
+        onOverflowStatusEvent();
+    } else {
+        // Underflow:
+        /*
+         *
+         * If there is no overflow and other guy has text then:
+         * 1) get the text of the other guy and add it to the last paragraph
+         * (if the paragraphs are to be merged, no otherwise).
+         * 2) Set the text of the other guy to what is left
+         *
+        */
+    }
     return 0;
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to