include/svx/textchain.hxx                   |    4 ++++
 svx/source/svdraw/svdotext.cxx              |    9 ++++++++-
 svx/source/svdraw/svdotextdecomposition.cxx |    5 ++++-
 svx/source/svdraw/textchain.cxx             |   13 +++++++++++++
 4 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit 56c559b69e9549611b2ae5dad67842b60880646b
Author: matteocam <matteo.campane...@gmail.com>
Date:   Fri Jun 19 22:43:26 2015 -0400

    Adding one more state to underflow processing
    
    Change-Id: I130935fc96ea270c7661b324e473ab825547b45b

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index a03bf57..9290f22 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -42,6 +42,7 @@ class ImpChainLinkProperties
 
     bool bOverwriteOnOverflow;
     bool bHandlingUnderflow;
+    bool bNilChainingEvent;
 };
 
 
@@ -67,6 +68,9 @@ class TextChain {
     bool GetLinkHandlingUnderflow(SdrTextObj *pTarget);
     void SetLinkHandlingUnderflow(SdrTextObj *, bool);
 
+    bool GetNilChainingEvent(SdrTextObj *pTarget);
+    void SetNilChainingEvent(SdrTextObj *, bool);
+
     protected:
     LinkPropertiesMap maLinkPropertiesMap;
 };
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 3c394de..51c75a0 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2004,10 +2004,12 @@ void SdrTextObj::onUnderflowStatusEvent( )
     {
         // possibly coming from an overflow
         if (pEdtOutl) {
+            GetTextChain()->SetLinkHandlingUnderflow(this, false);
+            GetTextChain()->SetNilChainingEvent(this, true);
             OutlinerParaObject *pPObj = GetOutlinerParaObject();
             pEdtOutl->SetText(*pPObj);
         }
-        GetTextChain()->SetLinkHandlingUnderflow(this, false);
+
         return;
     }
 
@@ -2147,6 +2149,11 @@ void SdrTextObj::onChainingEvent()
     if (!pEdtOutl)
         return;
 
+    if (GetTextChain()->GetNilChainingEvent(this)) {
+        GetTextChain()->SetNilChainingEvent(this, false);
+        return;
+    }
+
     bool bIsPageOverflow;
 
     if (GetTextChain()->GetLinkHandlingUnderflow(this))
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index a4de09d..d4a3438 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -789,7 +789,10 @@ void 
SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const
         pEdtOutl->SetText(*pNewText);
     // adds it to current outliner anyway (useful in static decomposition)
     pOutliner->SetText(*pNewText);
-    const_cast<SdrTextObj*>(this)->NbcSetOutlinerParaObject(pNewText);
+    if (bInUnderflow) // must make a broadcast to reset underflow (XXX: can I 
reset it from here?)
+        const_cast<SdrTextObj*>(this)->SetOutlinerParaObject(pNewText);
+    else
+        const_cast<SdrTextObj*>(this)->NbcSetOutlinerParaObject(pNewText);
 }
 
 OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner 
*pOutliner, SdrTextObj *pNextTextObj) const
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 3e4f546..1fd7f92 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -26,6 +26,7 @@ ImpChainLinkProperties::ImpChainLinkProperties()
     // give defaults
     bOverwriteOnOverflow = false;
     bHandlingUnderflow = false;
+    bNilChainingEvent = false;
 }
 
 // XXX: All getters in the class assume that the guy is in the chain
@@ -72,6 +73,18 @@ void TextChain::SetLinkHandlingUnderflow(SdrTextObj 
*pTarget, bool bHandlingUnde
     pLinkProperties->bHandlingUnderflow = bHandlingUnderflow;
 }
 
+bool TextChain::GetNilChainingEvent(SdrTextObj *pTarget)
+{
+    ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
+    return pLinkProperties->bNilChainingEvent;
+}
+
+void TextChain::SetNilChainingEvent(SdrTextObj *pTarget, bool 
bNilChainingEvent)
+{
+    ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
+    pLinkProperties->bNilChainingEvent = bNilChainingEvent;
+}
+
 void TextChain::SetOverwriteOnOverflow(SdrTextObj *pTarget, bool bOverwrite)
 {
     ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to