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

matteocam matteo.campanelli at gmail.com
Thu Jul 23 15:25:15 PDT 2015


 svx/source/svdraw/svdedxv.cxx       |    4 ++--
 svx/source/svdraw/textchainflow.cxx |   11 +++++------
 2 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit e8774374f6a572110ac2eb85330da9cec41a8c4b
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Fri Jul 24 00:24:28 2015 +0200

    Set PostChainingSel even with event UNCHANGED
    
    Change-Id: I5d5133fa46949eab8937e3e83a4e4f53f754f825

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 89e4902..fe7f6c4 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -546,10 +546,10 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
     switch ( pTextChain->GetCursorEvent(pTextObj) ) {
 
             case CursorChainingEvent::UNCHANGED:
-                // Set same selection as before the chaining
+                // Set same selection as before the chaining (which is saved as PostChainingSel)
                 // We need an explicit set because the Outliner is messed up
                 //    after text transfer and otherwise it brings us at arbitrary positions.
-                pOLV->SetSelection(pTextChain->GetPreChainingSel(pTextObj));
+                pOLV->SetSelection(aNewSel);
                 break;
             case CursorChainingEvent::TO_NEXT_LINK:
                 SdrEndTextEdit();
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index 4d6352f..581b5be 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -317,18 +317,16 @@ void EditingTextChainFlow::impSetFlowOutlinerParams(SdrOutliner *pFlowOutl, SdrO
 
 void EditingTextChainFlow::impBroadcastCursorInfo() const
 {
-    bool bCursorOut = false;
+    ESelection aPreChainingSel = GetTextChain()->GetPreChainingSel(GetLinkTarget()) ;
+
+    // Test whether the cursor is out of the box.
+    bool bCursorOut = mbPossiblyCursorOut && maOverflowPosSel.IsLess(aPreChainingSel);
 
     // NOTE: I handled already the stuff for the comments below. They will be kept temporarily till stuff settles down.
     // Possibility: 1) why don't we stop passing the actual event to the TextChain and instead we pass
     //              the overflow pos and mbPossiblyCursorOut
     //              2) We pass the current selection before anything happens and we make impBroadcastCursorInfo compute it.
 
-    if (mbPossiblyCursorOut) {
-        ESelection aPreChainingSel = GetTextChain()->GetPreChainingSel(GetLinkTarget()) ;
-        // Test whether the cursor is out of the box.
-        bCursorOut = maOverflowPosSel.IsLess(aPreChainingSel);
-    }
 
     if (bCursorOut) {
             //maCursorEvent = CursorChainingEvent::TO_NEXT_LINK;
@@ -336,6 +334,7 @@ void EditingTextChainFlow::impBroadcastCursorInfo() const
             GetTextChain()->SetCursorEvent(GetLinkTarget(), CursorChainingEvent::TO_NEXT_LINK);
     } else {
         //maCursorEvent = CursorChainingEvent::UNCHANGED;
+        GetTextChain()->SetPostChainingSel(GetLinkTarget(), aPreChainingSel);
         GetTextChain()->SetCursorEvent(GetLinkTarget(), CursorChainingEvent::UNCHANGED);
     }
 


More information about the Libreoffice-commits mailing list