From 4b1d22060b1dee5636bf8d5d9404f24aed09b44a Mon Sep 17 00:00:00 2001
Message-Id: <4b1d22060b1dee5636bf8d5d9404f24aed09b44a.1437389616.git.erack@redhat.com>
From: Eike Rathke <erack@redhat.com>
Date: Mon, 20 Jul 2015 11:46:17 +0200
Subject: [PATCH] check annotation caption pointers, blind fix for rhbz#1242099
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Apparently there may have been situations when the caption or its shape
could not be obtained for whatever reason.
(cherry picked from commit 47d90af52a548429224c38b5c58a70116e0f7907)
Conflicts:
sc/source/filter/xml/xmlexprt.cxx
Change-Id: Ie9b97d4b3999cb4645bb6b8b688b3666cfd71ccc
---
sc/source/filter/xml/xmlexprt.cxx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-check-annotation-caption-pointers-blind-fix-for-rhbz.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-check-annotation-caption-pointers-blind-fix-for-rhbz.patch"
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 2c67fcb..06f8356 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3720,9 +3720,12 @@ void ScXMLExport::WriteAnnotation(ScMyCell& rMyCell)
pCurrentCell = &rMyCell;
SdrCaptionObj* pNoteCaption = pNote->GetOrCreateCaption(rMyCell.maCellAddress);
- Reference<drawing::XShape> xShape( pNoteCaption->getUnoShape(), uno::UNO_QUERY );
-
- GetShapeExport()->exportShape(xShape, SEF_DEFAULT|SEF_EXPORT_ANNOTATION, NULL);
+ if (pNoteCaption)
+ {
+ Reference<drawing::XShape> xShape( pNoteCaption->getUnoShape(), uno::UNO_QUERY );
+ if (xShape.is())
+ GetShapeExport()->exportShape(xShape, SEF_DEFAULT|SEF_EXPORT_ANNOTATION, NULL);
+ }
pCurrentCell = NULL;
--------------erAck-patch-parts--