70 switch(aStrokeLinecap)
74 return css::drawing::LineCap_BUTT;
78 return css::drawing::LineCap_ROUND;
82 return css::drawing::LineCap_SQUARE;
182 const sal_Int32 nLen(rCandidate.size());
188 OUStringBuffer aTokenName;
192 if (aTokenName.isEmpty())
195 OSL_ENSURE(
false,
"Could not interpret on current position, advancing one byte (!)");
201 OUStringBuffer aTokenValue;
206 if (aTokenValue.isEmpty())
213 const OUString aOUTokenName(aTokenName.makeStringAndClear());
214 OUString aOUTokenValue(aTokenValue.makeStringAndClear());
218 OUString aTokenImportant(
"!important");
219 const sal_Int32 nIndexTokenImportant(aOUTokenValue.indexOf(aTokenImportant));
221 if(-1 != nIndexTokenImportant)
224 OUString aNewOUTokenValue;
226 if(nIndexTokenImportant > 0)
229 aNewOUTokenValue += aOUTokenValue.subView(0, nIndexTokenImportant);
232 if(aOUTokenValue.getLength() > nIndexTokenImportant + aTokenImportant.getLength())
235 aNewOUTokenValue += aOUTokenValue.subView(nIndexTokenImportant + aTokenImportant.getLength());
239 aOUTokenValue = aNewOUTokenValue.trim();
281 if(pFillGradient || pFillPattern || pStroke || pStrokeGradient || pStrokePattern)
293 const sal_uInt32 nResultCount(rResult.size());
295 aTextFillVector.reserve(nResultCount);
297 for(sal_uInt32
a(0);
a < nResultCount;
a++)
307 if(!aTextFillVector.empty())
313 const bool bStrokeUsed(pStroke || pStrokeGradient || pStrokePattern);
319 if(aMergedArea.
count() && (pFillGradient || pFillPattern || bStrokeUsed))
327 rTarget.append(std::move(rSource));
331 if(aMergedArea.
count() && bStrokeUsed)
350 if(aSvgGradientEntryVector.empty())
396 aStart *= aGeoToUnit;
404 std::move(aSvgGradientEntryVector),
417 const bool bFocal(pFx || pFy);
452 aStart *= aGeoToUnit;
457 aFocal *= aGeoToUnit;
465 std::move(aSvgGradientEntryVector),
470 bFocal ? &aFocal :
nullptr));
493 if(!aNewTarget.empty())
498 std::move(aNewTarget)));
517 if(rPrimitives.empty())
520 double fTargetWidth(rGeoRange.
getWidth());
521 double fTargetHeight(rGeoRange.
getHeight());
523 if(fTargetWidth <= 0.0 || fTargetHeight <= 0.0)
534 if(fW <= 0.0 || fH <= 0.0)
553 aMapPrimitivesToUnitRange = rRatio.
createMapping(aUnitRange, *pViewBox);
569 aMapPrimitivesToUnitRange.
scale(1.0 / (fW * fTargetWidth), 1.0 / (fH * fTargetHeight));
573 aMapPrimitivesToUnitRange.
scale(1.0 / fW, 1.0 / fH);
584 aMapPrimitivesToUnitRange,
585 std::move(aPrimitives)));
594 std::move(aPrimitives),
607 if(!(pFill || pFillGradient || pFillPattern))
622 else if(pFillPattern)
645 1.0 - fFillOpacity));
663 if(!(pStroke || pStrokeGradient || pStrokePattern))
683 if(1 == rPath.
count())
693 fStrokeWidth * (1.44 * 0.5))),
698 if(!aNewLinePrimitive.is())
703 ::std::vector< double > aDashArray;
712 double fMiterMinimumAngle;
719 fMiterMinimumAngle = 2.0 * asin(0.25);
732 if(aDashArray.empty())
745 std::move(aStrokeAttribute));
749 if(pStrokeGradient || pStrokePattern)
764 if(!rLineFillVector.empty())
770 if(aMergedArea.
count())
789 aNewStroke.push_back(aNewLinePrimitive);
792 if(aNewStroke.empty())
800 std::move(aNewStroke),
801 1.0 - fStrokeOpacity));
823 if(!rMarkerPrimitives.empty())
830 aPrimitiveRange = *pViewBox;
843 fTargetWidth *= fStrokeWidth;
844 fTargetHeight *= fStrokeWidth;
847 if(fTargetWidth > 0.0 && fTargetHeight > 0.0)
856 rMarkerTransform = rRatio.
createMapping(aTargetRange, aPrimitiveRange);
861 rClipRange = aPrimitiveRange;
871 rMarkerTransform.
scale(fStrokeWidth, fStrokeWidth);
887 aRefPoint *= rMarkerTransform;
910 if(!(pStart || pMid || pEnd))
913 const sal_uInt32 nSubPathCount(rPath.
count());
929 for (sal_uInt32
a(0);
a < nSubPathCount;
a++)
933 const sal_uInt32 nSubPolygonPointCount(aSubPolygonPath.
count());
934 const bool bSubPolygonPathIsClosed(aSubPolygonPath.
isClosed());
936 if(nSubPolygonPointCount)
940 const sal_uInt32 nTargetMarkerCount(bSubPolygonPathIsClosed ? nSubPolygonPointCount + 1 : nSubPolygonPointCount);
942 for (sal_uInt32 b(0); b < nTargetMarkerCount; b++)
944 const bool bIsFirstMarker(!
a && !b);
945 const bool bIsLastMarker(nSubPathCount - 1 ==
a && nTargetMarkerCount - 1 == b);
953 else if(bIsLastMarker)
964 if(pHelpPointIndices && !pHelpPointIndices->
empty())
969 if(aFound != pHelpPointIndices->
end())
982 if(pPrepared != pNeeded)
985 if(
prepare_singleMarker(aPreparedMarkerPrimitives, aPreparedMarkerTransform, aPreparedMarkerClipRange, *pNeeded))
992 OSL_ENSURE(
false,
"OOps, could not prepare given marker as primitives (!)");
1005 const sal_uInt32 nPointIndex(b % nSubPolygonPointCount);
1023 const bool bEntering(!aEntering.
equalZero());
1024 const bool bLeaving(!aLeaving.
equalZero());
1026 if(bEntering || bLeaving)
1048 const double fAngle(atan2(aSum.
getY(), aSum.
getX()));
1051 aCombinedTransform.
rotate(fAngle);
1072 if(!aPreparedMarkerClipRange.
isEmpty())
1077 aClipPolygon.
transform(aCombinedTransform);
1079 std::move(aClipPolygon),
1120 const bool bIsTwoPointLine(1 == rPath.
count()
1123 const bool bIsLine(bIsTwoPointLine || bNoWidth || bNoHeight);
1166 const std::optional<basegfx::B2DHomMatrix>& pTransform)
const
1195 std::move(aSource)));
1204 pClip->
apply(aSource, pTransform);
1208 if(!aSource.empty())
1213 pFilter->
apply(aSource);
1217 if(!aSource.empty())
1224 pMask->
apply(aSource, pTransform);
1241 if(
"Page" == aOwnerClass)
1247 const OUString aParentClass(*pParent->
getClass());
1249 if(
"Slide" == aParentClass)
1255 std::move(aSource)));
1263 if(!aSource.empty())
1272 mpCssStyleParent(nullptr),
1273 maStopColor(
basegfx::BColor(0.0, 0.0, 0.0), true),
1287 maBaselineShiftNumber(0),
1288 maResolvingParent(29, 0),
1290 mbStrokeDasharraySet(false)
1308 const OUString& aContent)
1321 if(aOpacity.
isSet())
1326 else if(!
aURL.isEmpty())
1344 if(!aContent.isEmpty())
1366 if(aOpacity.
isSet())
1371 else if(!
aURL.isEmpty())
1379 if(!aContent.isEmpty())
1413 if(!aContent.isEmpty())
1432 if(!aContent.isEmpty())
1495 if(aOpacity.
isSet())
1531 if(!aContent.isEmpty())
1591 if(!aContent.isEmpty())
1642 if(!aContent.isEmpty())
1665 if(!aContent.isEmpty())
1724 if(!aContent.isEmpty())
1759 if(!aContent.isEmpty())
1778 if(!aContent.isEmpty())
1808 if(aOpacity.
isSet())
1827 if(!aContent.isEmpty())
1875 if(!aContent.isEmpty())
1919 if(!aContent.isEmpty())
1927 if(!aContent.isEmpty())
2070 auto ret = pSvgStyleAttributes->
getStroke();
2285 if (pSvgStyleAttributes && pSvgStyleAttributes->
maOpacity.
isSet())
2331 const OUString aClass(*pParent->
getClass());
2333 if(
"SlideGroup" == aClass)
2547 return aDefaultSize;
2556 if(pSvgStyleAttributes)
2574 if(pSvgStyleAttributes)
2608 if(pSvgStyleAttributes)
2627 if(pSvgStyleAttributes)
2646 if(pSvgStyleAttributes)
2827 OSL_ENSURE(
false,
"Svg error: current color uses current color (!)");
2842 auto ret = pSvgStyleAttributes->
getColor();
2864 if (pSvgStyleAttributes)
2877 if(!aClipPath.isEmpty())
2897 if (pSvgStyleAttributes)
2910 if(!aFilter.isEmpty())
2930 if (pSvgStyleAttributes)
2943 if(!aMask.isEmpty())
2974 if(!aMarker.isEmpty())
3005 if(!aMarker.isEmpty())
3036 if(!aMarker.isEmpty())
void rotate(double fRadiant)
void translate(double fX, double fY)
void scale(double fX, double fY)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
B2DRange getB2DRange() const
bool areControlPointsUsed() const
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
bool equal(const Tuple2D< TYPE > &rTup) const
void process(const primitive2d::Primitive2DContainer &rSource)
std::vector< Value >::const_iterator const_iterator
const_iterator find(const Value &x) const
const_iterator end() const
bool isMeetOrSlice() const
basegfx::B2DHomMatrix createMapping(const basegfx::B2DRange &rTarget, const basegfx::B2DRange &rSource) const
static basegfx::B2DHomMatrix createLinearMapping(const basegfx::B2DRange &rTarget, const basegfx::B2DRange &rSource)
tooling
virtual const SvgStyleAttributes * getSvgStyleAttributes() const override
void apply(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const std::optional< basegfx::B2DHomMatrix > &pTransform) const
apply contained clipPath to given geometry #i124852# transform may be needed
const SvgNode * findSvgNodeById(const OUString &rStr) const
find a node by its Id
virtual void apply(drawinglayer::primitive2d::Primitive2DContainer &rTarget) const
SvgNumber getY2() const
y2 content
SvgNumber getX1() const
x1 content
SvgUnits getGradientUnits() const
gradientUnits content
SvgNumber getCy() const
Cy content.
void collectGradientEntries(drawinglayer::primitive2d::SvgGradientEntryVector &aVector) const
collect gradient stop entries
const SvgNumber * getFy() const
Fy content.
SvgNumber getCx() const
Cx content.
SvgNumber getX2() const
x2 content
drawinglayer::primitive2d::SpreadMethod getSpreadMethod() const
SpreadMethod content.
SvgNumber getY1() const
y1 content
std::optional< basegfx::B2DHomMatrix > getGradientTransform() const
transform content, set if found in current context
const SvgNumber * getFx() const
Fx content.
SvgNumber getR() const
R content.
const SvgNumber & getMarkerHeight() const
MarkerHeight content, set if found in current context.
const SvgNumber & getRefX() const
RefX content, set if found in current context.
const SvgAspectRatio & getSvgAspectRatio() const
SvgAspectRatio content.
const drawinglayer::primitive2d::Primitive2DContainer & getMarkerPrimitives() const
get marker primitives buffered, uses decomposeSvgNode internally
const SvgNumber & getMarkerWidth() const
MarkerWidth content, set if found in current context.
const basegfx::B2DRange * getViewBox() const
viewBox content
const SvgNumber & getRefY() const
RefY content, set if found in current context.
double getAngle() const
Angle content, set if found in current context.
MarkerOrient getMarkerOrient() const
MarkerOrient content.
MarkerUnits getMarkerUnits() const
MarkerUnits content.
void apply(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const std::optional< basegfx::B2DHomMatrix > &pTransform) const
apply contained clipPath to given geometry #i124852# transform may be needed
virtual bool supportsParentStyle() const
#i125258# tell if this node is allowed to have a parent style (e.g. defs do not)
SVGToken getType() const
basic data read access
const SvgNode * getParent() const
std::optional< OUString > const & getClass() const
Class access.
virtual const SvgStyleAttributes * getSvgStyleAttributes() const
bool hasLocalCssStyle()
Check if there is a local css style.
const SvgDocument & getDocument() const
void setDisplay(Display eDisplay)
double solve(const InfoProvider &rInfoProvider, NumberType aNumberType=NumberType::length) const
const basegfx::BColor & getBColor() const
const SvgUnits * getPatternContentUnits() const
PatternContentUnits content.
const SvgAspectRatio & getSvgAspectRatio() const
SvgAspectRatio content.
std::optional< basegfx::B2DHomMatrix > getPatternTransform() const
PatternTransform content.
const basegfx::B2DRange * getViewBox() const
viewBox content
void getValuesRelative(double &rfX, double &rfY, double &rfW, double &rfH, const basegfx::B2DRange &rGeoRange, SvgNode const &rUser) const
global helpers
const drawinglayer::primitive2d::Primitive2DContainer & getPatternPrimitives() const
get pattern primitives buffered, uses decomposeSvgNode internally
const SvgStyleAttributes * getParentStyle() const
OUString maMarkerStartXLink
link to markers. If set, the node can be fetched on demand
void add_fillPatternTransform(const basegfx::B2DPolyPolygon &rPath, drawinglayer::primitive2d::Primitive2DContainer &rTarget, const SvgPatternNode &rFillGradient, const basegfx::B2DRange &rGeoRange) const
void setFontWeight(const FontWeight aFontWeight)
void setStrokeLinejoin(const StrokeLinejoin aStrokeLinejoin)
void add_fill(const basegfx::B2DPolyPolygon &rPath, drawinglayer::primitive2d::Primitive2DContainer &rTarget, const basegfx::B2DRange &rGeoRange) const
const SvgStyleAttributes * getCssStyleParent() const
SvgNumber getFillOpacity() const
fill opacity content
SvgNumber getOpacity() const
Opacity content.
FontStretch maFontStretch
const basegfx::BColor * getCurrentColor() const
Resolve current color (defaults to black if no color is specified)
StrokeLinejoin maStrokeLinejoin
OUString getMarkerEndXLink() const
const basegfx::BColor * getColor() const
Color content.
OUString maMarkerMidXLink
FillRule maFillRule
fill rule
const basegfx::BColor * getFill() const
OUString getMarkerStartXLink() const
void add_fillGradient(const basegfx::B2DPolyPolygon &rPath, drawinglayer::primitive2d::Primitive2DContainer &rTarget, const SvgGradientNode &rFillGradient, const basegfx::B2DRange &rGeoRange) const
internal helpers
SvgNumber getStrokeOpacity() const
StrokeOpacity content.
SvgNumber maFontSizeNumber
SvgStringVector maFontFamily
FillRule getFillRule() const
fill rule content
const SvgStyleAttributes * getTextDecorationDefiningSvgStyleAttributes() const
TextDecoration content.
void setTextAlign(const TextAlign aTextAlign)
void add_fillPattern(const basegfx::B2DPolyPolygon &rPath, drawinglayer::primitive2d::Primitive2DContainer &rTarget, const SvgPatternNode &rFillGradient, const basegfx::B2DRange &rGeoRange) const
const SvgFilterNode * accessFilterXLink() const
StrokeLinejoin getStrokeLinejoin() const
StrokeLinejoin content.
SvgNumber getStrokeMiterLimit() const
StrokeMiterLimit content.
const basegfx::BColor * getStroke() const
stroke content
void add_postProcess(drawinglayer::primitive2d::Primitive2DContainer &rTarget, drawinglayer::primitive2d::Primitive2DContainer &&rSource, const std::optional< basegfx::B2DHomMatrix > &pTransform) const
const SvgStringVector & getFontFamily() const
Font content.
TextDecoration maTextDecoration
SvgNumber maBaselineShiftNumber
SvgNumber getStrokeDashOffset() const
StrokeDashOffset content.
const SvgPatternNode * getSvgPatternNodeFill() const
access to evtl. set fill pattern
void add_path(const basegfx::B2DPolyPolygon &rPath, drawinglayer::primitive2d::Primitive2DContainer &rTarget, const basegfx::utils::PointIndexSet *pHelpPointIndices) const
SvgNumber getStopOpacity() const
stop opacity content
void setVisibility(const Visibility aVisibility)
void setTextAnchor(const TextAnchor aTextAnchor)
const SvgMaskNode * accessMaskXLink() const
TextAlign getTextAlign() const
TextAlign content.
void setFontStyle(const FontStyle aFontStyle)
SvgNumber getStrokeWidth() const
stroke-width content
void add_stroke(const basegfx::B2DPolyPolygon &rPath, drawinglayer::primitive2d::Primitive2DContainer &rTarget, const basegfx::B2DRange &rGeoRange) const
const SvgMarkerNode * accessMarkerStartXLink() const
void setFontStretch(const FontStretch aFontStretch)
SvgNumber maStrokeOpacity
void setFill(const SvgPaint &rFill)
FontStyle getFontStyle() const
FontStyle content.
const basegfx::BColor & getStopColor() const
stop color content
const SvgMarkerNode * accessMarkerEndXLink() const
void setFontSize(const FontSize aFontSize)
FontSize content.
void parseStyleAttribute(SVGToken aSVGToken, const OUString &rContent)
local attribute scanner
StrokeLinecap getStrokeLinecap() const
StrokeLinecap content.
OUString getClipPathXLink() const
void add_markers(const basegfx::B2DPolyPolygon &rPath, drawinglayer::primitive2d::Primitive2DContainer &rTarget, const basegfx::utils::PointIndexSet *pHelpPointIndices) const
void setStrokeLinecap(const StrokeLinecap aStrokeLinecap)
TextDecoration getTextDecoration() const
const SvgMarkerNode * accessMarkerMidXLink() const
SvgNumber maStrokeDashOffset
bool isFillSet() const
fill content
const SvgGradientNode * getSvgGradientNodeFill() const
access to evtl. set fill gradient
FontWeight getFontWeight() const
FontWeight content.
void setOpacity(const SvgNumber &rOpacity)
Visibility getVisibility() const
Visibility.
SvgNumberVector maStrokeDasharray
const SvgPatternNode * getSvgPatternNodeStroke() const
access to evtl. set stroke pattern
FontStretch getFontStretch() const
FontStretch content.
SvgNumber getFontSizeNumber() const
void setBaselineShift(const BaselineShift aBaselineShift)
const SvgClipPathNode * accessClipPathXLink() const
bool mbStrokeDasharraySet
OUString getMarkerMidXLink() const
const SvgNumberVector & getStrokeDasharray() const
fill StrokeDasharray content
SvgNumber maStrokeMiterLimit
SvgStyleAttributes(SvgNode &rOwner)
void setTextDecoration(const TextDecoration aTextDecoration)
OUString maClipPathXLink
link to content. If set, the node can be fetched on demand
TextAnchor getTextAnchor() const
TextAnchor content.
StrokeLinecap maStrokeLinecap
FillRule getClipRule() const
clip rule content
bool prepare_singleMarker(drawinglayer::primitive2d::Primitive2DContainer &rMarkerPrimitives, basegfx::B2DHomMatrix &rMarkerTransform, basegfx::B2DRange &rClipRange, const SvgMarkerNode &rMarker) const
SvgNumber getBaselineShiftNumber() const
void add_text(drawinglayer::primitive2d::Primitive2DContainer &rTarget, drawinglayer::primitive2d::Primitive2DContainer &&rSource) const
helper which does the necessary with a given path
OUString getFilterXLink() const
void readCssStyle(std::u16string_view rCandidate)
scan helpers
std::vector< sal_uInt16 > maResolvingParent
OUString maMarkerEndXLink
OUString getMaskXLink() const
const SvgGradientNode * getSvgGradientNodeStroke() const
access to evtl. set stroke gradient
bool solve(Matrix &matrix, int rows, int cols, Vector &result, BaseType minPivot)
Sequence< sal_Int8 > aSeq
B2DPolyPolygon createNonzeroConform(const B2DPolyPolygon &rCandidate)
double getLength(const B2DPolygon &rCandidate)
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
B2DPolygon createPolygonFromCircle(const B2DPoint &rCenter, double fRadius)
B2DVector getTangentLeavingPoint(const B2DPolygon &rCandidate, sal_uInt32 nIndex)
B2DVector getTangentEnteringPoint(const B2DPolygon &rCandidate, sal_uInt32 nIndex)
B2DPolyPolygon mergeToSinglePolyPolygon(const B2DPolyPolygonVector &rInput)
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
::std::vector< SvgGradientEntry > SvgGradientEntryVector
::std::vector< TextAsPolygonDataNode > TextAsPolygonDataNodeVector
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
FontStretch getWider(FontStretch aSource)
void skip_char(std::u16string_view rCandidate, sal_Unicode nChar, sal_Int32 &nPos, const sal_Int32 nLen)
static basegfx::B2DLineJoin StrokeLinejoinToB2DLineJoin(StrokeLinejoin aStrokeLinejoin)
SVGToken StrToSVGToken(const OUString &rStr, bool bCaseIndependent)
::std::vector< double > solveSvgNumberVector(const SvgNumberVector &rInput, const InfoProvider &rInfoProvider)
FontWeight getLighter(FontWeight aSource)
::std::vector< OUString > SvgStringVector
::FontWeight getVclFontWeight(FontWeight aSource)
bool readSingleNumber(std::u16string_view rCandidate, SvgNumber &aNum)
void copyToLimiter(std::u16string_view rCandidate, sal_Unicode nLimiter, sal_Int32 &nPos, OUStringBuffer &rTarget, const sal_Int32 nLen)
std::vector< SvgNumber > SvgNumberVector
bool readSvgNumberVector(std::u16string_view rCandidate, SvgNumberVector &rSvgNumberVector)
bool readSvgPaint(const OUString &rCandidate, SvgPaint &rSvgPaint, OUString &rURL, SvgNumber &rOpacity)
bool readLocalUrl(const OUString &rCandidate, OUString &rURL)
FontWeight getBolder(FontWeight aSource)
FontStretch getNarrower(FontStretch aSource)
Display getDisplayFromContent(std::u16string_view aContent)
static css::drawing::LineCap StrokeLinecapToDrawingLineCap(StrokeLinecap aStrokeLinecap)
bool readSvgStringVector(std::u16string_view rCandidate, SvgStringVector &rSvgStringVector)
void copyString(std::u16string_view rCandidate, sal_Int32 &nPos, OUStringBuffer &rTarget, const sal_Int32 nLen)
bool getType(BSTR name, Type &type)
const basegfx::B2DPolyPolygon & getB2DPolyPolygon() const
static constexpr OUStringLiteral aStrEvenOdd
static constexpr OUStringLiteral aStrNonzero
const int nStyleDepthLimit