[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source

matteocam matteo.campanelli at gmail.com
Wed Jun 17 12:59:19 PDT 2015


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

New commits:
commit 9b37e4a0f460fb81758cb62a38f0c664b3b4d34a
Author: matteocam <matteo.campanelli at 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;
 }
 


More information about the Libreoffice-commits mailing list