summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2023-04-01 23:42:10 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2023-04-02 10:09:41 +0200
commitae1285a593173cddf002f9b9ca9a6f1003f49285 (patch)
tree0a4998cfebca791dfdcdbd1af489cb08cd608842 /sc/source/core
parent96aad0d0497c8486f8affc8fed79e63a060c9a59 (diff)
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 <momonasmon@gmail.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/drwlayer.cxx4
1 files changed, 2 insertions, 2 deletions
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