Kaydet (Commit) 58072c5a authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:expandablemethodds in svgio

Change-Id: Iac2aa6dae56d96819589d198be5875ecfe14f26f
Reviewed-on: https://gerrit.libreoffice.org/30056Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 40fc2c1a
......@@ -51,15 +51,12 @@ namespace svgio
/// Cx content, set if found in current context
const SvgNumber& getCx() const { return maCx; }
void setCx(const SvgNumber& rCx) { maCx = rCx; }
/// Cy content, set if found in current context
const SvgNumber& getCy() const { return maCy; }
void setCy(const SvgNumber& rCy) { maCy = rCy; }
/// R content, set if found in current context
const SvgNumber& getR() const { return maR; }
void setR(const SvgNumber& rR) { maR = rR; }
/// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
......
......@@ -52,19 +52,15 @@ namespace svgio
/// Cx content, set if found in current context
const SvgNumber& getCx() const { return maCx; }
void setCx(const SvgNumber& rCx) { maCx = rCx; }
/// Cy content, set if found in current context
const SvgNumber& getCy() const { return maCy; }
void setCy(const SvgNumber& rCy) { maCy = rCy; }
/// Rx content, set if found in current context
const SvgNumber& getRx() const { return maRx; }
void setRx(const SvgNumber& rRx) { maRx = rRx; }
/// Ry content, set if found in current context
const SvgNumber& getRy() const { return maRy; }
void setRy(const SvgNumber& rRy) { maRy = rRy; }
/// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
......
......@@ -76,39 +76,30 @@ namespace svgio
/// x1 content
const SvgNumber getX1() const;
void setX1(const SvgNumber& rX1) { maX1 = rX1; }
/// y1 content
const SvgNumber getY1() const;
void setY1(const SvgNumber& rY1) { maY1 = rY1; }
/// x2 content
const SvgNumber getX2() const;
void setX2(const SvgNumber& rX2) { maX2 = rX2; }
/// y2 content
const SvgNumber getY2() const;
void setY2(const SvgNumber& rY2) { maY2 = rY2; }
/// Cx content
const SvgNumber getCx() const;
void setCx(const SvgNumber& rCx) { maCx = rCx; }
/// Cy content
const SvgNumber getCy() const;
void setCy(const SvgNumber& rCy) { maCy = rCy; }
/// R content
const SvgNumber getR() const;
void setR(const SvgNumber& rR) { maR = rR; }
/// Fx content
const SvgNumber* getFx() const;
void setFx(const SvgNumber& rFx) { maFx = rFx; }
/// Fy content
const SvgNumber* getFy() const;
void setFy(const SvgNumber& rFy) { maFy = rFy; }
/// gradientUnits content
SvgUnits getGradientUnits() const { return maGradientUnits; }
......
......@@ -47,7 +47,6 @@ namespace svgio
/// offset content
const SvgNumber& getOffset() const { return maOffset; }
void setOffset(const SvgNumber& rOffset) { maOffset = rOffset; }
};
} // end of namespace svgreader
} // end of namespace svgio
......
......@@ -57,29 +57,21 @@ namespace svgio
virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override;
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override;
/// SvgAspectRatio content
const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; }
void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio) { maSvgAspectRatio = rSvgAspectRatio; }
/// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
void setTransform(const basegfx::B2DHomMatrix* pMatrix) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); }
/// x content, set if found in current context
const SvgNumber& getX() const { return maX; }
void setX(const SvgNumber& rX) { maX = rX; }
/// y content, set if found in current context
const SvgNumber& getY() const { return maY; }
void setY(const SvgNumber& rY) { maY = rY; }
/// width content, set if found in current context
const SvgNumber& getWidth() const { return maWidth; }
void setWidth(const SvgNumber& rWidth) { maWidth = rWidth; }
/// height content, set if found in current context
const SvgNumber& getHeight() const { return maHeight; }
void setHeight(const SvgNumber& rHeight) { maHeight = rHeight; }
};
} // end of namespace svgreader
} // end of namespace svgio
......
......@@ -52,19 +52,15 @@ namespace svgio
/// X1 content, set if found in current context
const SvgNumber& getX1() const { return maX1; }
void setX1(const SvgNumber& rX1) { maX1 = rX1; }
/// Y1 content, set if found in current context
const SvgNumber& getY1() const { return maY1; }
void setY1(const SvgNumber& rY1) { maY1 = rY1; }
/// X2 content, set if found in current context
const SvgNumber& getX2() const { return maX2; }
void setX2(const SvgNumber& rX2) { maX2 = rX2; }
/// Y2 content, set if found in current context
const SvgNumber& getY2() const { return maY2; }
void setY2(const SvgNumber& rY2) { maY2 = rY2; }
/// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
......
......@@ -76,15 +76,12 @@ namespace svgio
/// SvgAspectRatio content
const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; }
void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio) { maSvgAspectRatio = rSvgAspectRatio; }
/// RefX content, set if found in current context
const SvgNumber& getRefX() const { return maRefX; }
void setRefX(const SvgNumber& rRefX) { maRefX = rRefX; }
/// RefY content, set if found in current context
const SvgNumber& getRefY() const { return maRefY; }
void setRefY(const SvgNumber& rRefY) { maRefY = rRefY; }
/// MarkerUnits content
MarkerUnits getMarkerUnits() const { return maMarkerUnits; }
......@@ -92,11 +89,9 @@ namespace svgio
/// MarkerWidth content, set if found in current context
const SvgNumber& getMarkerWidth() const { return maMarkerWidth; }
void setMarkerWidth(const SvgNumber& rMarkerWidth) { maMarkerWidth = rMarkerWidth; }
/// MarkerHeight content, set if found in current context
const SvgNumber& getMarkerHeight() const { return maMarkerHeight; }
void setMarkerHeight(const SvgNumber& rMarkerHeight) { maMarkerHeight = rMarkerHeight; }
/// Angle content, set if found in current context
double getAngle() const { return mfAngle; }
......@@ -104,7 +99,6 @@ namespace svgio
/// OrientAuto content, set if found in current context
bool getOrientAuto() const { return mbOrientAuto; }
void setOrientAuto() { mbOrientAuto = true; }
};
} // end of namespace svgreader
......
......@@ -59,30 +59,24 @@ namespace svgio
/// x content, set if found in current context
const SvgNumber& getX() const { return maX; }
void setX(const SvgNumber& rX) { maX = rX; }
/// y content, set if found in current context
const SvgNumber& getY() const { return maY; }
void setY(const SvgNumber& rY) { maY = rY; }
/// width content, set if found in current context
const SvgNumber& getWidth() const { return maWidth; }
void setWidth(const SvgNumber& rWidth) { maWidth = rWidth; }
/// height content, set if found in current context
const SvgNumber& getHeight() const { return maHeight; }
void setHeight(const SvgNumber& rHeight) { maHeight = rHeight; }
/// transform content
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
void setTransform(const basegfx::B2DHomMatrix* pMatrix) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); }
/// MaskUnits content
SvgUnits getMaskUnits() const { return maMaskUnits; }
void setMaskUnits(const SvgUnits aMaskUnits) { maMaskUnits = aMaskUnits; }
/// MaskContentUnits content
SvgUnits getMaskContentUnits() const { return maMaskContentUnits; }
void setMaskContentUnits(const SvgUnits aMaskContentUnits) { maMaskContentUnits = aMaskContentUnits; }
};
} // end of namespace svgreader
......
......@@ -60,7 +60,6 @@ namespace svgio
/// PathLength content
const SvgNumber& getPathLength() const { return maPathLength; }
void setPathLength(const SvgNumber& rPathLength) { maPathLength = rPathLength; }
};
} // end of namespace svgreader
} // end of namespace svgio
......
......@@ -80,23 +80,18 @@ namespace svgio
/// SvgAspectRatio content
const SvgAspectRatio& getSvgAspectRatio() const;
void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio) { maSvgAspectRatio = rSvgAspectRatio; }
/// X content, set if found in current context
const SvgNumber& getX() const;
void setX(const SvgNumber& rX) { maX = rX; }
/// Y content, set if found in current context
const SvgNumber& getY() const;
void setY(const SvgNumber& rY) { maY = rY; }
/// Width content, set if found in current context
const SvgNumber& getWidth() const;
void setWidth(const SvgNumber& rWidth) { maWidth = rWidth; }
/// Height content, set if found in current context
const SvgNumber& getHeight() const;
void setHeight(const SvgNumber& rHeight) { maHeight = rHeight; }
/// PatternUnits content
const SvgUnits* getPatternUnits() const;
......
......@@ -51,11 +51,7 @@ namespace svgio
virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override;
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override;
/// type read access
bool isPolyline() const { return mbIsPolyline; }
/// Polygon content, set if found in current context
const basegfx::B2DPolygon* getPolygon() const { return mpPolygon; }
void setPolygon(const basegfx::B2DPolygon* pPolygon) { if(mpPolygon) delete mpPolygon; mpPolygon = nullptr; if(pPolygon) mpPolygon = new basegfx::B2DPolygon(*pPolygon); }
/// transform content, set if found in current context
......
......@@ -54,27 +54,21 @@ namespace svgio
/// x content, set if found in current context
const SvgNumber& getX() const { return maX; }
void setX(const SvgNumber& rX) { maX = rX; }
/// y content, set if found in current context
const SvgNumber& getY() const { return maY; }
void setY(const SvgNumber& rY) { maY = rY; }
/// width content, set if found in current context
const SvgNumber& getWidth() const { return maWidth; }
void setWidth(const SvgNumber& rWidth) { maWidth = rWidth; }
/// height content, set if found in current context
const SvgNumber& getHeight() const { return maHeight; }
void setHeight(const SvgNumber& rHeight) { maHeight = rHeight; }
/// Rx content, set if found in current context
const SvgNumber& getRx() const { return maRx; }
void setRx(const SvgNumber& rRx) { maRx = rRx; }
/// Ry content, set if found in current context
const SvgNumber& getRy() const { return maRy; }
void setRy(const SvgNumber& rRy) { maRy = rRy; }
/// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
......
......@@ -318,50 +318,36 @@ namespace svgio
/// stroke content
const basegfx::BColor* getStroke() const;
void setStroke(const SvgPaint& rStroke) { maStroke = rStroke; }
/// stop color content
const basegfx::BColor& getStopColor() const;
void setStopColor(const SvgPaint& rStopColor) { maStopColor = rStopColor; }
/// stroke-width content
SvgNumber getStrokeWidth() const;
void setStrokeWidth(const SvgNumber& rStrokeWidth) { maStrokeWidth = rStrokeWidth; }
/// stop opacity content
SvgNumber getStopOpacity() const;
void setStopOpacity(const SvgNumber& rStopOpacity) { maStopOpacity = rStopOpacity; }
/// access to evtl. set fill gradient
const SvgGradientNode* getSvgGradientNodeFill() const;
void setSvgGradientNodeFill(const SvgGradientNode* pNew) { mpSvgGradientNodeFill = pNew; }
/// access to evtl. set fill pattern
const SvgPatternNode* getSvgPatternNodeFill() const;
void setSvgPatternNodeFill(const SvgPatternNode* pNew) { mpSvgPatternNodeFill = pNew; }
/// access to evtl. set stroke gradient
const SvgGradientNode* getSvgGradientNodeStroke() const;
void setSvgGradientNodeStroke(const SvgGradientNode* pNew) { mpSvgGradientNodeStroke = pNew; }
/// access to evtl. set stroke pattern
const SvgPatternNode* getSvgPatternNodeStroke() const;
void setSvgPatternNodeStroke(const SvgPatternNode* pNew) { mpSvgPatternNodeStroke = pNew; }
/// fill opacity content
SvgNumber getFillOpacity() const;
void setFillOpacity(const SvgNumber& rFillOpacity) { maFillOpacity = rFillOpacity; }
/// fill rule content
FillRule getFillRule() const;
/// fill StrokeDasharray content
const SvgNumberVector& getStrokeDasharray() const;
void setStrokeDasharray(const SvgNumberVector& rStrokeDasharray) { maStrokeDasharray = rStrokeDasharray; }
/// #121221# StrokeDasharray needs a set state, it *may* be set to empty by purpose
bool getStrokeDasharraySet() const { return mbStrokeDasharraySet; }
void setStrokeDasharraySet(bool bNew) { mbStrokeDasharraySet = bNew; }
/// StrokeDashOffset content
SvgNumber getStrokeDashOffset() const;
......@@ -381,15 +367,12 @@ namespace svgio
/// StrokeOpacity content
SvgNumber getStrokeOpacity() const;
void setStrokeOpacity(const SvgNumber& rStrokeOpacity) { maStrokeOpacity = rStrokeOpacity; }
/// Font content
const SvgStringVector& getFontFamily() const;
void setFontFamily(const SvgStringVector& rSvgStringVector) { maFontFamily = rSvgStringVector; }
/// FontSize content
void setFontSize(const FontSize aFontSize) { maFontSize = aFontSize; }
void setFontSizeNumber(const SvgNumber& rFontSize) { maFontSizeNumber = rFontSize; }
SvgNumber getFontSizeNumber() const;
/// FontStretch content
......@@ -422,7 +405,6 @@ namespace svgio
/// Color content
const basegfx::BColor* getColor() const;
void setColor(const SvgPaint& rColor) { maColor = rColor; }
/// Resolve current color (defaults to black if no color is specified)
const basegfx::BColor* getCurrentColor() const;
......@@ -437,11 +419,9 @@ namespace svgio
// Title content
const OUString& getTitle() const { return maTitle; }
void setTitle(const OUString& rNew) { maTitle = rNew; }
// Desc content
const OUString& getDesc() const { return maDesc; }
void setDesc(const OUString& rNew) { maDesc = rNew; }
// ClipPathXLink content
OUString getClipPathXLink() const;
......
......@@ -75,26 +75,18 @@ namespace svgio
/// SvgAspectRatio content
const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; }
void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio) { maSvgAspectRatio = rSvgAspectRatio; }
/// x content
const SvgNumber& getX() const { return maX; }
void setX(const SvgNumber& rX) { maX = rX; }
/// y content
const SvgNumber& getY() const { return maY; }
void setY(const SvgNumber& rY) { maY = rY; }
/// width content
const SvgNumber& getWidth() const { return maWidth; }
void setWidth(const SvgNumber& rWidth) { maWidth = rWidth; }
/// height content
const SvgNumber& getHeight() const { return maHeight; }
void setHeight(const SvgNumber& rHeight) { maHeight = rHeight; }
/// version content
void setVersion(const SvgNumber& rVersion) { maVersion = rVersion; }
};
} // end of namespace svgreader
} // end of namespace svgio
......
......@@ -47,9 +47,6 @@ namespace svgio
/// viewBox content
void setViewBox(const basegfx::B2DRange* pViewBox) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); }
/// SvgAspectRatio content
void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio) { maSvgAspectRatio = rSvgAspectRatio; }
};
} // end of namespace svgreader
} // end of namespace svgio
......
......@@ -63,9 +63,6 @@ namespace svgio
/// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
void setTransform(const basegfx::B2DHomMatrix* pMatrix) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); }
/// access to SvgTextPositions
const SvgTextPositions& getSvgTextPositions() const { return maSvgTextPositions; }
};
} // end of namespace svgreader
} // end of namespace svgio
......
......@@ -60,7 +60,6 @@ namespace svgio
/// StartOffset content
const SvgNumber& getStartOffset() const { return maStartOffset; }
void setStartOffset(const SvgNumber& rStartOffset) { maStartOffset = rStartOffset; }
/// Method content
void setMethod(bool bNew) { mbMethod = bNew; }
......
......@@ -60,17 +60,10 @@ namespace svgio
/// x content
const SvgNumber& getX() const { return maX; }
void setX(const SvgNumber& rX) { maX = rX; }
/// y content
const SvgNumber& getY() const { return maY; }
void setY(const SvgNumber& rY) { maY = rY; }
/// width content
void setWidth(const SvgNumber& rWidth) { maWidth = rWidth; }
/// height content
void setHeight(const SvgNumber& rHeight) { maHeight = rHeight; }
};
} // end of namespace svgreader
} // end of namespace svgio
......
......@@ -69,7 +69,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setCx(aNum);
maCx = aNum;
}
break;
}
......@@ -79,7 +79,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setCy(aNum);
maCy = aNum;
}
break;
}
......@@ -91,7 +91,7 @@ namespace svgio
{
if(aNum.isPositive())
{
setR(aNum);
maR = aNum;
}
}
break;
......
......@@ -70,7 +70,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setCx(aNum);
maCx = aNum;
}
break;
}
......@@ -80,7 +80,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setCy(aNum);
maCy = aNum;
}
break;
}
......@@ -92,7 +92,7 @@ namespace svgio
{
if(aNum.isPositive())
{
setRx(aNum);
maRx = aNum;
}
}
break;
......@@ -105,7 +105,7 @@ namespace svgio
{
if(aNum.isPositive())
{
setRy(aNum);
maRy = aNum;
}
}
break;
......
......@@ -95,7 +95,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setX1(aNum);
maX1 = aNum;
}
break;
}
......@@ -105,7 +105,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setY1(aNum);
maY1 = aNum;
}
break;
}
......@@ -115,7 +115,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setX2(aNum);
maX2 = aNum;
}
break;
}
......@@ -125,7 +125,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setY2(aNum);
maY2 = aNum;
}
break;
}
......@@ -135,7 +135,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setCx(aNum);
maCx = aNum;
}
break;
}
......@@ -145,7 +145,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setCy(aNum);
maCy = aNum;
}
break;
}
......@@ -155,7 +155,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setFx(aNum);
maFx = aNum;
}
break;
}
......@@ -165,7 +165,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setFy(aNum);
maFy = aNum;
}
break;
}
......@@ -177,7 +177,7 @@ namespace svgio
{
if(aNum.isPositive())
{
setR(aNum);
maR = aNum;
}
}
break;
......
......@@ -67,7 +67,7 @@ namespace svgio
{
if(aNum.isPositive())
{
setOffset(aNum);
maOffset = aNum;
}
}
break;
......
......@@ -83,7 +83,7 @@ namespace svgio
}
case SVGTokenPreserveAspectRatio:
{
setSvgAspectRatio(readSvgAspectRatio(aContent));
maSvgAspectRatio = readSvgAspectRatio(aContent);
break;
}
case SVGTokenTransform:
......@@ -102,7 +102,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setX(aNum);
maX = aNum;
}
break;
}
......@@ -112,7 +112,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setY(aNum);
maY = aNum;
}
break;
}
......@@ -124,7 +124,7 @@ namespace svgio
{
if(aNum.isPositive())
{
setWidth(aNum);
maWidth = aNum;
}
}
break;
......@@ -137,7 +137,7 @@ namespace svgio
{
if(aNum.isPositive())
{
setHeight(aNum);
maHeight = aNum;
}
}
break;
......@@ -322,7 +322,7 @@ namespace svgio
else
{
// create mapping
const SvgAspectRatio& rRatio = getSvgAspectRatio();
const SvgAspectRatio& rRatio = maSvgAspectRatio;
// even when ratio is not set, use the defaults
// let mapping be created from SvgAspectRatio
......
......@@ -70,7 +70,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setX1(aNum);
maX1 = aNum;
}
break;
}
......@@ -80,7 +80,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setY1(aNum);
maY1 = aNum;
}
break;
}
......@@ -90,7 +90,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setX2(aNum);
maX2 = aNum;
}
break;
}
......@@ -100,7 +100,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setY2(aNum);
maY2 = aNum;
}
break;
}
......
......@@ -79,7 +79,7 @@ namespace svgio
}
case SVGTokenPreserveAspectRatio:
{
setSvgAspectRatio(readSvgAspectRatio(aContent));
maSvgAspectRatio = readSvgAspectRatio(aContent);
break;
}
case SVGTokenRefX:
......@@ -88,7 +88,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setRefX(aNum);
maRefX = aNum;
}
break;
}
......@@ -98,7 +98,7 @@ namespace svgio
if(readSingleNumber(aContent, aNum))
{
setRefY(aNum);
<