[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/inc svx/source
matteocam
matteo.campanelli at gmail.com
Thu Jul 24 08:38:40 PDT 2014
include/svx/svdotext.hxx | 6 ++-
svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx | 3 +
svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx | 9 ++++-
svx/source/svdraw/svdotext.cxx | 35 +-------------------
svx/source/svdraw/svdotextdecomposition.cxx | 37 ++++++++++++++++++++++
5 files changed, 55 insertions(+), 35 deletions(-)
New commits:
commit be897ed79d331276e8d686ac35956cdd57e24615
Author: matteocam <matteo.campanelli at gmail.com>
Date: Thu Jul 24 18:37:37 2014 +0300
More methods class SdrChainedTextPrimitive2D
Change-Id: I0655d7b9a581dc9f2e5e1a5723ab2559be5447cc
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 93a48cb..01c14ac 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -54,6 +54,7 @@ namespace drawinglayer { namespace primitive2d {
class SdrBlockTextPrimitive2D;
class SdrAutoFitTextPrimitive2D;
class SdrStretchTextPrimitive2D;
+ class SdrChainedTextPrimitive2D;
}}
namespace drawinglayer { namespace animation {
@@ -269,7 +270,6 @@ 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();
@@ -586,6 +586,10 @@ public:
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
+ void impDecomposeChainedTextPrimitive(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& rSdrChainedTextPrimitive,
+ const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
void impCopyTextInTextObj(SdrTextObj *pNextTextObj) const;
void embedText() const;
diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
index 44b82ae..aaefeb6 100644
--- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
+++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -353,6 +353,9 @@ namespace drawinglayer
// compare operator
//virtual bool operator==(const BasePrimitive2D& rPrimitive) const SAL_OVERRIDE;
+ // transformed clone operator
+ virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const SAL_OVERRIDE;
+
// provide unique ID
DeclPrimitive2DIDBlock()
};
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index 8ba2909..7e9334c 100644
--- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
@@ -494,11 +494,18 @@ namespace drawinglayer
Primitive2DSequence SdrChainedTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- getSdrText()->GetObject().impDecomposeChainedPrimitive(aRetval, *this, aViewInformation);
+ getSdrText()->GetObject().impDecomposeChainedTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
+ SdrTextPrimitive2D* SdrChainedTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
+ {
+ //FIXME(matteocam)
+ assert(0);
+ return NULL;
+ }
+
// provide unique ID
ImplPrimitive2DIDBlock(SdrChainedTextPrimitive2D, PRIMITIVE2D_ID_SDRCHAINEDTEXTPRIMITIVE2D)
} // end of namespace primitive2d
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index f249bbf..31dddbf 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1927,44 +1927,13 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus )
}
else if (/* TODO: IsChained() && */ pEditStatus->IsPageOverflow())
{
- ImpChainText();
+ // XXX: Do nothing for now, later here we'll set the need for chaining
+ //impDecomposeChainedTextPrimitive();
}
}
}
-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 5be2260..fb21d08 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1503,4 +1503,41 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL
}
}
+void SdrTextObj::impDecomposeChainedTextPrimitive(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ 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) {
+ impCopyTextInTextObj(pNextTextObj); // just do it
+ // return;
+ //}
+
+ drawinglayer::primitive2d::Primitive2DSequence aRetval(0);
+ rTarget = aRetval;
+ /* END Experiments */
+}
+
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list