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

matteocam matteo.campanelli at gmail.com
Thu Jul 17 17:18:04 PDT 2014


 editeng/source/editeng/impedit3.cxx         |    4 +--
 include/svx/svdotext.hxx                    |    1 
 svx/source/svdraw/svdotext.cxx              |   35 +++++++++++++++++++++++++++-
 svx/source/svdraw/svdotextdecomposition.cxx |   27 ---------------------
 4 files changed, 37 insertions(+), 30 deletions(-)

New commits:
commit 9e06714013f1c1f3f66dd14eac15d51d48d07e4a
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Fri Jul 18 02:16:45 2014 +0200

    SdrTextObj::ImpChainText makes a copy of text
    
    Change-Id: Ic44fa0198759fc811c06035d306b91aec7670061

diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 48c2450..8d9e41b 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -355,8 +355,8 @@ void ImpEditEngine::FormatFullDoc()
 
 bool ImpEditEngine::IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const
 {
-    const bool bTextGrowX=(aStatus & EE_STAT_TEXTWIDTHCHANGED) !=0;
-    const bool bTextGrowY=(aStatus & EE_STAT_TEXTHEIGHTCHANGED) !=0;
+    const bool bTextGrowX=(aStatus.GetControlWord() & EE_STAT_TEXTWIDTHCHANGED) !=0;
+    const bool bTextGrowY=(aStatus.GetControlWord() & EE_STAT_TEXTHEIGHTCHANGED) !=0;
 
     const bool bPageExpansionX = ( aPrevPaperSize.Width() != 0 ) && // XXX
                             ( aCurPaperSize.Width() > aPrevPaperSize.Width() );
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 22fced9..93a48cb 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -269,6 +269,7 @@ private:
                                        Rectangle&       rPaintRect,
                                        Fraction&        aFitXKorreg ) const;
     void ImpAutoFitText( SdrOutliner& rOutliner ) const;
+    void ImpChainText() const;
     static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting );
     SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
     SVX_DLLPRIVATE void ImpLinkAnmeldung();
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index b24d90d..008ebcf 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1925,13 +1925,46 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus )
             ImpAutoFitText(*pEdtOutl);
             mbInDownScale = false;
         }
-        else if (IsChained() && pEditStatus->IsOverflow())
+        else if (/* TODO: IsChained() && */ pEditStatus->IsPageOverflow())
         {
 
         }
     }
 }
 
+
+void SdrTextObj::ImpChainText() 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) {
+    impCopyTextInTextObj(pNextTextObj); // just do it
+    //    return;
+    //}
+
+    /* END Experiments */
+}
+
+
+
 /** returns the currently active text. */
 SdrText* SdrTextObj::getActiveText() const
 {
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 59f5acc..9253a9a 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -809,32 +809,6 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive(
     const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive,
     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) {
-    impCopyTextInTextObj(pNextTextObj); // just do it
-    //    return;
-    //}
-
-    /* END Experiments */
 
     // decompose matrix to have position and size of text
     basegfx::B2DVector aScale, aTranslate;
@@ -1523,5 +1497,4 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL
     }
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list