52 #include <osl/diagnose.h>
70 const double fWidthForText = bVerticalWriting ? rSnapRange.
getHeight() : rSnapRange.
getWidth();
75 const double fTextLeftDistance
76 = std::min(static_cast<double>(rText.getTextLeftDistance()), fWidthForText);
77 const double nTextRightDistance
78 = std::min(static_cast<double>(rText.getTextRightDistance()), fWidthForText);
79 double fDistanceForTextL, fDistanceForTextT, fDistanceForTextR, fDistanceForTextB;
80 if (!bVerticalWriting)
82 fDistanceForTextL = fTextLeftDistance;
83 fDistanceForTextT = rText.getTextUpperDistance();
84 fDistanceForTextR = nTextRightDistance;
85 fDistanceForTextB = rText.getTextLowerDistance();
89 fDistanceForTextL = rText.getTextLowerDistance();
90 fDistanceForTextT = fTextLeftDistance;
91 fDistanceForTextR = rText.getTextUpperDistance();
92 fDistanceForTextB = nTextRightDistance;
96 fDistanceForTextL = rText.getTextUpperDistance();
97 fDistanceForTextT = nTextRightDistance;
98 fDistanceForTextR = rText.getTextLowerDistance();
99 fDistanceForTextB = fTextLeftDistance;
102 rSnapRange.
getMinY() + fDistanceForTextT);
104 rSnapRange.
getMaxY() - fDistanceForTextB);
106 aAnchorRange.
expand(aTopLeft);
107 aAnchorRange.expand(aBottomRight);
113 if (!bVerticalWriting && aAnchorRange.getWidth() == 0)
115 aAnchorRange.expand(
basegfx::B2DPoint(aTopLeft.getX() - 1000000, aTopLeft.getY()));
116 aAnchorRange.expand(
basegfx::B2DPoint(aBottomRight.getX() + 1000000, aBottomRight.getY()));
118 else if (bVerticalWriting && aAnchorRange.getHeight() == 0)
120 aAnchorRange.expand(
basegfx::B2DPoint(aTopLeft.getX(), aTopLeft.getY() - 1000000));
121 aAnchorRange.expand(
basegfx::B2DPoint(aBottomRight.getX(), aBottomRight.getY() + 1000000));
127 class TransparencePrimitive2D;
215 return pNewFillPrimitive;
252 return pNewLinePrimitive;
275 double fRotate, fShearX;
276 rObjectTransform.
decompose(aScale, aTranslate, fRotate, fShearX);
282 fabs(aScale.
getX()), fabs(aScale.
getY())));
289 0.0 != aScale.
getX() ? 1.0 / aScale.
getX() : 1.0,
290 0.0 != aScale.
getY() ? 1.0 / aScale.
getY() : 1.0));
296 aScaledUnitPolyPolygon,
313 aScaledPolyPolygon.
transform(rObjectTransform);
325 double fRotate, fShearX;
326 rObjectTransform.
decompose(aScale, aTranslate, fRotate, fShearX);
336 aJustScaleTransform.
set(0, 0, aScale.getX());
337 aJustScaleTransform.
set(1, 1, aScale.getY());
339 aScaledUnitPolyPolygon.
transform(aJustScaleTransform);
352 aAnchorTransform.
scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0);
399 OSL_ENSURE(pNew !=
nullptr,
"createTextPrimitive: no text primitive created (!)");
434 double fRotate, fShearX;
435 aAnchorTransform.
decompose(aScale, aTranslate, fRotate, fShearX);
439 fShearX, fRotate, aTranslate));
445 OSL_ENSURE(pNew2,
"createTextPrimitive: Could not create transformed clone of text primitive (!)");
463 aClipTopLeft.
setY(aScaledRange.getMinY());
464 aClipBottomRight.setY(aScaledRange.getMaxY());
465 aLeft.translate(-aScaledRange.getMaxX(), 0.0);
466 aRight.translate(aScale.
getX() - aScaledRange.getMinX(), 0.0);
470 aClipTopLeft.
setX(aScaledRange.getMinX());
471 aClipBottomRight.setX(aScaledRange.getMaxX());
472 aLeft.translate(0.0, -aScaledRange.getMaxY());
473 aRight.translate(0.0, aScale.
getY() - aScaledRange.getMinY());
498 pNew->get2DDecomposition(aAnimSequence, aViewInformation2D);
544 return std::move(rContent);
554 rObjectMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
556 double nTranslateX = aTranslate.
getX();
557 double nTranslateY = aTranslate.
getY();
562 nTranslateX += aScale.
getX();
564 nTranslateY += aScale.
getY();
566 aShadowOffset.
translate(-nTranslateX, -nTranslateY);
568 aShadowOffset.
translate(nTranslateX, nTranslateY);
575 = pContentForShadow ? *pContentForShadow : rContent;
576 int nContentWithTransparence = std::count_if(
577 rContentForShadow.begin(), rContentForShadow.end(),
582 if (nContentWithTransparence == 0)
599 std::move(aTempContent),
608 for (
const auto& xChild : rContentForShadow)
610 double fChildTransparence = 0.0;
615 fChildTransparence /= 100;
624 double fChildAlpha = 1.0 - fChildTransparence;
626 double fTransparence = 1.0 - fChildAlpha * fShadowAlpha;
628 std::move(aTempContent), fTransparence));
642 return std::move(rContent);
653 if (aContent.empty() || !nRadius)
654 return std::move(aContent);
B2DPolygon growInNormalDirection(const B2DPolygon &rCandidate, double fValue)
const FillGradientAttribute & getGradient() const
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
css::drawing::LineCap getCap() const
B2DTuple absolute(const B2DTuple &rTup)
const basegfx::BColor & getColor() const
const basegfx::BColor & getColor() const
bool IsTopToBottom() const
sal_Int32 getBlur() const
const basegfx::B2DPolyPolygon & getStartPolyPolygon() const
Primitive2DContainer createEmbeddedGlowPrimitive(Primitive2DContainer &&rContent, const attribute::SdrGlowAttribute &rGlow)
Primitive2DContainer createEmbeddedShadowPrimitive(Primitive2DContainer &&rContent, const attribute::SdrShadowAttribute &rShadow, const basegfx::B2DHomMatrix &rObjectMatrix, const Primitive2DContainer *pContentForShadow)
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
basegfx::B2DLineJoin getJoin() const
double getTransparence() const
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
const FillHatchAttribute & getHatch() const
Primitive2DReference createPolyPolygonFillPrimitive(const basegfx::B2DPolyPolygon &rPolyPolygon, const basegfx::B2DRange &rDefinitionRange, const attribute::SdrFillAttribute &rFill, const attribute::FillGradientAttribute &rFillGradient)
SdrTextHorzAdjust getSdrTextHorzAdjust() const
bool isInEditMode() const
double getStartWidth() const
const OutlinerParaObject & getOutlinerParaObject() const
FillGraphicAttribute createFillGraphicAttribute(const basegfx::B2DRange &rRange) const
const basegfx::B2DPolyPolygon & getEndPolyPolygon() const
void getScrollTextTiming(drawinglayer::animation::AnimationEntryList &rAnimList, double fFrameLength, double fTextLength) const
virtual double getDuration() const override
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
sal_uInt16 getTransparenceForShadow() const
SdrTextObj & GetObject() const
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
const basegfx::B2DVector & getOffset() const
const ::std::vector< double > & getDotDashArray() const
const basegfx::BColor & getColor() const
void scale(double fX, double fY)
void transform(const basegfx::B2DHomMatrix &rMatrix)
Primitive2DReference createTextPrimitive(const basegfx::B2DPolyPolygon &rUnitPolyPolygon, const basegfx::B2DHomMatrix &rObjectTransform, const attribute::SdrTextAttribute &rText, const attribute::SdrLineAttribute &rStroke, bool bCellText, bool bWordWrap)
B2DRange getRange(const B2DPolygon &rCandidate)
void transform(const basegfx::B2DHomMatrix &rMatrix)
bool IsEffectivelyVertical() const
double getTransparence() const
void getBlinkTextTiming(drawinglayer::animation::AnimationEntryList &rAnimList) const
bool isStartCentered() const
const SdrText & getSdrText() const
const Color & getColor() const
Primitive2DContainer createEmbeddedSoftEdgePrimitive(Primitive2DContainer &&aContent, sal_Int32 nRadius)
SdrTextAniDirection GetTextAniDirection() const
void translate(double fX, double fY)
sal_Int32 getRadius() const
const SdrFormTextAttribute & getSdrFormTextAttribute() const
const SdrFillGraphicAttribute & getFillGraphic() const
SdrTextVertAdjust getSdrTextVertAdjust() const
bool isEndCentered() const
const basegfx::B2DVector & getSize() const
B2DHomMatrix createShearXRotateTranslateB2DHomMatrix(double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
bool isFixedCellHeight() const
Primitive2DReference createPolygonLinePrimitive(const basegfx::B2DPolygon &rPolygon, const attribute::SdrLineAttribute &rLine, const attribute::SdrLineStartEndAttribute &rStroke)
double getEndWidth() const
double getTransparence() const
void expand(const Tuple2D< double > &rTuple)
double getFullDotDashLen() const