summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-19 08:41:08 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-19 17:18:30 +0100
commit3dd1948e791e511557bc7be25aa3306439c9e94c (patch)
treea8a818cbacde9fbff8d3c86b1f658217779f6273 /sc
parent62afdd6f82c51cee330b278518622eaf1776e2c4 (diff)
cid#1559313 Dereference null return value
we already have the ScPostIt here Change-Id: I646cbe073be3a63f8aeaa4939406b56a73b6382e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160973 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/output.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 1696df328404..7eeec493219c 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -2572,8 +2572,9 @@ void ScOutputData::AddPDFNotes()
// use origin's pCell for NotePtr test below
}
- if ( mpDoc->GetNote(nMergeX, nMergeY, nTab) && ( bIsMerged ||
- ( !pInfo->bHOverlapped && !pInfo->bVOverlapped ) ) )
+ const ScPostIt* pNote = mpDoc->GetNote(nMergeX, nMergeY, nTab);
+
+ if ( pNote && ( bIsMerged || ( !pInfo->bHOverlapped && !pInfo->bVOverlapped ) ) )
{
tools::Long nNoteWidth = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX );
tools::Long nNoteHeight = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTY );
@@ -2592,7 +2593,6 @@ void ScOutputData::AddPDFNotes()
if ( bLayoutRTL ? ( nMarkX >= 0 ) : ( nMarkX < nScrX+nScrW ) )
{
tools::Rectangle aNoteRect( nMarkX, nPosY, nMarkX+nNoteWidth*nLayoutSign, nPosY+nNoteHeight );
- const ScPostIt* pNote = mpDoc->GetNote(nMergeX, nMergeY, nTab);
vcl::PDFNote aNote;