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

matteocam matteo.campanelli at gmail.com
Tue Jun 23 16:23:16 PDT 2015


 include/svx/textchain.hxx                   |    4 --
 svx/source/svdraw/svdotext.cxx              |   11 +----
 svx/source/svdraw/svdotextdecomposition.cxx |   55 +---------------------------
 svx/source/svdraw/textchain.cxx             |   13 ------
 4 files changed, 4 insertions(+), 79 deletions(-)

New commits:
commit 3119dabf25d33f805bd8943c2e4857934d97e1a7
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Tue Jun 23 19:22:45 2015 -0400

    Removed references to SetOverwriteOnOverflow
    
    Change-Id: I17271e25f9e5fc8feeafdc1c09916674f1e6d494

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 56b0af8..8032747 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -40,7 +40,6 @@ class ImpChainLinkProperties
 
     ImpChainLinkProperties();
 
-    bool bOverwriteOnOverflow;
     bool bNilChainingEvent;
 };
 
@@ -61,9 +60,6 @@ class TextChain {
     // return whether a paragraph is split between the two links in the argument
     bool GetLinksHaveMergeableFirstPara(SdrTextObj *, SdrTextObj *);
 
-    void SetOverwriteOnOverflow(SdrTextObj *, bool );
-    bool GetOverwriteOnOverflow(SdrTextObj *pTarget);
-
     bool GetNilChainingEvent(SdrTextObj *pTarget);
     void SetNilChainingEvent(SdrTextObj *, bool);
 
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 71fe911..7625ca6 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1994,7 +1994,7 @@ void SdrTextObj::onUnderflowStatusEvent( )
     if (!pNextLink->HasText())
         return;
 
-    //  1) get the text of the other guy and add it to the last paragraph
+    //  Get the text of the other guy and add it to the last paragraph
     // XXX: For now it's not merging anything just adding the while thing as a separate para
     OutlinerParaObject *pNextLinkWholeText = pNextLink->GetOutlinerParaObject();
     if (!pNextLinkWholeText)
@@ -2014,24 +2014,17 @@ void SdrTextObj::onUnderflowStatusEvent( )
     aDrawOutliner.AddText(*pNextLinkWholeText);
 
     bool bIsOverflowFromUnderflow = aDrawOutliner.IsPageOverflow();
+    // Save mpOverflowingText (important for overflow handlers below) // XXX: Change the wayt this is done?
     if (bIsOverflowFromUnderflow)
         mpOverflowingText = aDrawOutliner.GetOverflowingText();
 
     OutlinerParaObject *pNewText = aDrawOutliner.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);
