summaryrefslogtreecommitdiff
path: root/drawinglayer/source/primitive2d/textprimitive2d.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'drawinglayer/source/primitive2d/textprimitive2d.cxx')
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx73
1 files changed, 36 insertions, 37 deletions
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index 2b3e85c78e52..bd9fc0ba30ad 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -166,50 +166,49 @@ namespace drawinglayer
void TextSimplePortionPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const
{
+ if(!getTextLength())
+ return;
+
Primitive2DContainer aRetval;
+ basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
+ basegfx::B2DHomMatrix aPolygonTransform;
- if(getTextLength())
- {
- basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
- basegfx::B2DHomMatrix aPolygonTransform;
+ // get text outlines and their object transformation
+ getTextOutlinesAndTransformation(aB2DPolyPolyVector, aPolygonTransform);
- // get text outlines and their object transformation
- getTextOutlinesAndTransformation(aB2DPolyPolyVector, aPolygonTransform);
+ // create primitives for the outlines
+ const sal_uInt32 nCount(aB2DPolyPolyVector.size());
- // create primitives for the outlines
- const sal_uInt32 nCount(aB2DPolyPolyVector.size());
+ if(!nCount)
+ return;
- if(nCount)
- {
- // alloc space for the primitives
- aRetval.resize(nCount);
+ // alloc space for the primitives
+ aRetval.resize(nCount);
- // color-filled polypolygons
- for(sal_uInt32 a(0L); a < nCount; a++)
- {
- // prepare polypolygon
- basegfx::B2DPolyPolygon& rPolyPolygon = aB2DPolyPolyVector[a];
- rPolyPolygon.transform(aPolygonTransform);
- aRetval[a] = new PolyPolygonColorPrimitive2D(rPolyPolygon, getFontColor());
- }
+ // color-filled polypolygons
+ for(sal_uInt32 a(0L); a < nCount; a++)
+ {
+ // prepare polypolygon
+ basegfx::B2DPolyPolygon& rPolyPolygon = aB2DPolyPolyVector[a];
+ rPolyPolygon.transform(aPolygonTransform);
+ aRetval[a] = new PolyPolygonColorPrimitive2D(rPolyPolygon, getFontColor());
+ }
- if(getFontAttribute().getOutline())
- {
- // decompose polygon transformation to single values
- basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
- aPolygonTransform.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // create outline text effect with current content and replace
- Primitive2DReference aNewTextEffect(new TextEffectPrimitive2D(
- aRetval,
- aTranslate,
- fRotate,
- TextEffectStyle2D::Outline));
-
- aRetval = Primitive2DContainer { aNewTextEffect };
- }
- }
+ if(getFontAttribute().getOutline())
+ {
+ // decompose polygon transformation to single values
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ aPolygonTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // create outline text effect with current content and replace
+ Primitive2DReference aNewTextEffect(new TextEffectPrimitive2D(
+ aRetval,
+ aTranslate,
+ fRotate,
+ TextEffectStyle2D::Outline));
+
+ aRetval = Primitive2DContainer { aNewTextEffect };
}
rContainer.insert(rContainer.end(), aRetval.begin(), aRetval.end());