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

matteocam matteo.campanelli at gmail.com
Tue Jul 14 15:28:53 PDT 2015


 svx/source/svdraw/textchainflow.cxx |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 4ab9ea60c4f61e552d11c05ed42c1fa5da1107cb
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Tue Jul 14 18:28:20 2015 -0400

    Translate postChaining position if UF occurs
    
    Change-Id: I74c6d0bbef6dc6cee1fc6a561f6f487e9e3ccd64

diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index 20c26b6..a6b8b1d 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -118,9 +118,6 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p
 
     // To check whether an overflow is underflow induced or not (useful in cursor checking)
     mbOFisUFinduced = bUnderflow;
-
-
-
 }
 
 void TextChainFlow::impUpdateCursorInfo()
@@ -128,11 +125,19 @@ void TextChainFlow::impUpdateCursorInfo()
     // XXX: Maybe we can get rid of mbOFisUFinduced by not allowing handling of more than one event by the same TextChainFlow
     // if this is not an OF triggered during an UF
 
-    mbPossiblyCursorOut = bOverflow /* && !mbOFisUFinduced */; // XXX: Not sure we need !mbOFisUFinduced
-    if (mbPossiblyCursorOut) { // if this is false, mpOverflChText might be NULL
+    mbPossiblyCursorOut = bOverflow;
+
+    if (mbPossiblyCursorOut && !mbOFisUFinduced) { // if this is false, mpOverflChText might be NULL
         maOverflowPosSel = ESelection(mpOverflChText->GetOverflowPointSel());
         // After the chaining event the cursor is where the text from the source box merged with the rest
         maPostChainingSel = ESelection(mpOverflChText->GetInsertionPointSel());
+    } else if(mbPossiblyCursorOut && mbOFisUFinduced) {
+        maOverflowPosSel = ESelection(mpOverflChText->GetOverflowPointSel());
+        ESelection aSelAtUFTime = GetTextChain()->GetPreChainingSel(GetLinkTarget());
+        // Might be an invalid selection if the cursor at UF time was before
+        //   the (UF-induced) Overflowing point but we don't use it in that case
+        maPostChainingSel = ESelection(aSelAtUFTime.nStartPara-maOverflowPosSel.nStartPara,
+                                       aSelAtUFTime.nStartPos-maOverflowPosSel.nStartPos );
     }
 }
 


More information about the Libreoffice-commits mailing list