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

matteocam matteo.campanelli at gmail.com
Mon Jul 13 09:01:51 PDT 2015


 editeng/source/outliner/overflowingtxt.cxx |    6 ++++++
 include/editeng/overflowingtxt.hxx         |    2 ++
 include/svx/textchainflow.hxx              |    2 ++
 svx/source/svdraw/textchainflow.cxx        |   10 ++++++++++
 4 files changed, 20 insertions(+)

New commits:
commit 92a56f1fb97e3a095fa2702ba6970b056fef7bf6
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Mon Jul 13 12:01:16 2015 -0400

    Add TextChainFlow info for merging paras
    
    Change-Id: Ieb1f951e083c11b9c18a9a15180e8aff7ef02db7

diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx
index 9b6da0a..45e8f51 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -144,6 +144,12 @@ OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p
     return mpNonOverflowingTxt->ToParaObject(pOutliner);
 }
 
+bool OFlowChainedText::IsLastParaInterrupted() const
+{
+    return mpNonOverflowingTxt->IsLastParaInterrupted();
+}
+
+
 // classes UFlowChainedText
 
 UFlowChainedText::UFlowChainedText(Outliner *pOutl)
diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx
index 449ca5a..2f63cea 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -89,6 +89,8 @@ class EDITENG_DLLPUBLIC OFlowChainedText {
         ESelection GetInsertionPointSel() const;
         ESelection GetOverflowPointSel() const;
 
+        bool IsLastParaInterrupted() const;
+
     protected:
         void impSetOutlinerToEmptyTxt(Outliner *);
 
diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx
index f96ce59..8e8ad62 100644
--- a/include/svx/textchainflow.hxx
+++ b/include/svx/textchainflow.hxx
@@ -104,6 +104,8 @@ class TextChainFlow {
     OFlowChainedText *mpOverflChText;
     UFlowChainedText *mpUnderflChText;
 
+    bool mbMustMergeParaAmongLinks;
+
 };
 
 
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx
index 4c48266..50bddb5 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -40,6 +40,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
 
     maCursorEvent = CursorChainingEvent::NULL_EVENT;
     mbPossiblyCursorOut = false;
+
+    mbMustMergeParaAmongLinks = false;
 }
 
 
@@ -100,6 +102,14 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p
     // To check whether an overflow is underflow induced or not (useful in cursor checking)
     mbOFisUFinduced = bUnderflow;
 
+    // Save old state and update new
+    mbMustMergeParaAmongLinks = GetTextChain()->GetIsPartOfLastParaInNextLink(mpTargetLink);
+
+    if (bOverflow)
+        GetTextChain()->SetIsPartOfLastParaInNextLink(mpTargetLink, mpOverflChText->IsLastParaInterrupted());
+    else // Overflows determine merging or not. If no OF, just merge everything next time.
+        GetTextChain()->SetIsPartOfLastParaInNextLink(mpTargetLink, true);
+
 }
 
 void TextChainFlow::impUpdateCursorInfo()


More information about the Libreoffice-commits mailing list