sc/source/core/data/drwlayer.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ae1285a593173cddf002f9b9ca9a6f1003f49285
Author:     Maxim Monastirsky <momonas...@gmail.com>
AuthorDate: Sat Apr 1 23:42:10 2023 +0300
Commit:     Maxim Monastirsky <momonas...@gmail.com>
CommitDate: Sun Apr 2 10:09:41 2023 +0200

    Try a different approach for cid#1524623
    
    I fail to see how pClipDoc could be nullptr, as all call sites of
    ScDrawLayer::CopyFromClip get a ScDocument-owned ScDrawLayer. But
    even in such case we can still get the style sheets pool from
    ScDrawLayer itself, which guaranteed to have one with or without
    ScDocument, as per ScDrawLayer's ctor.
    
    Change-Id: I6a3b7af7080b0a07ab3ec1fcfa7c6ca00e365162
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149921
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonas...@gmail.com>

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 12d0c5153a6f..830852bd4fd1 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1935,8 +1935,8 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, 
SCTAB nSourceTab, const
         {
             // Copy style sheet
             auto pStyleSheet = pOldObject->GetStyleSheet();
-            if (pStyleSheet && !bSameDoc && pClipDoc)
-                
pDoc->GetStyleSheetPool()->CopyStyleFrom(pClipDoc->GetStyleSheetPool(),
+            if (pStyleSheet && !bSameDoc)
+                
pDoc->GetStyleSheetPool()->CopyStyleFrom(pClipModel->GetStyleSheetPool(),
                     pStyleSheet->GetName(), pStyleSheet->GetFamily(), true);
 
             // Clone to target SdrModel

Reply via email to