summaryrefslogtreecommitdiff
path: root/sc
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 /sc
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 'sc')
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 3e80b6ce5a6e..9c4d8848ffc7 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1248,9 +1248,9 @@ bool ScDocFunc::SetCellText(
{
ScDocument& rDoc = rDocShell.GetDocument();
- ::std::unique_ptr<ScExternalRefManager::ApiGuard> pExtRefGuard;
+ ::std::optional<ScExternalRefManager::ApiGuard> pExtRefGuard;
if (bApi)
- pExtRefGuard.reset(new ScExternalRefManager::ApiGuard(rDoc));
+ pExtRefGuard.emplace(rDoc);
ScInputStringType aRes =
ScStringUtil::parseInputString(*rDoc.GetFormatTable(), rText, LANGUAGE_ENGLISH_US);