summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-11-12 10:43:53 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2019-11-12 11:41:17 +0100
commita7d69c50f6f2918a255df9f2ad395e26395b8f63 (patch)
treecc27fafe6d3f3e3f8cae0f8552b40004768c39e0 /svx
parentf49ef63f8ab5c6c9740eff4fdc52e8776f84e473 (diff)
Avoid nullptr dereference
Conditions already present on master Change-Id: I527482521191e51340f19f601f03d94fce50d429 Reviewed-on: https://gerrit.libreoffice.org/82490 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdedtv1.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 3a325152d4dd..7ccaf13d5b63 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -938,20 +938,26 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
case XATTR_LINECOLOR:
{
const SfxPoolItem* pItem = rSet.GetItem(XATTR_LINECOLOR);
- Color aColor = static_cast<const XLineColorItem*>(pItem)->GetColorValue();
- sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
+ if (pItem)
+ {
+ Color aColor = static_cast<const XLineColorItem*>(pItem)->GetColorValue();
+ sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
- sPayload = ".uno:XLineColor=" + sPayload;
+ sPayload = ".uno:XLineColor=" + sPayload;
+ }
break;
}
case XATTR_FILLCOLOR:
{
const SfxPoolItem* pItem = rSet.GetItem(XATTR_FILLCOLOR);
- Color aColor = static_cast<const XFillColorItem*>(pItem)->GetColorValue();
- sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
+ if (pItem)
+ {
+ Color aColor = static_cast<const XFillColorItem*>(pItem)->GetColorValue();
+ sPayload = OUString::number(static_cast<sal_uInt32>(aColor));
- sPayload = ".uno:FillColor=" + sPayload;
+ sPayload = ".uno:FillColor=" + sPayload;
+ }
break;
}
@@ -969,8 +975,9 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
}
}
- GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
- OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
+ if (!sPayload.isEmpty())
+ GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+ OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
}
nWhich = aIter.NextWhich();