diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-06-22 03:11:35 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-23 09:04:03 +0000 |
commit | 701f4543f316ff3fdccdab4f0ed9b393d2391d2f (patch) | |
tree | 5653249e26732b9c050f794c55fdfe9f952bfd42 | |
parent | ea3afeb8d2390030af3d56832fe86d241d9e7fea (diff) |
don't try to set property mapping if there is no value
Change-Id: I422d651e303553e2ce30895b44b8d96664418c19
Reviewed-on: https://gerrit.libreoffice.org/9850
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | chart2/source/view/charttypes/BarChart.cxx | 9 | ||||
-rw-r--r-- | chart2/source/view/charttypes/BubbleChart.cxx | 18 | ||||
-rw-r--r-- | chart2/source/view/charttypes/GL3DBarChart.cxx | 4 | ||||
-rw-r--r-- | chart2/source/view/charttypes/PieChart.cxx | 9 | ||||
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 2 |
5 files changed, 28 insertions, 14 deletions
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx index aa53db07ac28..cf46db80b2bd 100644 --- a/chart2/source/view/charttypes/BarChart.cxx +++ b/chart2/source/view/charttypes/BarChart.cxx @@ -808,9 +808,12 @@ void BarChart::createShapes() if(bHasFillColorMapping) { - uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW ); - xProps->setPropertyValue("FillColor", uno::makeAny(static_cast<sal_Int32>( - pSeries->getValueByProperty(nPointIndex, "FillColor")))); + double nPropVal = pSeries->getValueByProperty(nPointIndex, "FillColor"); + if(!rtl::math::isNan(nPropVal)) + { + uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW ); + xProps->setPropertyValue("FillColor", uno::makeAny(static_cast<sal_Int32>(nPropVal))); + } } //set name/classified ObjectID (CID) ShapeFactory::setShapeName(xShape diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx index c8c6db5ae00c..45d91a6b4021 100644 --- a/chart2/source/view/charttypes/BubbleChart.cxx +++ b/chart2/source/view/charttypes/BubbleChart.cxx @@ -324,15 +324,21 @@ void BubbleChart::createShapes() if(bHasFillColorMapping) { - uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW ); - xProps->setPropertyValue("FillColor", uno::makeAny(static_cast<sal_Int32>( - pSeries->getValueByProperty(nIndex, "FillColor")))); + double nPropVal = pSeries->getValueByProperty(nIndex, "FillColor"); + if(!rtl::math::isNan(nPropVal)) + { + uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW ); + xProps->setPropertyValue("FillColor", uno::makeAny(static_cast<sal_Int32>(nPropVal))); + } } if(bHasBorderColorMapping) { - uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW ); - xProps->setPropertyValue("LineColor", uno::makeAny(static_cast<sal_Int32>( - pSeries->getValueByProperty(nIndex, "LineColor")))); + double nPropVal = pSeries->getValueByProperty(nIndex, "LineColor"); + if(!rtl::math::isNan(nPropVal)) + { + uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW ); + xProps->setPropertyValue("LineColor", uno::makeAny(static_cast<sal_Int32>(nPropVal))); + } } m_pShapeFactory->setShapeName( xShape, "MarkHandles" ); diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 6b7054e718de..4c52dea07d22 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -114,7 +114,9 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer { if(bMappedFillProperty) { - nColor = static_cast<sal_uInt32>(rDataSeries.getValueByProperty(nIndex, "FillColor")); + double nPropVal = rDataSeries.getValueByProperty(nIndex, "FillColor"); + if(!rtl::math::isNan(nPropVal)) + nColor = static_cast<sal_uInt32>(nPropVal); } float nVal = rDataSeries.getYValue(nIndex); diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index d4636eec9879..4059c12cadce 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -436,9 +436,12 @@ void PieChart::createShapes() if(bHasFillColorMapping) { - uno::Reference< beans::XPropertySet > xProps( xPointShape, uno::UNO_QUERY_THROW ); - xProps->setPropertyValue("FillColor", uno::makeAny(static_cast<sal_Int32>( - pSeries->getValueByProperty(nPointIndex, "FillColor")))); + double nPropVal = pSeries->getValueByProperty(nPointIndex, "FillColor"); + if(!rtl::math::isNan(nPropVal)) + { + uno::Reference< beans::XPropertySet > xProps( xPointShape, uno::UNO_QUERY_THROW ); + xProps->setPropertyValue("FillColor", uno::makeAny(static_cast<sal_Int32>( nPropVal))); + } } //create label diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 0285382bd31f..2f4b9685f6cd 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -1117,7 +1117,7 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN if(itr == maPropertyMap.end()) { double fNan; - ::rtl::math::setNan( & fNan ); + ::rtl::math::setNan( &fNan ); return fNan; } |