diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-21 19:01:06 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-26 00:24:41 +0200 |
commit | c36df7c0844be4831380d90d68489100da3f0a30 (patch) | |
tree | d334aba6a4eeae801b61f1884c6b9ccef80f19f4 /chart2 | |
parent | 0066d74fe51444cf459d1218b3de3d4a7502faeb (diff) |
avoid a crash that occures sometimes
Change-Id: Iccbdfdb8a46b45b76756ff8080757db3770d691c
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/sidebar/ChartAreaPanel.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx index 89eb74b03fe2..13c4a7cd7331 100644 --- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx @@ -23,7 +23,9 @@ OUString getCID(css::uno::Reference<css::frame::XModel> xModel) return OUString(); css::uno::Any aAny = xSelectionSupplier->getSelection(); - assert(aAny.hasValue()); + if (!aAny.hasValue()) + return OUString(); + OUString aCID; aAny >>= aCID; @@ -94,6 +96,9 @@ void ChartAreaPanel::setFillFloatTransparence(const XFillFloatTransparenceItem& void ChartAreaPanel::setFillStyle(const XFillStyleItem& rItem) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel); + if (!xPropSet.is()) + return; + xPropSet->setPropertyValue("FillStyle", css::uno::makeAny(rItem.GetValue())); } @@ -101,6 +106,9 @@ void ChartAreaPanel::setFillStyleAndColor(const XFillStyleItem* pStyleItem, const XFillColorItem& rColorItem) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel); + if (!xPropSet.is()) + return; + if (pStyleItem) xPropSet->setPropertyValue("FillStyle", css::uno::makeAny(pStyleItem->GetValue())); xPropSet->setPropertyValue("Color", css::uno::makeAny(rColorItem.GetValue())); @@ -110,6 +118,9 @@ void ChartAreaPanel::setFillStyleAndGradient(const XFillStyleItem* pStyleItem, const XFillGradientItem& rGradientItem) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel); + if (!xPropSet.is()) + return; + if (pStyleItem) xPropSet->setPropertyValue("FillStyle", css::uno::makeAny(pStyleItem->GetValue())); xPropSet->setPropertyValue("GradientName", css::uno::makeAny(rGradientItem.GetValue())); @@ -119,6 +130,9 @@ void ChartAreaPanel::setFillStyleAndHatch(const XFillStyleItem* pStyleItem, const XFillHatchItem& rHatchItem) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel); + if (!xPropSet.is()) + return; + if (pStyleItem) xPropSet->setPropertyValue("FillStyle", css::uno::makeAny(pStyleItem->GetValue())); xPropSet->setPropertyValue("HatchName", css::uno::makeAny(rHatchItem.GetValue())); @@ -128,6 +142,9 @@ void ChartAreaPanel::setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& rBitmapItem) { css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel); + if (!xPropSet.is()) + return; + if (pStyleItem) xPropSet->setPropertyValue("FillStyle", css::uno::makeAny(pStyleItem->GetValue())); xPropSet->setPropertyValue("FillBitmapName", css::uno::makeAny(rBitmapItem.GetValue())); |