summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-28 12:05:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-29 10:07:49 +0200
commit14e52313e4d350d9960cdd972e87b7f206ee4e2d (patch)
tree1c91431e92fb59eb0399b502597d56331193ee42 /sw/source/core
parentca37f29421927d8f2d2b8fe2208649d6dad13011 (diff)
no need to allocate these on the heap
Change-Id: Ie4077a86523d623e1913c4f97971ab81d04abd4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116368 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/doc/docbasic.cxx4
-rw-r--r--sw/source/core/doc/doctxm.cxx4
-rw-r--r--sw/source/core/layout/paintfrm.cxx10
3 files changed, 10 insertions, 8 deletions
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index 723cd0881f74..6bf54c6b6e5a 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -213,7 +213,7 @@ sal_uInt16 SwDoc::CallEvent( SvMacroItemId nEvent, const SwCallMouseEvent& rCall
}
else if( EXTENDED_STYPE == rMacro.GetScriptType() )
{
- std::unique_ptr<Sequence<Any> > pUnoArgs(new Sequence<Any>());
+ Sequence<Any> aUnoArgs;
Any aRet;
Sequence< sal_Int16 > aOutArgsIndex;
@@ -222,7 +222,7 @@ sal_uInt16 SwDoc::CallEvent( SvMacroItemId nEvent, const SwCallMouseEvent& rCall
SAL_INFO("sw", "SwDoc::CallEvent URL is " << rMacro.GetMacName() );
nRet += ERRCODE_NONE == mpDocShell->CallXScript(
- rMacro.GetMacName(), *pUnoArgs,aRet, aOutArgsIndex, aOutArgs) ? 1 : 0;
+ rMacro.GetMacName(), aUnoArgs, aRet, aOutArgsIndex, aOutArgs) ? 1 : 0;
}
// JavaScript calls are ignored
}
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 2c3ed6902f13..a8916a113a05 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1717,7 +1717,9 @@ void SwTOXBaseSection::UpdatePageNum_( SwTextNode* pNd,
const SwTOXInternational& rIntl )
{
// collect starts end ends of main entry character style
- std::unique_ptr< std::vector<sal_uInt16> > xCharStyleIdx(pMainEntryNums ? new std::vector<sal_uInt16> : nullptr);
+ std::optional< std::vector<sal_uInt16> > xCharStyleIdx;
+ if (pMainEntryNums)
+ xCharStyleIdx.emplace();
OUString sSrchStr
= OUStringChar(C_NUM_REPL) + SwTOXMark::S_PAGE_DELI + OUStringChar(C_NUM_REPL);
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 646e4fe97995..e74de064a9b6 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7560,11 +7560,11 @@ Graphic SwDrawFrameFormat::MakeGraphic( ImageMap* )
if ( pMod )
{
SdrObject *pObj = FindSdrObject();
- std::unique_ptr<SdrView> pView( new SdrView( *pMod ) );
- SdrPageView *pPgView = pView->ShowSdrPage(pView->GetModel()->GetPage(0));
- pView->MarkObj( pObj, pPgView );
- aRet = pView->GetMarkedObjBitmapEx();
- pView->HideSdrPage();
+ SdrView aView( *pMod );
+ SdrPageView *pPgView = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
+ aView.MarkObj( pObj, pPgView );
+ aRet = aView.GetMarkedObjBitmapEx();
+ aView.HideSdrPage();
}
return aRet;
}