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

matteocam matteo.campanelli at gmail.com
Thu Aug 20 15:22:13 PDT 2015


 include/svx/textchain.hxx             |    4 ++++
 svx/source/svdraw/svdotxed.cxx        |    8 +++++++-
 svx/source/svdraw/textchain.cxx       |    1 +
 svx/source/svdraw/textchaincursor.cxx |    1 +
 4 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 911c02aff6d91a6c2d3c08f10e6751a49d42d7cf
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Fri Aug 21 00:21:22 2015 +0200

    Added implementation
    
    Change-Id: I5f199a35fa1e10d11184791ce63f9b35b3728d03

diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 911e006..b7146c1 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -31,6 +31,7 @@ IMPL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 IMPL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
 IMPL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
 IMPL_CHAIN_PROP_INTERFACE(PendingOverflowCheck, bool)
+IMPL_CHAIN_PROP_INTERFACE(SwitchingToNextBox, bool)
 
 
 /* End Definition of Properties Interface */
commit cd6a213f09aebf552624924f210190ffac32b8d3
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Fri Aug 21 00:17:35 2015 +0200

    Don't use SetOutlinerParaObject if we are switching to next box
    
    Change-Id: I685252094e90ee26d99d5852a63cf6dcb3dabaa8

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 91e8211..81421f1 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -120,6 +120,7 @@ class ImpChainLinkProperties
         INIT_CHAIN_PROP(PostChainingSel, ESelection(0,0,0,0));
         INIT_CHAIN_PROP(IsPartOfLastParaInNextLink, false) // XXX: Should come from file
         INIT_CHAIN_PROP(PendingOverflowCheck, false)
+        INIT_CHAIN_PROP(SwitchingToNextBox, false)
     }
 
     private:
@@ -130,6 +131,7 @@ class ImpChainLinkProperties
     DECL_CHAIN_PROP(PostChainingSel, ESelection)
     DECL_CHAIN_PROP(IsPartOfLastParaInNextLink, bool)
     DECL_CHAIN_PROP(PendingOverflowCheck, bool)
+    DECL_CHAIN_PROP(SwitchingToNextBox, bool)
 
 };
 
@@ -158,6 +160,8 @@ class TextChain {
     DECL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
     // return whether there is a pending overflow check (usually when we move cursor after an overflow in the prev link)
     DECL_CHAIN_PROP_INTERFACE(PendingOverflowCheck, bool)
+    // return whether we are currently moving the cursor to the next box (useful to know whether we should prevent SetOutlinerParaObject invocations in SdrTextObj::EndTextEdit)
+    DECL_CHAIN_PROP_INTERFACE(SwitchingToNextBox, bool)
 
 
 
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 0366545..dfcbae8 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -290,7 +290,13 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
         // uses GetCurrentBoundRect() which needs to take the text into account
         // to work correct
         mbInEditMode = false;
-        SetOutlinerParaObject(pNewText);
+        // We don't want broadcasting if we are merely trying to move to next box (this prevents infinite loops)
+        if (IsChainable() && GetTextChain()->GetSwitchingToNextBox(this)) {
+            GetTextChain()->SetSwitchingToNextBox(this, false);
+            NbcSetOutlinerParaObject(pNewText);
+        } else {
+            SetOutlinerParaObject(pNewText);
+        }
     }
 
     /* Beginning Chaining-related code */
diff --git a/svx/source/svdraw/textchaincursor.cxx b/svx/source/svdraw/textchaincursor.cxx
index 87c8f86..23bd8f5 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -173,6 +173,7 @@ void TextChainCursorManager::HandleCursorEvent(
                 pOLV->SetSelection(aNewSel);
                 break;
             case CursorChainingEvent::TO_NEXT_LINK:
+                mpTextObj->GetTextChain()->SetSwitchingToNextBox(mpTextObj, true);
                 impChangeEditingTextObj(pNextLink, aNewSel);
                 break;
             case CursorChainingEvent::TO_PREV_LINK:


More information about the Libreoffice-commits mailing list