no need to allocate SvgUnits separately

it is only one pointer big

Change-Id: Iad5444ed6783abc2916510fd83c5b5a11d17e8f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147950
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2023-02-28 10:01:49 +02:00
parent 4e0db1771a
commit 08a7f95d68
2 changed files with 10 additions and 10 deletions

View File

@@ -43,10 +43,10 @@ namespace svgio::svgreader
SvgNumber maY;
SvgNumber maWidth;
SvgNumber maHeight;
std::unique_ptr<SvgUnits>
mpPatternUnits;
std::unique_ptr<SvgUnits>
mpPatternContentUnits;
std::optional<SvgUnits>
moPatternUnits;
std::optional<SvgUnits>
moPatternContentUnits;
std::optional<basegfx::B2DHomMatrix>
mpaPatternTransform;
@@ -99,11 +99,11 @@ namespace svgio::svgreader
/// PatternUnits content
const SvgUnits* getPatternUnits() const;
void setPatternUnits(const SvgUnits aPatternUnits) { mpPatternUnits.reset( new SvgUnits(aPatternUnits) ); }
void setPatternUnits(const SvgUnits aPatternUnits) { moPatternUnits = aPatternUnits; }
/// PatternContentUnits content
const SvgUnits* getPatternContentUnits() const;
void setPatternContentUnits(const SvgUnits aPatternContentUnits) { mpPatternContentUnits.reset( new SvgUnits(aPatternContentUnits) ); }
void setPatternContentUnits(const SvgUnits aPatternContentUnits) { moPatternContentUnits = aPatternContentUnits; }
/// PatternTransform content
std::optional<basegfx::B2DHomMatrix> getPatternTransform() const;

View File

@@ -402,9 +402,9 @@ namespace svgio::svgreader
const SvgUnits* SvgPatternNode::getPatternUnits() const
{
if(mpPatternUnits)
if(moPatternUnits)
{
return mpPatternUnits.get();
return &*moPatternUnits;
}
const_cast< SvgPatternNode* >(this)->tryToFindLink();
@@ -422,9 +422,9 @@ namespace svgio::svgreader
const SvgUnits* SvgPatternNode::getPatternContentUnits() const
{
if(mpPatternContentUnits)
if(moPatternContentUnits)
{
return mpPatternContentUnits.get();
return &*moPatternContentUnits;
}
const_cast< SvgPatternNode* >(this)->tryToFindLink();