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

matteocam matteo.campanelli at gmail.com
Tue Jun 9 13:43:26 PDT 2015


 include/svx/sdr/attribute/sdrtextattribute.hxx       |    6 +++-
 svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx       |    1 
 svx/source/sdr/attribute/sdrtextattribute.cxx        |   25 +++++++++++++------
 svx/source/sdr/primitive2d/sdrattributecreator.cxx   |    7 +++--
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |    2 -
 5 files changed, 29 insertions(+), 12 deletions(-)

New commits:
commit c23e43a3578b0c150d21ac3dd17ed393df8e5e09
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Tue Jun 9 16:42:54 2015 -0400

    Definition of isChainable and its usage in making SdrChainedTextPrim-s
    
    Change-Id: Ibac6af0c885f0a953635b115eb78ff442c44cdab

diff --git a/include/svx/sdr/attribute/sdrtextattribute.hxx b/include/svx/sdr/attribute/sdrtextattribute.hxx
index 624c5f0..c83faa6 100644
--- a/include/svx/sdr/attribute/sdrtextattribute.hxx
+++ b/include/svx/sdr/attribute/sdrtextattribute.hxx
@@ -74,9 +74,10 @@ namespace drawinglayer
                 bool bInEditMode,
                 bool bFixedCellHeight,
                 bool bWrongSpell,
-                bool bToBeChained);
+                bool bToBeChained,
+                bool bChainable);
             SdrTextAttribute();
-            SdrTextAttribute(bool bIsToBeChained); // special treatment for text chaining
+            //SdrTextAttribute(bool bIsToBeChained); // special treatment for text chaining
             SdrTextAttribute(const SdrTextAttribute& rCandidate);
             SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate);
             ~SdrTextAttribute();
@@ -99,6 +100,7 @@ namespace drawinglayer
             bool isInEditMode() const;
             bool isFixedCellHeight() const;
             bool isToBeChained() const;
+            bool isChainable() const;
             const SdrFormTextAttribute& getSdrFormTextAttribute() const;
             sal_Int32 getTextLeftDistance() const;
             sal_Int32 getTextUpperDistance() const;
diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
index db1baec..3646d99 100644
--- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
+++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -353,6 +353,7 @@ namespace drawinglayer
 
             // get data
             const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
+            bool getWordWrap() const { return true; } // XXX: Hack! Should have a proper implementation
 
             // compare operator
             virtual bool operator==(const BasePrimitive2D& rPrimitive) const SAL_OVERRIDE;
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index dd1eafe..3a237b9 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -70,6 +70,7 @@ namespace drawinglayer
             bool                                mbFixedCellHeight : 1;
             bool                                mbWrongSpell : 1;
             bool                                mbToBeChained : 1;
+            bool                                mbChainable : 1;
 
         public:
             ImpSdrTextAttribute(
@@ -91,7 +92,8 @@ namespace drawinglayer
                 bool bInEditMode,
                 bool bFixedCellHeight,
                 bool bWrongSpell,
-                bool bToBeChained)
+                bool bToBeChained,
+                bool bChainable)
             :   mnRefCount(0),
                 mpSdrText(pSdrText),
                 mpOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
@@ -112,7 +114,8 @@ namespace drawinglayer
                 mbInEditMode(bInEditMode),
                 mbFixedCellHeight(bFixedCellHeight),
                 mbWrongSpell(bWrongSpell),
-                mbToBeChained(bToBeChained)
+                mbToBeChained(bToBeChained),
+                mbChainable(bChainable)
             {
                 if(pSdrText)
                 {
@@ -151,7 +154,8 @@ namespace drawinglayer
                 mbInEditMode(false),
                 mbFixedCellHeight(false),
                 mbWrongSpell(false),
-                mbToBeChained(false)
+                mbToBeChained(false),
+                mbChainable(false)
             {
             }
 
@@ -184,6 +188,7 @@ namespace drawinglayer
             bool isFixedCellHeight() const { return mbFixedCellHeight; }
             bool isWrongSpell() const { return mbWrongSpell; }
             bool isToBeChained() const { return mbToBeChained; }
+            bool isChainable() const { return mbChainable; }
             const SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
             sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
             sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
@@ -282,12 +287,13 @@ namespace drawinglayer
             bool bInEditMode,
             bool bFixedCellHeight,
             bool bWrongSpell,
-            bool bIsToBeChained)
+            bool bIsToBeChained,
+            bool bChainable)
         :   mpSdrTextAttribute(new ImpSdrTextAttribute(
                 &rSdrText, rOutlinerParaObject, eFormTextStyle, aTextLeftDistance, aTextUpperDistance,
                 aTextRightDistance, aTextLowerDistance, aSdrTextHorzAdjust, aSdrTextVertAdjust, bContour,
                 bFitToSize, bAutoFit, bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell,
-                bIsToBeChained))
+                bIsToBeChained, bChainable))
         {
         }
 
@@ -296,14 +302,14 @@ namespace drawinglayer
         {
             mpSdrTextAttribute->mnRefCount++;
         }
-
+/*
         SdrTextAttribute::SdrTextAttribute(bool bIsToBeChained)
         :   mpSdrTextAttribute(ImpSdrTextAttribute::get_global_default())
         {
             mpSdrTextAttribute->mbToBeChained = bIsToBeChained;
             mpSdrTextAttribute->mnRefCount++;
         }
-
+*/
         SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
         :   mpSdrTextAttribute(rCandidate.mpSdrTextAttribute)
         {
@@ -417,6 +423,11 @@ namespace drawinglayer
             return mpSdrTextAttribute->isToBeChained();
         }
 
+        bool SdrTextAttribute::isChainable() const
+        {
+            return mpSdrTextAttribute->isChainable();
+        }
+
         const SdrFormTextAttribute& SdrTextAttribute::getSdrFormTextAttribute() const
         {
             return mpSdrTextAttribute->getSdrFormTextAttribute();
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index d13bb39..a5c68e2 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -523,6 +523,8 @@ namespace drawinglayer
 
             // FIXME(matteocam)
             bool bToBeChained = rTextObj.IsToBeChained();
+            bool bChainable = rTextObj.IsChainable();
+
 
             if(rText.GetOutlinerParaObject() && rText.GetModel())
             {
@@ -583,10 +585,11 @@ namespace drawinglayer
                     bInEditMode,
                     ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue(),
                     bWrongSpell,
-                    bToBeChained);
+                    bToBeChained,
+                    bChainable);
             }
 
-            return attribute::SdrTextAttribute(bToBeChained);
+            return attribute::SdrTextAttribute();
         }
 
         attribute::FillGradientAttribute createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 73749e9..f37219f 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -313,7 +313,7 @@ namespace drawinglayer
                                     aAnchorTransform,
                                     bWordWrap);
                 }
-                else if( rText.isToBeChained() /*&& !rText.isInEditMode()*/ ) // FIXME(matteocam)
+                else if( rText.isChainable() /*&& !rText.isInEditMode()*/ ) // FIXME(matteocam)
                 {
                     pNew = new SdrChainedTextPrimitive2D(
                                     &rText.getSdrText(),


More information about the Libreoffice-commits mailing list