sc/source/ui/app/transobj.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
New commits: commit 5551871733685b042ca40f86e98c85403c425085 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu May 12 10:55:05 2022 +0100 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu May 12 13:40:35 2022 +0200 Simplify ScTransferObj::SetDrawClipDoc a bit The two ScGlobal::xDrawClipDocShellRef.clear's were born in commit 623f5b26ffd77041d0b06d7ce9c3b32d05625440 Author Noel Grandin <n...@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.kagan...@collabora.com> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> 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,