sc/source/ui/view/viewfun3.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 6b0e2272e6da895ae709271af01268984bb91cd4
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Feb 16 10:36:17 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu Feb 16 09:46:35 2023 +0000

    This bool is redundant
    
    Change-Id: I4bc59f88cff3d28b44735b75058c4619b90e8b7e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147139
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index b9172ad11f39..a3d5c01e370f 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -225,14 +225,12 @@ bool ScViewFunc::CopyToClipSingleRange( ScDocument* 
pClipDoc, const ScRangeList&
     if (rDoc.HasSelectedBlockMatrixFragment( aRange.aStart.Col(), 
aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(), rMark ) )
         return false;
 
-    bool bSysClip = false;
     std::shared_ptr<ScDocument> pSysClipDoc;
     if ( !pClipDoc )                                    // no clip doc 
specified
     {
-        // Create one (deleted by ScTransferObj).
+        // Create one (deleted by ScTransferObj), and copy into system.
         pSysClipDoc = std::make_shared<ScDocument>( SCDOCMODE_CLIP );
         pClipDoc = pSysClipDoc.get();
-        bSysClip = true;                                // and copy into system
     }
     if ( !bCut )
     {
@@ -241,7 +239,7 @@ bool ScViewFunc::CopyToClipSingleRange( ScDocument* 
pClipDoc, const ScRangeList&
             pChangeTrack->ResetLastCut();
     }
 
-    if ( bSysClip && bIncludeObjects )
+    if ( pSysClipDoc && bIncludeObjects )
     {
         bool bAnyOle = rDoc.HasOLEObjectsInArea( aRange );
         // Update ScGlobal::xDrawClipDocShellRef.
@@ -278,14 +276,14 @@ bool ScViewFunc::CopyToClipSingleRange( ScDocument* 
pClipDoc, const ScRangeList&
         }
     }
 
-    if ( bSysClip )
+    if ( pSysClipDoc )
     {
         ScDrawLayer::SetGlobalDrawPersist(nullptr);
         ScGlobal::SetClipDocName( rDoc.GetDocumentShell()->GetTitle( 
SFX_TITLE_FULLNAME ) );
     }
     pClipDoc->ExtendMerge( aRange, true );
 
-    if ( bSysClip )
+    if ( pSysClipDoc )
     {
         ScDocShell* pDocSh = GetViewData().GetDocShell();
         TransferableObjectDescriptor aObjDesc;

Reply via email to