From e7652ffc110f529734503621339f8a6b172be7e5 Mon Sep 17 00:00:00 2001
Message-Id: <e7652ffc110f529734503621339f8a6b172be7e5.1366715629.git.erack@redhat.com>
From: Eike Rathke <erack@redhat.com>
Date: Thu, 18 Apr 2013 15:24:35 +0200
Subject: [PATCH] resolved rhbz#918544 do not attempt to access non-existing
format
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
Removing the last condition removes the conditional format, don't use
the null pointer.
Change-Id: Icb3e01ccbf8182bdf8eed1d52263ab34c9b297ff
Reviewed-on: https://gerrit.libreoffice.org/3460
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
---
sc/source/ui/condformat/condformatmgr.cxx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-resolved-rhbz-918544-do-not-attempt-to-access-non-ex.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-resolved-rhbz-918544-do-not-attempt-to-access-non-ex.patch"
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index 03fbeb3..e510ba9 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -216,8 +216,11 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl)
sal_Int32 nKey = pFormat->GetKey();
mpFormatList->erase(nKey);
ScConditionalFormat* pNewFormat = pDlg->GetConditionalFormat();
- pNewFormat->SetKey(nKey);
- mpFormatList->InsertNew(pNewFormat);
+ if (pNewFormat)
+ {
+ pNewFormat->SetKey(nKey);
+ mpFormatList->InsertNew(pNewFormat);
+ }
maCtrlManager.Update();
}
delete pDlg;
--------------erAck-patch-parts--