38 maSvgStyleAttributes(*this),
39 mbStyleAttributesInitialized(false)
52 bool bSetInitialValues(
true);
57 bSetInitialValues =
false;
71 while(pParentStyle && !bFillSet)
81 bSetInitialValues =
false;
210 const SvgSvgNode* pParentSvgSvgNode =
nullptr;
213 double fPercentage(1.0);
217 pParentSvgSvgNode =
dynamic_cast< const SvgSvgNode*
>(pParent);
218 if (pParentSvgSvgNode)
252 const SvgSvgNode* pParentSvgSvgNode =
nullptr;
255 double fPercentage(1.0);
259 pParentSvgSvgNode =
dynamic_cast< const SvgSvgNode*
>(pParent);
260 if (pParentSvgSvgNode)
301 if(!aSequence.empty())
326 double fW( bWidthIsAbsolute ?
getWidth().solveNonPercentage(*
this) : 0.0);
329 double fH( bHeightIsAbsolute ?
getHeight().solveNonPercentage(*
this) : 0.0);
333 double fX( bXIsAbsolute &&
getX().isSet() ?
getX().solveNonPercentage(*
this) : 0.0);
336 double fY( bYIsAbsolute &&
getY().isSet() ?
getY().solveNonPercentage(*
this) : 0.0);
338 if ( !bXIsAbsolute || !bWidthIsAbsolute)
341 double fWReference(0.0);
342 bool bHasFoundWidth(
false);
358 fWReference = aChildRange.
getWidth();
366 if (!bWidthIsAbsolute)
372 if ( !bYIsAbsolute || !bHeightIsAbsolute)
375 double fHReference(0.0);
376 bool bHasFoundHeight(
false);
378 if (!bHasFoundHeight)
401 if (!bHeightIsAbsolute)
468 std::move(aSequence)));
492 if(!bWidthInvalid && !bHeightInvalid)
501 const double fViewBoxWidth = pBox->
getWidth();
502 const double fViewBoxHeight = pBox->getHeight();
508 bool bNeedsMapping(
true);
511 const double fViewBoxRatio(fViewBoxWidth/fViewBoxHeight);
512 if(bWidthIsAbsolute && bHeightIsAbsolute)
518 else if (bWidthIsAbsolute)
521 fH = fW / fViewBoxRatio ;
524 else if (bHeightIsAbsolute)
527 fW = fH * fViewBoxRatio ;
536 bNeedsMapping =
false;
538 const double fChildWidth(pBox->getWidth());
539 const double fChildHeight(pBox->getHeight());
540 const double fLeft(pBox->getMinX());
541 const double fTop(pBox->getMinY());
542 if ( fChildWidth / fViewBoxWidth > fChildHeight / fViewBoxHeight )
545 fH = fChildWidth / fViewBoxRatio;
550 fW = fChildHeight * fViewBoxRatio;
571 std::move(aSequence)));
581 if (bWidthIsAbsolute && bHeightIsAbsolute)
594 const double fChildWidth(aChildRange.
getWidth());
595 const double fChildHeight(aChildRange.
getHeight());
596 const double fChildLeft(aChildRange.
getMinX());
597 const double fChildTop(aChildRange.
getMinY());
600 const double fLeft(bWidthIsAbsolute ? 0.0 : fChildLeft);
601 const double fTop(bHeightIsAbsolute ? 0.0 : fChildTop);
619 if(aSvgCanvasRange.
isInside(aContentRange))
635 aSequence.push_back(xHidden);
637 else if(aSvgCanvasRange.
overlaps(aContentRange))
649 std::move(aSequence)));
659 if(!aSequence.empty())
669 bool bEmbedInFinalTransformPxTo100ThMM(
true);
671 if(
getDocument().findSvgNodeById(
"ooo:meta_slides")
675 bEmbedInFinalTransformPxTo100ThMM =
false;
678 if(bEmbedInFinalTransformPxTo100ThMM)
691 std::move(aSequence)));
736 double fW( bWidthIsAbsolute ?
getWidth().solveNonPercentage(*
this) : 0.0);
738 double fH( bHeightIsAbsolute ?
getHeight().solveNonPercentage(*
this) : 0.0);
742 double fX( bXIsAbsolute &&
getX().isSet() ?
getX().solveNonPercentage(*
this) : 0.0);
745 double fY( bYIsAbsolute &&
getY().isSet() ?
getY().solveNonPercentage(*
this) : 0.0);
747 if (bXIsAbsolute && bYIsAbsolute && bWidthIsAbsolute && bHeightIsAbsolute)
753 if (!bXIsAbsolute || !bWidthIsAbsolute)
756 double fWReference(0.0);
757 bool bHasFoundWidth(
false);
760 if (!bXIsAbsolute && bHasFoundWidth)
765 if (!bWidthIsAbsolute && bHasFoundWidth)
768 bWidthIsAbsolute =
true;
771 if (!bYIsAbsolute || !bHeightIsAbsolute)
774 double fHReference(0.0);
775 bool bHasFoundHeight(
false);
778 if (!bYIsAbsolute && bHasFoundHeight)
783 if (!bHeightIsAbsolute && bHasFoundHeight)
786 bHeightIsAbsolute =
true;
790 if (bXIsAbsolute && bYIsAbsolute && bWidthIsAbsolute && bHeightIsAbsolute)
807 if (bWidthIsAbsolute && bHeightIsAbsolute)
809 double fW(
getWidth().solveNonPercentage(*
this) );
810 double fH(
getHeight().solveNonPercentage(*
this) );
bool isInside(const Tuple2D< TYPE > &rTuple) const
bool equal(const Range2D &rRange) const
bool overlaps(const Range2D &rRange) const
basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &aViewInformation) const
bool isMeetOrSlice() const
basegfx::B2DHomMatrix createMapping(const basegfx::B2DRange &rTarget, const basegfx::B2DRange &rSource) const
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer &rTarget, bool bReferenced) const
const SvgStyleAttributes * checkForCssStyle(const SvgStyleAttributes &rOriginal) const
helper to evtl. link to css style
const SvgNode * getParent() const
virtual basegfx::B2DRange getCurrentViewPort() const override
InfoProvider support for %, em and ex values.
virtual void parseAttribute(const OUString &rTokenName, SVGToken aSVGToken, const OUString &aContent)
void readLocalCssStyle(std::u16string_view aContent)
scan helper to read and interpret a local CssStyle to mpLocalCssStyle
const SvgDocument & getDocument() const
double solveNonPercentage(const InfoProvider &rInfoProvider) const
const SvgStyleAttributes * getParentStyle() const
void setFill(const SvgPaint &rFill)
void parseStyleAttribute(SVGToken aSVGToken, const OUString &rContent)
local attribute scanner
bool isFillSet() const
fill content
const SvgAspectRatio & getSvgAspectRatio() const
SvgAspectRatio content.
void setViewBox(const basegfx::B2DRange *pViewBox)
virtual ~SvgSvgNode() override
SvgStyleAttributes maSvgStyleAttributes
use styles
virtual const SvgStyleAttributes * getSvgStyleAttributes() const override
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer &rTarget, bool bReferenced) const override
SvgSvgNode(SvgDocument &rDocument, SvgNode *pParent)
SvgAspectRatio maSvgAspectRatio
const SvgNumber & getWidth() const
width content
void seekReferenceWidth(double &fWidth, bool &bHasFound) const
Seeks width and height of viewport, which is current before the new viewport is set.
const SvgNumber & getX() const
x content
void initializeStyleAttributes()
virtual basegfx::B2DRange getCurrentViewPort() const override
InfoProvider support for % values in children.
const SvgNumber & getY() const
y content
void seekReferenceHeight(double &fHeight, bool &bHasFound) const
const basegfx::B2DRange * getViewBox() const
viewBox content
virtual void parseAttribute(const OUString &rTokenName, SVGToken aSVGToken, const OUString &aContent) override
const SvgNumber & getHeight() const
height content
bool mbStyleAttributesInitialized
#i125258# bitfield
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
bool readSingleNumber(std::u16string_view rCandidate, SvgNumber &aNum)
SvgAspectRatio readSvgAspectRatio(std::u16string_view rCandidate)
basegfx::B2DRange readViewBox(std::u16string_view rCandidate, InfoProvider const &rInfoProvider)