summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 13:21:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-25 07:06:20 +0100
commita258a043c90eaaa4f6a411318e239e805d087d0c (patch)
tree250eed3d964d3872e02d0d9622ede8b3343ce7ef /svx
parentcee62b1068775b7d0bcd2875e9789c8c36c22057 (diff)
loplugin:makeshared in svl..svx
Change-Id: I067ea2f3cb651fdc5c3d1a09b0c55583618b9d1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87355 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx2
-rw-r--r--svx/source/dialog/framelink.cxx8
-rw-r--r--svx/source/dialog/hdft.cxx20
-rw-r--r--svx/source/dialog/imapwnd.cxx4
-rw-r--r--svx/source/dialog/srchdlg.cxx2
-rw-r--r--svx/source/form/fmscriptingenv.cxx4
-rw-r--r--svx/source/form/sqlparserclient.cxx2
-rw-r--r--svx/source/sdr/attribute/sdrallfillattributeshelper.cxx16
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx2
-rw-r--r--svx/source/sdr/contact/viewobjectcontact.cxx6
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3d.cxx6
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx6
-rw-r--r--svx/source/stbctrls/modctrl.cxx2
-rw-r--r--svx/source/svdraw/svdedxv.cxx4
-rw-r--r--svx/source/svdraw/svdomedia.cxx6
-rw-r--r--svx/source/table/tablertfimporter.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx6
17 files changed, 50 insertions, 48 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
index 4d15cfce2905..2c761e9d7360 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
@@ -1104,7 +1104,7 @@ private:
const ParserContextSharedPtr& getParserContext()
{
- static ParserContextSharedPtr lcl_parserContext( new ParserContext );
+ static ParserContextSharedPtr lcl_parserContext = std::make_shared<ParserContext>();
// clear node stack (since we reuse the static object, that's
// the whole point here)
diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx
index dd6d410532bf..21eea0663987 100644
--- a/svx/source/dialog/framelink.cxx
+++ b/svx/source/dialog/framelink.cxx
@@ -34,7 +34,7 @@ void Style::implEnsureImplStyle()
{
if(!maImplStyle)
{
- maImplStyle.reset(new implStyle());
+ maImplStyle = std::make_shared<implStyle>();
}
}
@@ -44,7 +44,7 @@ Style::Style() :
}
Style::Style( double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale ) :
- maImplStyle(new implStyle())
+ maImplStyle(std::make_shared<implStyle>())
{
maImplStyle->mnType = nType;
maImplStyle->mfPatternScale = fScale;
@@ -52,7 +52,7 @@ Style::Style( double nP, double nD, double nS, SvxBorderLineStyle nType, double
}
Style::Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale ) :
- maImplStyle(new implStyle())
+ maImplStyle(std::make_shared<implStyle>())
{
maImplStyle->mnType = nType;
maImplStyle->mfPatternScale = fScale;
@@ -64,7 +64,7 @@ Style::Style( const editeng::SvxBorderLine* pBorder, double fScale ) :
{
if(nullptr != pBorder)
{
- maImplStyle.reset(new implStyle());
+ maImplStyle = std::make_shared<implStyle>();
maImplStyle->mfPatternScale = fScale;
Set( pBorder, fScale );
}
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 2d718523bd26..cf3f9f259b94 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -636,8 +636,8 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void)
if (mbEnableDrawingLayerFillStyles)
{
// create FillAttributes directly from DrawingLayer FillStyle entries
- aFillAttributes.reset(
- new drawinglayer::attribute::SdrAllFillAttributesHelper(*pBBSet));
+ aFillAttributes =
+ std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(*pBBSet);
}
else
{
@@ -652,8 +652,8 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void)
svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
- aFillAttributes.reset(
- new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
+ aFillAttributes =
+ std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
}
}
@@ -712,7 +712,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet )
if(mbEnableDrawingLayerFillStyles)
{
// create FillAttributes directly from DrawingLayer FillStyle entries
- aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet));
+ aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
}
else
{
@@ -725,7 +725,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet )
SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
- aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
+ aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
}
}
@@ -748,7 +748,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet )
if(mbEnableDrawingLayerFillStyles)
{
// create FillAttributes directly from DrawingLayer FillStyle entries
- aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet));
+ aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
}
else
{
@@ -761,7 +761,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet )
SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
- aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
+ aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
}
}
@@ -774,7 +774,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet )
if(mbEnableDrawingLayerFillStyles)
{
// create FillAttributes directly from DrawingLayer FillStyle entries
- aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rSet));
+ aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rSet);
}
else
{
@@ -787,7 +787,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet )
SfxItemSet aTempSet(*rSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
- aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
+ aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
}
}
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 377ea12907dd..2cf21a5652b5 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -372,8 +372,8 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj )
{
case OBJ_RECT:
{
- pUserData->ReplaceObject( IMapObjectPtr(new IMapRectangleObject( static_cast<const SdrRectObj&>(rObj).GetLogicRect(),
- aURL, aAltText, aDesc, aTarget, "", bActive, false ) ) );
+ pUserData->ReplaceObject( std::make_shared<IMapRectangleObject>( static_cast<const SdrRectObj&>(rObj).GetLogicRect(),
+ aURL, aAltText, aDesc, aTarget, "", bActive, false ) );
}
break;
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index bba78509188c..23d21ede6a8b 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -2351,7 +2351,7 @@ SvxSearchDialogWrapper::SvxSearchDialogWrapper( vcl::Window* _pParent, sal_uInt1
SfxBindings* pBindings,
SfxChildWinInfo const * pInfo )
: SfxChildWindow( _pParent, nId )
- , dialog(new SvxSearchDialog(_pParent->GetFrameWeld(), this, *pBindings))
+ , dialog(std::make_shared<SvxSearchDialog>(_pParent->GetFrameWeld(), this, *pBindings))
{
SetController(dialog);
dialog->Initialize( pInfo );
diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx
index 4dcae395248b..91760b358ebf 100644
--- a/svx/source/form/fmscriptingenv.cxx
+++ b/svx/source/form/fmscriptingenv.cxx
@@ -970,7 +970,7 @@ namespace svxform
if ( _rEvent.ScriptType != "StarBasic" )
{
- pScript.reset( new NewStyleUNOScript( *xObjectShell, _rEvent.ScriptCode ) );
+ pScript = std::make_shared<NewStyleUNOScript>( *xObjectShell, _rEvent.ScriptCode );
}
else
{
@@ -1007,7 +1007,7 @@ namespace svxform
"?language=Basic&location=" +
sMacroLocation;
- pScript.reset( new NewStyleUNOScript( *xObjectShell, sScriptURI ) );
+ pScript = std::make_shared<NewStyleUNOScript>( *xObjectShell, sScriptURI );
}
assert(pScript && "FormScriptingEnvironment::doFireScriptEvent: no script to execute!");
diff --git a/svx/source/form/sqlparserclient.cxx b/svx/source/form/sqlparserclient.cxx
index f1cd230a8e0d..e350dc1f1c3a 100644
--- a/svx/source/form/sqlparserclient.cxx
+++ b/svx/source/form/sqlparserclient.cxx
@@ -32,7 +32,7 @@ namespace svxform
using namespace ::com::sun::star::lang;
OSQLParserClient::OSQLParserClient(const Reference< XComponentContext >& rxContext)
- : m_pParser(new OSQLParser(rxContext, getParseContext()))
+ : m_pParser(std::make_shared<OSQLParser>(rxContext, getParseContext()))
{
}
diff --git a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx
index 7fe63399e16c..36587b8761a8 100644
--- a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx
+++ b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx
@@ -59,23 +59,23 @@ namespace drawinglayer::attribute
maFillGradientAttribute(),
maPrimitives()
{
- maFillAttribute.reset(
- new drawinglayer::attribute::SdrFillAttribute(
+ maFillAttribute =
+ std::make_shared<drawinglayer::attribute::SdrFillAttribute>(
0.0,
rColor.GetRGBColor().getBColor(),
drawinglayer::attribute::FillGradientAttribute(),
drawinglayer::attribute::FillHatchAttribute(),
- drawinglayer::attribute::SdrFillGraphicAttribute()));
+ drawinglayer::attribute::SdrFillGraphicAttribute());
}
SdrAllFillAttributesHelper::SdrAllFillAttributesHelper(const SfxItemSet& rSet)
: maLastPaintRange(),
maLastDefineRange(),
maFillAttribute(
- new drawinglayer::attribute::SdrFillAttribute(
+ std::make_shared<drawinglayer::attribute::SdrFillAttribute>(
drawinglayer::primitive2d::createNewSdrFillAttribute(rSet))),
maFillGradientAttribute(
- new drawinglayer::attribute::FillGradientAttribute(
+ std::make_shared<drawinglayer::attribute::FillGradientAttribute>(
drawinglayer::primitive2d::createNewTransparenceGradientAttribute(rSet))),
maPrimitives()
{
@@ -117,7 +117,8 @@ namespace drawinglayer::attribute
{
if(!maFillAttribute.get())
{
- const_cast< SdrAllFillAttributesHelper* >(this)->maFillAttribute.reset(new drawinglayer::attribute::SdrFillAttribute());
+ const_cast< SdrAllFillAttributesHelper* >(this)->maFillAttribute =
+ std::make_shared<drawinglayer::attribute::SdrFillAttribute>();
}
return *maFillAttribute;
@@ -127,7 +128,8 @@ namespace drawinglayer::attribute
{
if(!maFillGradientAttribute.get())
{
- const_cast< SdrAllFillAttributesHelper* >(this)->maFillGradientAttribute.reset(new drawinglayer::attribute::FillGradientAttribute());
+ const_cast< SdrAllFillAttributesHelper* >(this)->maFillGradientAttribute =
+ std::make_shared<drawinglayer::attribute::FillGradientAttribute>();
}
return *maFillGradientAttribute;
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index cb0c88d845a4..fb0826b4ebe5 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -89,7 +89,7 @@ namespace drawinglayer::attribute
bool bWrongSpell,
bool bChainable)
: mpSdrText(pSdrText),
- mxOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
+ mxOutlinerParaObject(std::make_shared<OutlinerParaObject>(rOutlinerParaObject)),
maSdrFormTextAttribute(),
maTextLeftDistance(aTextLeftDistance),
maTextUpperDistance(aTextUpperDistance),
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx
index 4a7adf2c61b0..ded29812eae6 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -319,10 +319,10 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContact::createPrimiti
if(isPrimitiveGhosted(rDisplayInfo))
{
const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
- const basegfx::BColorModifierSharedPtr aBColorModifier(
- new basegfx::BColorModifier_interpolate(
+ const basegfx::BColorModifierSharedPtr aBColorModifier =
+ std::make_shared<basegfx::BColorModifier_interpolate>(
aRGBWhite,
- 0.5));
+ 0.5);
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
xRetval,
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
index 64ba2bbd0631..88fe38ca3c01 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
@@ -46,10 +46,10 @@ namespace sdr::contact
if(isPrimitiveGhosted(rDisplayInfo))
{
const ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
- const ::basegfx::BColorModifierSharedPtr aBColorModifier(
- new basegfx::BColorModifier_interpolate(
+ const ::basegfx::BColorModifierSharedPtr aBColorModifier =
+ std::make_shared<basegfx::BColorModifier_interpolate>(
aRGBWhite,
- 0.5));
+ 0.5);
const drawinglayer::primitive3d::Primitive3DReference xReference(
new drawinglayer::primitive3d::ModifiedColorPrimitive3D(
xRetval,
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
index 72a8043e70bc..aa7eb9058c05 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
@@ -103,10 +103,10 @@ namespace sdr::contact
if(isPrimitiveGhosted(rDisplayInfo))
{
const ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
- const ::basegfx::BColorModifierSharedPtr aBColorModifier(
- new basegfx::BColorModifier_interpolate(
+ const ::basegfx::BColorModifierSharedPtr aBColorModifier =
+ std::make_shared<basegfx::BColorModifier_interpolate>(
aRGBWhite,
- 0.5));
+ 0.5);
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
xRetval,
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index 1faddf461c23..634781f11956 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -68,7 +68,7 @@ struct SvxModifyControl::ImplData
SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& rStb ) :
SfxStatusBarControl( _nSlotId, _nId, rStb ),
- mxImpl(new ImplData)
+ mxImpl(std::make_shared<ImplData>())
{
mxImpl->maIdle.SetInvokeHandler( LINK(this, SvxModifyControl, OnTimer) );
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 5e6eb95bad8d..2908d7edcf7b 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2644,8 +2644,8 @@ void SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr<SfxItemSet>& rFormatSe
{
OutlinerView* pOLV = GetTextEditOutlinerView();
- rFormatSet.reset(
- new SfxItemSet(GetModel()->GetItemPool(), GetFormatRangeImpl(pOLV != nullptr)));
+ rFormatSet = std::make_shared<SfxItemSet>(GetModel()->GetItemPool(),
+ GetFormatRangeImpl(pOLV != nullptr));
if (pOLV)
{
rFormatSet->Put(pOLV->GetAttribs());
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index abb8a70fa8a9..2389504217f2 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -275,7 +275,7 @@ void SdrMediaObj::SetInputStream(uno::Reference<io::XInputStream> const& xStream
if (bSuccess)
{
- m_xImpl->m_pTempFile.reset(new ::avmedia::MediaTempFile(tempFileURL));
+ m_xImpl->m_pTempFile = std::make_shared<::avmedia::MediaTempFile>(tempFileURL);
#if HAVE_FEATURE_AVMEDIA
m_xImpl->m_MediaProperties.setURL(
m_xImpl->m_LastFailedPkgURL, tempFileURL, "");
@@ -353,8 +353,8 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper
if (bSuccess)
{
- m_xImpl->m_pTempFile.reset(
- new ::avmedia::MediaTempFile(tempFileURL));
+ m_xImpl->m_pTempFile =
+ std::make_shared<::avmedia::MediaTempFile>(tempFileURL);
m_xImpl->m_MediaProperties.setURL(url, tempFileURL, "");
}
else // this case is for Clone via operator=
diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx
index d342856bedee..2bbef503ae94 100644
--- a/svx/source/table/tablertfimporter.cxx
+++ b/svx/source/table/tablertfimporter.cxx
@@ -216,7 +216,7 @@ void SdrTableRTFParser::NextRow()
void SdrTableRTFParser::InsertCell( RtfImportInfo const * pInfo )
{
- RTFCellInfoPtr xCellInfo( new RTFCellInfo(mrItemPool) );
+ RTFCellInfoPtr xCellInfo = std::make_shared<RTFCellInfo>(mrItemPool);
xCellInfo->mnStartPara = mnStartPara;
xCellInfo->mnParaCount = pInfo->aSelection.nEndPara - 1 - mnStartPara;
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index cb718f018be6..7aee71bb5d81 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3399,7 +3399,7 @@ void SvxColorToolBoxControl::EnsurePaletteManager()
{
if (!m_xPaletteManager)
{
- m_xPaletteManager.reset(new PaletteManager);
+ m_xPaletteManager = std::make_shared<PaletteManager>();
m_xPaletteManager->SetBtnUpdater(m_xBtnUpdater.get());
}
}
@@ -4031,7 +4031,7 @@ void SvxColorListBox::EnsurePaletteManager()
{
if (!m_xPaletteManager)
{
- m_xPaletteManager.reset(new PaletteManager);
+ m_xPaletteManager = std::make_shared<PaletteManager>();
m_xPaletteManager->SetColorSelectFunction(std::ref(m_aColorWrapper));
}
}
@@ -4040,7 +4040,7 @@ void ColorListBox::EnsurePaletteManager()
{
if (!m_xPaletteManager)
{
- m_xPaletteManager.reset(new PaletteManager);
+ m_xPaletteManager = std::make_shared<PaletteManager>();
m_xPaletteManager->SetColorSelectFunction(std::ref(m_aColorWrapper));
}
}