-
     // Set the other box empty so if overflow does not occur we are fine
     pNextLink->NbcSetOutlinerParaObject(aDrawOutliner.GetEmptyParaObject());
 
     // handle overflow
     if (bIsOverflowFromUnderflow) {
-
         // prevents infinite loops when setting text for editing outliner
         GetTextChain()->SetNilChainingEvent(const_cast<SdrTextObj*>(this), true);
         impLeaveOnlyNonOverflowingText(&aDrawOutliner);
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index dcb4ad2..83f9a0c 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -784,9 +784,7 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const
 {
     OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pOutliner);
 
-    //bool bInUnderflow =  GetTextChain()->GetLinkHandlingUnderflow(const_cast<SdrTextObj*>(this));
-    // we need this when we are in editing mode (AND this is not an underflow-caused overflow)
-    if (pEdtOutl != NULL /* && !bInUnderflow */) {
+    if (pEdtOutl != NULL) {
         pEdtOutl->SetText(*pNewText);
     }
     // adds it to current outliner anyway (useful in static decomposition)
@@ -803,38 +801,6 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin
     if (mpOverflowingText == NULL)
         return NULL;
 
-    // XXX: Put following code in a separate method (possibly in another class)
-    if ( GetTextChain()->GetOverwriteOnOverflow(pNextTextObj) )
-    {
-        // We only make three blocks of paragraphs and ignore the rest
-
-        // reset behavior
-        GetTextChain()->SetOverwriteOnOverflow(pNextTextObj, false);
-
-        if (mpOverflowingText->HasOtherParas()) {
-            // Make Para Object from the ending lines (to be appended later)
-            impSetOutlinerToEmptyTxt(pOutliner);
-            Paragraph *pFstPara = pOutliner->GetParagraph(0);
-            pOutliner->SetText(mpOverflowingText->GetEndingLines(), pFstPara);
-            OutlinerParaObject *pLastPara = pOutliner->CreateParaObject();
-
-            // Set heading lines as first paragraph
-            pOutliner->SetText(mpOverflowingText->GetHeadingLines(), pFstPara);
-
-            // Add middle paragraphs
-            if (mpOverflowingText->mpMidParas)
-                pOutliner->AddText(*mpOverflowingText->mpMidParas);
-
-            pOutliner->AddText(*pLastPara);
-        } else {
-            impSetOutlinerToEmptyTxt(pOutliner);
-            Paragraph *pFstPara = pOutliner->GetParagraph(0);
-            pOutliner->SetText(mpOverflowingText->GetEndingLines(), pFstPara);
-        }
-
-        return pOutliner->CreateParaObject();
-    }
-
     OutlinerParaObject *pCurTxt = pNextTextObj->GetOutlinerParaObject();
     pOutliner->SetText(*pCurTxt);
 
@@ -1688,13 +1654,6 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
             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());
@@ -1717,17 +1676,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
         /* Leave only non overflowing text */
         impLeaveOnlyNonOverflowingText(&rOutliner);
 
-        /*OutlinerParaObject *pNewTextCurBox = impGetNonOverflowingParaObject(&rOutliner);
-        // we need this when we are in editing mode
-        // XXX: we use next line just to be sure for now
-        if (pEdtOutl != NULL)
-            pEdtOutl->SetText(*pNewTextCurBox);
-        // adds it to current outliner anyway (useful in static decomposition)
-        rOutliner.SetText(*pNewTextCurBox);
-        NbcSetOutlinerParaObject(pNewTextCurBox);*/
-
-        /* Get chaining outliner  here */
-        // Code adapted from ImpGetDrawOutliner
+        // Initialize Chaining Outliner
         SdrOutliner &rChainingOutl = pModel->GetChainingOutliner(this);
         ImpInitDrawOutliner( rChainingOutl );
         rChainingOutl.SetUpdateMode(true);
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 8266a03..09911f4 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -24,7 +24,6 @@
 ImpChainLinkProperties::ImpChainLinkProperties()
 {
     // give defaults
-    bOverwriteOnOverflow = false;
     bNilChainingEvent = false;
 }
 
@@ -72,12 +71,6 @@ void TextChain::SetNilChainingEvent(SdrTextObj *pTarget, bool bNilChainingEvent)
     pLinkProperties->bNilChainingEvent = bNilChainingEvent;
 }
 
-void TextChain::SetOverwriteOnOverflow(SdrTextObj *pTarget, bool bOverwrite)
-{
-    ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
-    pLinkProperties->bOverwriteOnOverflow = bOverwrite;
-}
-
 ImpChainLinkProperties *TextChain::GetLinkProperties(SdrTextObj *pLink)
 {
     // if the guy does not already have properties in the map make them
@@ -89,12 +82,6 @@ ImpChainLinkProperties *TextChain::GetLinkProperties(SdrTextObj *pLink)
     return maLinkPropertiesMap[aLinkId];
 }
 
-bool TextChain::GetOverwriteOnOverflow(SdrTextObj *pTarget)
-{
-    ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
-    return pLinkProperties->bOverwriteOnOverflow;
-}
-
 ChainLinkId TextChain::GetId(SdrTextObj *pLink) const
 {
     return pLink->GetName();


More information about the Libreoffice-commits mailing list