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

matteocam matteo.campanelli at gmail.com
Thu Jul 31 11:48:16 PDT 2014


 include/svx/svdotext.hxx                             |    3 +
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |    3 -
 svx/source/svdraw/svdotextdecomposition.cxx          |   35 ++++++-------------
 svx/source/svdraw/svdotxed.cxx                       |   11 +----
 4 files changed, 18 insertions(+), 34 deletions(-)

New commits:
commit 6ae67a97b82445ab3e1cf0fd5cc3048d2d8308fb
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Thu Jul 31 21:47:38 2014 +0300

    Only non overflown text kept for original box. No copying occurs.
    
    Change-Id: Ic7b1afd8e4617baf69407338fcf233d24dee975e

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index b5fa059..dce4166 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -214,6 +214,9 @@ public:
     const Point& GetTextEditOffset() const { return maTextEditOffset; }
     void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; }
 
+    // FIXME(matteocam) // XXX: move as protected
+    OutlinerParaObject *mpOverflowingText = NULL;
+
 protected:
 
     //FIXME(matteocam)
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index b0d879c..a61e61e 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -307,12 +307,9 @@ namespace drawinglayer
                 }
                 else if( rText.isToBeChained() && !rText.isInEditMode() ) // FIXME(matteocam)
                 {
-                    //bool b = true; // XXX: Chained Text by default!
-                    //if (b)
                     pNew = new SdrChainedTextPrimitive2D(
                                     &rText.getSdrText(),
                                     rText.getOutlinerParaObject() );
-                    //else // end FIXME
                 }
                 else // text in range
                 {
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 67a3fde7..ad2cfe6 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1508,32 +1508,21 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
         const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& rSdrChainedTextPrimitive,
         const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
 {
-    /* BEGIN Experiments */
     // FIXME(matteocam)
-
-    // we use (text) object 0 and 1 for these experiments:
-    // copying text from one to the other.
-
-    SdrTextObj *pNextTextObj;
-    if ( pPage && pPage->GetObjCount() > 1) {
-        pNextTextObj =  dynamic_cast< SdrTextObj * >(
-                                            pPage->GetObj(1) );
-        if ( pNextTextObj == NULL)
-            return;
-    } else {
-        fprintf(stderr, "Make New Object please\n");
-        return;
-    }
-
-    // for debugging purposes:
-    // carry out experiments only when setting b=false from gdb
-    //bool b = true;
-    //if (!b) {
     /* fprintf(stderr, "Object #0 = %p, Object #1 = %p\n",
                     pPage->GetObj(0), pPage->GetObj(1)); */
-    impCopyTextInTextObj(pNextTextObj); // just do it
-    //    return;
-    //}
+
+    //impCopyTextInTextObj(pNextTextObj); // just do it
+
+    // put overflowing text in next text box
+    if (mpOverflowingText != NULL) {
+        SdrTextObj *pNextTextObj = GetNextLinkInChain();
+        //pNextTextObj->SetOutlinerParaObject( mpOverflowingText );
+
+        //SdrOutliner rOutl = pNextTextObj->ImpGetDrawOutliner();
+        //pNextTextObj->BegTextEdit( rOutl );
+        // XXX: Also, will all those calls currently in impCopyTextInTextObj be necessary too?
+    }
 
     drawinglayer::primitive2d::Primitive2DSequence aRetval(0);
     rTarget = aRetval;
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index f6d3fba..ec533bb 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -266,6 +266,9 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
             // set non overflow part of text to current box
             pNewText = rOutl.GetNonOverflowingParaObject();
             pNextText = rOutl.GetOverflowingParaObject();
+            // set overflowing text for SdrChainedTextPrimitive2D
+            mpOverflowingText = pNextText;
+            //SetOverflowingText( pNextText );
 
             // XXX: should this SdrTextObj know "how much text to ask" by CreateParaObject?
             //      No, it must be the editengine (or outliner) to give it since it is
@@ -292,14 +295,6 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
     nStat &= ~EE_CNTRL_AUTOPAGESIZE;
     rOutl.SetControlWord(nStat);
 
-    // sets text to next box
-    if (pNextText != NULL) {
-        SdrTextObj *pNextTextObj = GetNextLinkInChain();
-        pNextTextObj->SetOutlinerParaObject( pNextText );
-        pNextTextObj->BegTextEdit( rOutl );
-        // XXX: Also, will all those calls currently in impCopyTextInTextObj be necessary too?
-    }
-
     mbInEditMode = false;
 }
 


More information about the Libreoffice-commits mailing list