summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-21 07:51:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-01 08:26:24 +0200
commited8152b1ed9baf859966fd21d6641dfba9c4467c (patch)
treeb4f7b372433c5da3b8df41d026ff95fecece9ce6 /xmloff
parent6cb9b06432434fb3257118743780828b3b57326a (diff)
improve loplugin:makeshared
to find places where we are converting stuff to unique_ptr instead of using std::make_shared. As a bonus, this tends to find places where we are using shared_ptr where we can instead be using unique_ptr avoiding the locking overhead. Change-Id: I1b57bbc4a6c766b48bba8e25a55161800e149f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/xexptran.cxx32
1 files changed, 16 insertions, 16 deletions
diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx
index ca9a7a2c55fd..49e003307242 100644
--- a/xmloff/source/draw/xexptran.cxx
+++ b/xmloff/source/draw/xexptran.cxx
@@ -224,19 +224,19 @@ struct ImpSdXMLExpTransObj2DMatrix : public ImpSdXMLExpTransObj2DBase
void SdXMLImExTransform2D::AddRotate(double fNew)
{
if(fNew != 0.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DRotate>(fNew));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DRotate>(fNew));
}
void SdXMLImExTransform2D::AddTranslate(const ::basegfx::B2DTuple& rNew)
{
if(!rNew.equalZero())
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DTranslate>(rNew));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DTranslate>(rNew));
}
void SdXMLImExTransform2D::AddSkewX(double fNew)
{
if(fNew != 0.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DSkewX>(fNew));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DSkewX>(fNew));
}
// gen string for export
@@ -376,7 +376,7 @@ void SdXMLImExTransform2D::SetString(const OUString& rNew, const SvXMLUnitConver
Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
if(fValue != 0.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DRotate>(fValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DRotate>(fValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -390,7 +390,7 @@ void SdXMLImExTransform2D::SetString(const OUString& rNew, const SvXMLUnitConver
aValue.setY(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.getY()));
if(aValue.getX() != 1.0 || aValue.getY() != 1.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DScale>(aValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DScale>(aValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -404,7 +404,7 @@ void SdXMLImExTransform2D::SetString(const OUString& rNew, const SvXMLUnitConver
aValue.setY(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.getY(), true));
if(!aValue.equalZero())
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DTranslate>(aValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DTranslate>(aValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -415,7 +415,7 @@ void SdXMLImExTransform2D::SetString(const OUString& rNew, const SvXMLUnitConver
Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
if(fValue != 0.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DSkewX>(fValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DSkewX>(fValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -426,7 +426,7 @@ void SdXMLImExTransform2D::SetString(const OUString& rNew, const SvXMLUnitConver
Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
if(fValue != 0.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DSkewY>(fValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DSkewY>(fValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -462,7 +462,7 @@ void SdXMLImExTransform2D::SetString(const OUString& rNew, const SvXMLUnitConver
Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
if(!aValue.isIdentity())
- maList.push_back(make_unique<ImpSdXMLExpTransObj2DMatrix>(aValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj2DMatrix>(aValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -604,7 +604,7 @@ struct ImpSdXMLExpTransObj3DMatrix : public ImpSdXMLExpTransObj3DBase
void SdXMLImExTransform3D::AddMatrix(const ::basegfx::B3DHomMatrix& rNew)
{
if(!rNew.isIdentity())
- maList.push_back(make_unique<ImpSdXMLExpTransObj3DMatrix>(rNew));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj3DMatrix>(rNew));
}
void SdXMLImExTransform3D::AddHomogenMatrix(const drawing::HomogenMatrix& xHomMat)
@@ -784,7 +784,7 @@ void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConver
Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
if(fValue != 0.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj3DRotateX>(basegfx::deg2rad(fValue)));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj3DRotateX>(basegfx::deg2rad(fValue)));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -796,7 +796,7 @@ void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConver
Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
if(fValue != 0.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj3DRotateY>(basegfx::deg2rad(fValue)));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj3DRotateY>(basegfx::deg2rad(fValue)));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -808,7 +808,7 @@ void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConver
Imp_SkipSpacesAndOpeningBraces(aStr, nPos, nLen);
fValue = Imp_GetDoubleChar(aStr, nPos, nLen, rConv, fValue);
if(fValue != 0.0)
- maList.push_back(make_unique<ImpSdXMLExpTransObj3DRotateZ>(basegfx::deg2rad(fValue)));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj3DRotateZ>(basegfx::deg2rad(fValue)));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -825,7 +825,7 @@ void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConver
aValue.setZ(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.getZ()));
if(1.0 != aValue.getX() || 1.0 != aValue.getY() || 1.0 != aValue.getZ())
- maList.push_back(make_unique<ImpSdXMLExpTransObj3DScale>(aValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj3DScale>(aValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -842,7 +842,7 @@ void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConver
aValue.setZ(Imp_GetDoubleChar(aStr, nPos, nLen, rConv, aValue.getZ(), true));
if(!aValue.equalZero())
- maList.push_back(make_unique<ImpSdXMLExpTransObj3DTranslate>(aValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj3DTranslate>(aValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}
@@ -902,7 +902,7 @@ void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConver
Imp_SkipSpacesAndCommas(aStr, nPos, nLen);
if(!aValue.isIdentity())
- maList.push_back(make_unique<ImpSdXMLExpTransObj3DMatrix>(aValue));
+ maList.push_back(std::make_shared<ImpSdXMLExpTransObj3DMatrix>(aValue));
Imp_SkipSpacesAndClosingBraces(aStr, nPos, nLen);
}