53#include <osl/diagnose.h>
78 return { aScale.
getX() / 2, 0 };
80 return { aScale.
getX(), 0 };
82 return { 0, aScale.
getY() / 2 };
84 return { aScale.
getX() / 2, aScale.
getY() / 2 };
86 return { aScale.
getX(), aScale.
getY() / 2 };
88 return { 0, aScale.
getY() };
90 return { aScale.
getX() / 2, aScale.
getY() };
92 return { aScale.
getX(), aScale.
getY() };
106 const double fWidthForText = bVerticalWriting ? rSnapRange.
getHeight() : rSnapRange.
getWidth();
111 const double fTextLeftDistance
112 = std::min(
static_cast<double>(rText.getTextLeftDistance()), fWidthForText);
113 const double nTextRightDistance
114 = std::min(
static_cast<double>(rText.getTextRightDistance()), fWidthForText);
115 double fDistanceForTextL, fDistanceForTextT, fDistanceForTextR, fDistanceForTextB;
116 if (!bVerticalWriting)
118 fDistanceForTextL = fTextLeftDistance;
119 fDistanceForTextT = rText.getTextUpperDistance();
120 fDistanceForTextR = nTextRightDistance;
121 fDistanceForTextB = rText.getTextLowerDistance();
125 fDistanceForTextL = rText.getTextLowerDistance();
126 fDistanceForTextT = fTextLeftDistance;
127 fDistanceForTextR = rText.getTextUpperDistance();
128 fDistanceForTextB = nTextRightDistance;
132 fDistanceForTextL = rText.getTextUpperDistance();
133 fDistanceForTextT = nTextRightDistance;
134 fDistanceForTextR = rText.getTextLowerDistance();
135 fDistanceForTextB = fTextLeftDistance;
138 rSnapRange.
getMinY() + fDistanceForTextT);
140 rSnapRange.
getMaxY() - fDistanceForTextB);
142 aAnchorRange.
expand(aTopLeft);
143 aAnchorRange.
expand(aBottomRight);
149 if (!bVerticalWriting && aAnchorRange.
getWidth() == 0)
154 else if (bVerticalWriting && aAnchorRange.
getHeight() == 0)
163 const geometry::ViewInformation2D& rViewInformation,
171 if(
nullptr != pVisualizedPage)
174 rPageSize.
setX(pVisualizedPage->GetWidth());
175 rPageSize.
setY(pVisualizedPage->GetHeight());
177 if(pVisualizedPage->IsMasterPage())
181 if(pVisualizedPage->getSdrPageProperties().GetStyleSheet())
185 pVisualizedPage->getSdrPageProperties().GetItemSet());
191 if(pVisualizedPage->TRG_HasMasterPage())
197 if(
nullptr != pVCOMPD)
203 pVCOMPD->GetMasterPageDescriptor().getCorrectSdrPageProperties());
205 if(pCorrectProperties)
209 pCorrectProperties->GetItemSet());
225class SlideBackgroundFillPrimitive2D final :
public BufferedDecompositionPrimitive2D
236 virtual void create2DDecomposition(
237 Primitive2DContainer& rContainer,
238 const geometry::ViewInformation2D& rViewInformation)
const override;
242 SlideBackgroundFillPrimitive2D(
246 virtual void get2DDecomposition(
247 Primitive2DDecompositionVisitor& rVisitor,
248 const geometry::ViewInformation2D& rViewInformation)
const override;
254 virtual bool operator==(
const BasePrimitive2D& rPrimitive)
const override;
257 virtual basegfx::B2DRange getB2DRange(
const geometry::ViewInformation2D& rViewInformation)
const override;
260 virtual sal_uInt32 getPrimitive2DID()
const override;
263SlideBackgroundFillPrimitive2D::SlideBackgroundFillPrimitive2D(
265: BufferedDecompositionPrimitive2D()
271void SlideBackgroundFillPrimitive2D::create2DDecomposition(
272 Primitive2DContainer& rContainer,
273 const geometry::ViewInformation2D& rViewInformation)
const
280 getMasterPageFillAttribute(rViewInformation, aPageSize));
283 if(aFill.isDefault())
290 if(aPolygonRange.isEmpty())
297 if(!aPageRange.overlaps(aPolygonRange))
305 const attribute::FillGradientAttribute aEmptyFillTransparenceGradient;
311 aEmptyFillTransparenceGradient));
313 rContainer = Primitive2DContainer { aCreatedFill };
316void SlideBackgroundFillPrimitive2D::get2DDecomposition(
317 Primitive2DDecompositionVisitor& rVisitor,
318 const geometry::ViewInformation2D& rViewInformation)
const
323 if(!getBuffered2DDecomposition().empty())
325 aFill = getMasterPageFillAttribute(rViewInformation, aPageSize);
330 const_cast< SlideBackgroundFillPrimitive2D*
>(
this)->setBuffered2DDecomposition(Primitive2DContainer());
334 if(getBuffered2DDecomposition().empty())
337 const_cast< SlideBackgroundFillPrimitive2D*
>(
this)->
maLastFill = aFill;
341 BufferedDecompositionPrimitive2D::get2DDecomposition(rVisitor, rViewInformation);
344bool SlideBackgroundFillPrimitive2D::operator==(
const BasePrimitive2D& rPrimitive)
const
346 if (BufferedDecompositionPrimitive2D::operator==(rPrimitive))
348 const SlideBackgroundFillPrimitive2D& rCompare
349 =
static_cast<const SlideBackgroundFillPrimitive2D&
>(rPrimitive);
351 return getB2DPolyPolygon() == rCompare.getB2DPolyPolygon();
358 const geometry::ViewInformation2D& )
const
365sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID()
const
372 class TransparencePrimitive2D;
430 pNewFillPrimitive =
new SlideBackgroundFillPrimitive2D(
467 return pNewFillPrimitive;
504 return pNewLinePrimitive;
527 double fRotate, fShearX;
528 rObjectTransform.
decompose(aScale, aTranslate, fRotate, fShearX);
534 fabs(aScale.
getX()), fabs(aScale.
getY())));
541 0.0 != aScale.
getX() ? 1.0 / aScale.
getX() : 1.0,
542 0.0 != aScale.
getY() ? 1.0 / aScale.
getY() : 1.0));
548 std::move(aScaledUnitPolyPolygon),
565 aScaledPolyPolygon.
transform(rObjectTransform);
569 std::move(aScaledPolyPolygon),
577 double fRotate, fShearX;
578 rObjectTransform.
decompose(aScale, aTranslate, fRotate, fShearX);
588 aJustScaleTransform.
set(0, 0, aScale.
getX());
589 aJustScaleTransform.
set(1, 1, aScale.
getY());
591 aScaledUnitPolyPolygon.
transform(aJustScaleTransform);
604 aAnchorTransform.
scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0);
651 OSL_ENSURE(pNew !=
nullptr,
"createTextPrimitive: no text primitive created (!)");
686 double fRotate, fShearX;
687 aAnchorTransform.
decompose(aScale, aTranslate, fRotate, fShearX);
691 fShearX, fRotate, aTranslate));
697 OSL_ENSURE(pNew2,
"createTextPrimitive: Could not create transformed clone of text primitive (!)");
750 pNew->get2DDecomposition(aAnimSequence, aViewInformation2D);
796 return std::move(rContent);
806 rObjectMatrix.
decompose(aScale, aTranslate, fRotate, fShearX);
808 aTranslate += getShadowScaleOriginOffset(aScale, rShadow.
getAlignment());
818 = pContentForShadow ? *pContentForShadow : rContent;
819 int nContentWithTransparence = std::count_if(
820 rContentForShadow.begin(), rContentForShadow.end(),
822 auto pChild = dynamic_cast<BufferedDecompositionPrimitive2D*>(xChild.get());
823 return pChild && pChild->getTransparenceForShadow() != 0;
825 if (nContentWithTransparence == 0)
842 std::move(aTempContent),
851 for (
const auto& xChild : rContentForShadow)
853 double fChildTransparence = 0.0;
858 fChildTransparence /= 100;
867 double fChildAlpha = 1.0 - fChildTransparence;
869 double fTransparence = 1.0 - fChildAlpha * fShadowAlpha;
871 std::move(aTempContent), fTransparence));
885 return std::move(rContent);
896 if (aContent.empty() || !nRadius)
897 return std::move(aContent);
bool IsTopToBottom() const
bool IsEffectivelyVertical() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
SdrTextAniDirection GetTextAniDirection() const
SdrTextObj & GetObject() const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
void translate(double fX, double fY)
void scale(double fX, double fY)
void transform(const basegfx::B2DHomMatrix &rMatrix)
void transform(const basegfx::B2DHomMatrix &rMatrix)
void expand(const Tuple2D< TYPE > &rTuple)
virtual double getDuration() const override
const basegfx::BColor & getColor() const
const FillHatchAttribute & getHatch() const
double getTransparence() const
const FillGradientAttribute & getGradient() const
bool isSlideBackgroundFill() const
const SdrFillGraphicAttribute & getFillGraphic() const
FillGraphicAttribute createFillGraphicAttribute(const basegfx::B2DRange &rRange) const
const Color & getColor() const
sal_Int32 getRadius() const
css::drawing::LineCap getCap() const
double getTransparence() const
const ::std::vector< double > & getDotDashArray() const
double getFullDotDashLen() const
const basegfx::BColor & getColor() const
basegfx::B2DLineJoin getJoin() const
double getEndWidth() const
const basegfx::B2DPolyPolygon & getStartPolyPolygon() const
bool isEndCentered() const
bool isStartCentered() const
double getStartWidth() const
const basegfx::B2DPolyPolygon & getEndPolyPolygon() const
model::RectangleAlignment getAlignment() const
const basegfx::BColor & getColor() const
sal_Int32 getBlur() const
const basegfx::B2DVector & getSize() const
const basegfx::B2DVector & getOffset() const
double getTransparence() const
const OutlinerParaObject & getOutlinerParaObject() const
void getScrollTextTiming(drawinglayer::animation::AnimationEntryList &rAnimList, double fFrameLength, double fTextLength) const
void getBlinkTextTiming(drawinglayer::animation::AnimationEntryList &rAnimList) const
bool isInEditMode() const
SdrTextVertAdjust getSdrTextVertAdjust() const
bool isFixedCellHeight() const
const SdrFormTextAttribute & getSdrFormTextAttribute() const
SdrTextHorzAdjust getSdrTextHorzAdjust() const
const SdrText & getSdrText() const
sal_uInt16 getTransparenceForShadow() const
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
B2DPolygon growInNormalDirection(const B2DPolygon &rCandidate, double fValue)
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
B2DHomMatrix createShearXRotateTranslateB2DHomMatrix(double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
B2DRange getRange(const B2DPolygon &rCandidate)
B2DTuple absolute(const B2DTuple &rTup)
Primitive2DContainer createEmbeddedSoftEdgePrimitive(Primitive2DContainer &&aContent, sal_Int32 nRadius)
Primitive2DContainer createEmbeddedShadowPrimitive(Primitive2DContainer &&rContent, const attribute::SdrShadowAttribute &rShadow, const basegfx::B2DHomMatrix &rObjectMatrix, const Primitive2DContainer *pContentForShadow)
attribute::SdrFillAttribute createNewSdrFillAttribute(const SfxItemSet &rSet)
Primitive2DReference createPolygonLinePrimitive(const basegfx::B2DPolygon &rPolygon, const attribute::SdrLineAttribute &rLine, const attribute::SdrLineStartEndAttribute &rStroke)
Primitive2DReference createTextPrimitive(const basegfx::B2DPolyPolygon &rUnitPolyPolygon, const basegfx::B2DHomMatrix &rObjectTransform, const attribute::SdrTextAttribute &rText, const attribute::SdrLineAttribute &rStroke, bool bCellText, bool bWordWrap)
Primitive2DContainer createEmbeddedGlowPrimitive(Primitive2DContainer &&rContent, const attribute::SdrGlowAttribute &rGlow)
Primitive2DReference createPolyPolygonFillPrimitive(const basegfx::B2DPolyPolygon &rPolyPolygon, const basegfx::B2DRange &rDefinitionRange, const attribute::SdrFillAttribute &rFill, const attribute::FillGradientAttribute &rFillGradient)
#define PRIMITIVE2D_ID_SLIDEBACKGROUNDFILLPRIMITIVE2D
SdrPage * GetSdrPageFromXDrawPage(const uno::Reference< drawing::XDrawPage > &xDrawPage) noexcept
returns the SdrObject from the given StarOffice API wrapper
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)