summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-01 11:14:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-01 18:11:49 +0200
commit49b9401465730b1151917bffcbc0ad1f0622fcee (patch)
treed8cfac0b39e42c741ceaefa70779ee1d88251362 /basctl
parent754eb1541a6ca709f78afbc7fb2b75f626562dcc (diff)
no need to allocate guards on the heap
Change-Id: I66491a057f082a970158504474b678dbb4decf50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135228 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/basobj2.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 28c1acdb383f..8a656bf08d7c 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -216,9 +216,9 @@ namespace
// in case this is a document-local macro, try to protect the document's Undo Manager from
// flawed scripts
- std::unique_ptr< ::framework::DocumentUndoGuard > pUndoGuard;
+ std::optional< ::framework::DocumentUndoGuard > pUndoGuard;
if ( pData->aDocument.isDocument() )
- pUndoGuard.reset( new ::framework::DocumentUndoGuard( pData->aDocument.getDocument() ) );
+ pUndoGuard.emplace( pData->aDocument.getDocument() );
RunMethod( pData->xMethod.get() );
}