summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdotextpathdecomposition.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw/svdotextpathdecomposition.cxx')
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx78
1 files changed, 44 insertions, 34 deletions
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 9ac4534b329e4..f6780bd7c90db 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -62,7 +62,7 @@
#include <svx/xlinjoit.hxx>
#include <svx/xlndsit.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <editeng/editstat.hxx>
#include <unoapi.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
@@ -226,7 +226,7 @@ namespace
{
class impPolygonParagraphHandler
{
- const drawinglayer::attribute::SdrFormTextAttribute& mrSdrFormTextAttribute; // FormText parameters
+ const drawinglayer::attribute::SdrFormTextAttribute maSdrFormTextAttribute; // FormText parameters
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrDecomposition; // destination primitive list
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow
Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator
@@ -269,7 +269,7 @@ namespace
const drawinglayer::attribute::SdrFormTextAttribute& rSdrFormTextAttribute,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rDecomposition,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rShadowDecomposition)
- : mrSdrFormTextAttribute(rSdrFormTextAttribute),
+ : maSdrFormTextAttribute(rSdrFormTextAttribute),
mrDecomposition(rDecomposition),
mrShadowDecomposition(rShadowDecomposition)
{
@@ -293,18 +293,18 @@ namespace
double fPolyStart(0.0);
double fScaleFactor(1.0);
- if(mrSdrFormTextAttribute.getFormTextMirror())
+ if(maSdrFormTextAttribute.getFormTextMirror())
{
aPolygonCandidate.flip();
}
- if(mrSdrFormTextAttribute.getFormTextStart()
- && (XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust()
- || XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust()))
+ if(maSdrFormTextAttribute.getFormTextStart()
+ && (XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust()
+ || XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust()))
{
- if(XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust())
{
- fPolyStart += mrSdrFormTextAttribute.getFormTextStart();
+ fPolyStart += maSdrFormTextAttribute.getFormTextStart();
if(fPolyStart > fPolyEnd)
{
@@ -313,7 +313,7 @@ namespace
}
else
{
- fPolyEnd -= mrSdrFormTextAttribute.getFormTextStart();
+ fPolyEnd -= maSdrFormTextAttribute.getFormTextStart();
if(fPolyEnd < fPolyStart)
{
@@ -322,7 +322,7 @@ namespace
}
}
- if(XFT_LEFT != mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_LEFT != maSdrFormTextAttribute.getFormTextAdjust())
{
// calculate total text length of this paragraph, some layout needs to be done
const double fParagraphTextLength(getParagraphTextLength(rTextPortions));
@@ -331,7 +331,7 @@ namespace
// but still take care of XFT_AUTOSIZE in that case
const bool bTextTooLong(fParagraphTextLength > (fPolyEnd - fPolyStart));
- if(XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -339,7 +339,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength);
}
}
- else if(XFT_CENTER == mrSdrFormTextAttribute.getFormTextAdjust())
+ else if(XFT_CENTER == maSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -347,7 +347,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength) / 2.0;
}
}
- else if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ else if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// if scale, prepare scale factor between curve length and text length
if(0.0 != fParagraphTextLength)
@@ -382,7 +382,7 @@ namespace
// prepare portion length. Takes RTL sections into account.
double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen));
- if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand portion length
fPortionLength *= fScaleFactor;
@@ -397,27 +397,27 @@ namespace
aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY());
// prepare scaling of text primitive
- if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand text primitive scaling
aNewTransformA.scale(fScaleFactor, fScaleFactor);
}
// eventually create shadow primitives from aDecomposition and add to rDecomposition
- const bool bShadow(XFTSHADOW_NONE != mrSdrFormTextAttribute.getFormTextShadow());
+ const bool bShadow(XFTSHADOW_NONE != maSdrFormTextAttribute.getFormTextShadow());
if(bShadow)
{
- if(XFTSHADOW_NORMAL == mrSdrFormTextAttribute.getFormTextShadow())
+ if(XFTSHADOW_NORMAL == maSdrFormTextAttribute.getFormTextShadow())
{
aNewShadowTransform.translate(
- mrSdrFormTextAttribute.getFormTextShdwXVal(),
- -mrSdrFormTextAttribute.getFormTextShdwYVal());
+ maSdrFormTextAttribute.getFormTextShdwXVal(),
+ -maSdrFormTextAttribute.getFormTextShdwYVal());
}
else // XFTSHADOW_SLANT
{
- double fScaleValue(mrSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
- double fShearValue(-mrSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
+ double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
+ double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
aNewShadowTransform.scale(1.0, fScaleValue);
aNewShadowTransform.shearX(sin(fShearValue));
@@ -425,7 +425,7 @@ namespace
}
}
- switch(mrSdrFormTextAttribute.getFormTextStyle())
+ switch(maSdrFormTextAttribute.getFormTextStyle())
{
case XFT_ROTATE :
{
@@ -483,7 +483,7 @@ namespace
}
// distance from path?
- if(mrSdrFormTextAttribute.getFormTextDistance())
+ if(maSdrFormTextAttribute.getFormTextDistance())
{
if(aEndPos.equal(aStartPos))
{
@@ -493,7 +493,7 @@ namespace
// use back vector (aStartPos - aEndPos) here to get mirrored perpendicular as in old stuff
const basegfx::B2DVector aPerpendicular(
basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) *
- mrSdrFormTextAttribute.getFormTextDistance());
+ maSdrFormTextAttribute.getFormTextDistance());
aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY());
}
@@ -502,7 +502,7 @@ namespace
{
if(pCandidate->getText().Len() && nNextGlyphLen)
{
- const Color aShadowColor(mrSdrFormTextAttribute.getFormTextShdwColor());
+ const Color aShadowColor(maSdrFormTextAttribute.getFormTextShdwColor());
const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
const ::std::vector< double > aNewDXArray(
@@ -623,7 +623,7 @@ namespace
{
if(rOutlineAttribute.getTransparence())
{
- // create UnifiedAlphaPrimitive2D
+ // create UnifiedTransparencePrimitive2D
drawinglayer::primitive2d::Primitive2DSequence aStrokePrimitiveSequence(nStrokeCount);
for(sal_uInt32 b(0L); b < nStrokeCount; b++)
@@ -631,8 +631,8 @@ namespace
aStrokePrimitiveSequence[b] = drawinglayer::primitive2d::Primitive2DReference(aStrokePrimitives[b]);
}
- drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 =
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ drawinglayer::primitive2d::UnifiedTransparencePrimitive2D* pNew2 =
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aStrokePrimitiveSequence,
(double)rOutlineAttribute.getTransparence() / 100.0);
aNewPrimitives.push_back(pNew2);
@@ -712,7 +712,9 @@ void SdrTextObj::impDecomposePathTextPrimitive(
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aRegularDecomposition;
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aShadowDecomposition;
impPolygonParagraphHandler aPolygonParagraphHandler(
- rFormTextAttribute, aRegularDecomposition, aShadowDecomposition);
+ rFormTextAttribute,
+ aRegularDecomposition,
+ aShadowDecomposition);
sal_uInt32 a;
for(a = 0L; a < nLoopCount; a++)
@@ -751,10 +753,14 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add shadow outlines
- if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getShadowOutline())
+ if(rFormTextAttribute.getFormTextOutline()
+ && !rFormTextAttribute.getShadowOutline().isDefault())
{
const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
- impAddPathTextOutlines(aShadowDecomposition, *rFormTextAttribute.getShadowOutline()));
+ impAddPathTextOutlines(
+ aShadowDecomposition,
+ rFormTextAttribute.getShadowOutline()));
+
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalA, aOutlines);
}
}
@@ -770,10 +776,14 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add outlines
- if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getOutline())
+ if(rFormTextAttribute.getFormTextOutline()
+ && !rFormTextAttribute.getOutline().isDefault())
{
const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
- impAddPathTextOutlines(aRegularDecomposition, *rFormTextAttribute.getOutline()));
+ impAddPathTextOutlines(
+ aRegularDecomposition,
+ rFormTextAttribute.getOutline()));
+
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalB, aOutlines);
}
}