summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-08-08 13:04:02 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-08-22 19:54:54 +0200
commit5d3d8958898bae177dfa38a31ce28497e5dd7a95 (patch)
treeb555ac7997e45f2de9b2f8f4ea6180f34ae84430
parent8d8044d25a6d112854655ef0ad51f1a904350f0f (diff)
bug fix: tdf#111173
Mostly based on patch by Julien Nabet: http://bugs.documentfoundation.org/attachment.cgi?id=135107 Thanks Julien! Change-Id: I02440be7dfa5881e5bf63710a9d3c4f261d00533 Reviewed-on: https://gerrit.libreoffice.org/40877 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 05c3791710397346aae0b2a9cca1792567941d62) Reviewed-on: https://gerrit.libreoffice.org/40899 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index d91e5a10d3fd..f3b854ee8707 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -362,8 +362,13 @@ void PieChart::createTextLabelShape(
///a new `PieLabelInfo` instance is initialized with all the info related to
///the current label in order to simplify later label position rearrangement;
uno::Reference< container::XChild > xChild( aPieLabelInfo.xTextShape, uno::UNO_QUERY );
- if( xChild.is() )
- aPieLabelInfo.xLabelGroupShape.set( xChild->getParent(), uno::UNO_QUERY );
+
+ ///text shape could be empty; in that case there is no need to add label info
+ if( !xChild.is() )
+ return;
+
+ aPieLabelInfo.xLabelGroupShape.set( xChild->getParent(), uno::UNO_QUERY );
+
aPieLabelInfo.fValue = nVal;
aPieLabelInfo.bMovementAllowed = bMovementAllowed;
aPieLabelInfo.bMoved= false;
@@ -374,9 +379,7 @@ void PieChart::createTextLabelShape(
performLabelBestFit(rParam, aPieLabelInfo);
}
-
m_aLabelInfoList.push_back(aPieLabelInfo);
-
}
void PieChart::addSeries( VDataSeries* pSeries, sal_Int32 /* zSlot */, sal_Int32 /* xSlot */, sal_Int32 /* ySlot */ )