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

matteocam matteo.campanelli at gmail.com
Tue Jun 30 09:05:44 PDT 2015


 include/svx/textchainflow.hxx       |    1 +
 svx/source/svdraw/svdotext.cxx      |    8 ++++++--
 svx/source/svdraw/textchainflow.cxx |    6 +-----
 3 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 878920775d8a436c16e0553b20783b70b278231c
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Tue Jun 30 12:04:48 2015 -0400

    Prevent recursive underflow/overflow calls (for the same object)
    
    Change-Id: I76705d41da739e327be0c9a67bbbb245da055b77

diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx
index 3215194..ce6d728 100644
--- a/include/svx/textchainflow.hxx
+++ b/include/svx/textchainflow.hxx
@@ -94,6 +94,7 @@ class TextChainFlow {
 };
 
 
+// NOTE: EditingTextChainFlow might be strongly coupled with behavior in SdrTextObj::onChainingEvent
 class EditingTextChainFlow : public TextChainFlow
 {
     public:
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index fbb76d0..948428c 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1975,7 +1975,7 @@ void SdrTextObj::onChainingEvent()
 
     // This is true during an underflow-caused overflow (with pEdtOutl->SetText())
     if (GetTextChain()->GetNilChainingEvent(this)) {
-        GetTextChain()->SetNilChainingEvent(this, false);
+
         return;
     }
 
@@ -1985,6 +1985,8 @@ void SdrTextObj::onChainingEvent()
     EditingTextChainFlow aTxtChainFlow(this);
     aTxtChainFlow.CheckForFlowEvents(pEdtOutl);
 
+    // We prevent to trigger further handling of overflow/underflow for this SdrTextObj
+    GetTextChain()->SetNilChainingEvent(this, true);
 
     if (aTxtChainFlow.IsOverflow()) {
         fprintf(stderr, "[CHAINING] Overflow going on\n");
@@ -2000,11 +2002,13 @@ void SdrTextObj::onChainingEvent()
         if (bIsOverflowFromUnderflow) {
             fprintf(stderr, "[CHAINING] Overflow going on (underflow induced)\n");
             // prevents infinite loops when setting text for editing outliner
-            GetTextChain()->SetNilChainingEvent(const_cast<SdrTextObj*>(this), true);
+
 
             aTxtChainFlow.ExecuteOverflow(&aDrawOutliner, &aDrawOutliner);
+
         }
     }
+    GetTextChain()->SetNilChainingEvent(this, false);
 }
 
 
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index b3dcd80..93bb2f1 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -122,9 +122,7 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
     OutlinerParaObject *pNextLinkWholeText = mpNextLink->GetOutlinerParaObject();
 
     // making whole text
-    OutlinerParaObject *pCurText;   // XXX: at next line we have editing outliner in editing version
-    //pCurText = pOutl->CreateParaObject();
-
+    OutlinerParaObject *pCurText;
     // We saved this text already
     pCurText = mpUnderflowingPObj;
 
@@ -183,8 +181,6 @@ OutlinerParaObject *TextChainFlow::impGetNonOverflowingParaObject(SdrOutliner *p
     return mpOverflChText->CreateNonOverflowingParaObject(pOutliner);
 }
 
-
-
 SdrTextObj *TextChainFlow::GetLinkTarget() const
 {
     return mpTargetLink;


More information about the Libreoffice-commits mailing list