On extending SdrTextPrimitive2D

Thorsten Behrens thb at documentfoundation.org
Thu Jul 24 13:27:31 PDT 2014


Matteo Campanelli wrote:
> I created a class that extends SdrTextPrimitive2D.  The derived
> class - SdrChainedTextPrimitive2D - should be used for dealing with
> text in chained text boxes.
> 
Cool!

> 1) SdrChainedTextPrimitive2D::create2DDecomposition should return a
> Primitive2DSequence. What is this for?
>
That's a one-level-more-simpler version of the scene graph. If
e.g. you've already plain text portions, their decomposition would
then yield poly-polygons of the glyphs.

For your case: return a single SdrBlockTextPrimitive2D (or
SdrAutoFitTextPrimitive2D, depending on the setup), with the text that
should be in the current shape.

> Currently I'm returning an empty sequence on which I apply the following
> mysterious method other similar classes are using:
> encapsulateWithTextHierarchyBlockPrimitive2D(aEmptySequence)
> 
With the above change, that should no longer be necessary.

> 2) SdrChainedTextPrimitive2D::createTransformedClone, I have no idea what
> this is for.
>
Just fold in the transformation matrix, like e.g. for
SdrAutoFitTextPrimitive2D.

HTH,

-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140724/0dad7ed3/attachment.sig>


More information about the LibreOffice mailing list