summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-05-12 10:55:05 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2022-05-12 13:40:35 +0200
commit5551871733685b042ca40f86e98c85403c425085 (patch)
tree66e8b89f2fb1dc0e012750f52523c0ab8a4eeb92
parentCreate a visualizer for OUStringLiteral (diff)
downloadcore-5551871733685b042ca40f86e98c85403c425085.tar.gz
core-5551871733685b042ca40f86e98c85403c425085.zip
Simplify ScTransferObj::SetDrawClipDoc a bit
The two ScGlobal::xDrawClipDocShellRef.clear's were born in commit 623f5b26ffd77041d0b06d7ce9c3b32d05625440 Author Noel Grandin <noel@peralex.com> Date Tue Oct 27 15:12:58 2015 +0200 don't allocate rtl::Reference or SvRef on the heap from separate calls to 'delete ScGlobal::pDrawClipDocShellRef' and 'ScGlobal::pDrawClipDocShellRef = NULL'. Change-Id: Ie214feda4bc139bd6fccfbe525d7193a5cd02bce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134180 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--sc/source/ui/app/transobj.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 245209e822bb..fcc5158e0001 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -822,13 +822,9 @@ SfxObjectShell* ScTransferObj::SetDrawClipDoc( bool bAnyOle )
{
ScGlobal::xDrawClipDocShellRef = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS); // there must be a ref
ScGlobal::xDrawClipDocShellRef->DoInitNew();
- return ScGlobal::xDrawClipDocShellRef.get();
- }
- else
- {
- ScGlobal::xDrawClipDocShellRef.clear();
- return nullptr;
}
+
+ return ScGlobal::xDrawClipDocShellRef.get();
}
void ScTransferObj::StripRefs( ScDocument& rDoc,