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

matteocam matteo.campanelli at gmail.com
Tue Jul 7 19:57:35 PDT 2015


 include/svx/textchainflow.hxx       |    2 +-
 svx/source/svdraw/textchainflow.cxx |   19 ++++++++++++-------
 2 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 0b4dfe7c504b67f6aabf168bd7c2f21345de6d13
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Tue Jul 7 22:55:58 2015 -0400

    Don't change cursor if UF-induced OF occurs
    
    Change-Id: Ibf3fdee16ca40aed8cde52cc55181fc103b6c81e

diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx
index aa17f1e..70ff6e4 100644
--- a/include/svx/textchainflow.hxx
+++ b/include/svx/textchainflow.hxx
@@ -92,7 +92,7 @@ class TextChainFlow {
     OFlowChainedText *mpOverflChText;
     UFlowChainedText *mpUnderflChText;
 
-
+    bool mbOFisUFinduced;
 };
 
 
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index 74f15a1..2647afa 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -34,6 +34,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
 
     bUnderflow = bOverflow = false;
 
+    mbOFisUFinduced = false;
+
     mpOverflChText = NULL;
     mpUnderflChText = NULL;
 
@@ -73,32 +75,35 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p
 
     bool bIsPageOverflow = pFlowOutl->IsPageOverflow();
 
-    impUpdateCursorEvent(pFlowOutl, bIsPageOverflow);
+    // NOTE: overflow and underflow cannot be both true
+    bOverflow = bIsPageOverflow && mpNextLink;
+    bUnderflow = !bIsPageOverflow &&  mpNextLink && mpNextLink->HasText();
+
+    impUpdateCursorEvent(pFlowOutl, bOverflow);
 
     if (pParamOutl != NULL)
     {
         pFlowOutl->SetUpdateMode(bOldUpdateMode); // XXX: Plausibly should be the prev. state
     }
 
-    // NOTE: overflow and underflow cannot be both true
-    bOverflow = bIsPageOverflow && mpNextLink;
-    bUnderflow = !bIsPageOverflow &&  mpNextLink && mpNextLink->HasText();
-
     // Set (Non)OverflowingTxt here (if any)
     mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl) : NULL;
 
     // Set current underflowing text (if any)
     mpUnderflChText = bUnderflow ? new UFlowChainedText(pFlowOutl) : NULL;
 
+    // To check whether an overflow is underflow induced or not (useful in cursor checking)
+    mbOFisUFinduced = bUnderflow;
+
 }
 
-void TextChainFlow::impUpdateCursorEvent(SdrOutliner *pFlowOutl, bool bIsOverflow)
+void TextChainFlow::impUpdateCursorEvent(SdrOutliner *, bool bIsOverflow)
 {
     // XXX: Current implementation might create problems with UF-
     //      In fact UF causes a
 
 
-    if (bIsOverflow) {
+    if (bIsOverflow && !mbOFisUFinduced) {
         bool bCursorOut = true; // XXX: Should have real check
         if (bCursorOut) {
             GetTextChain()->SetCursorEvent(GetLinkTarget(),


More information about the Libreoffice-commits mailing list