diff options
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 6 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/ChartTypeDialogController.cxx | 21 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_ChartType.cxx | 3 | ||||
-rw-r--r-- | chart2/source/controller/sidebar/ChartTypePanel.cxx | 4 | ||||
-rw-r--r-- | chart2/source/inc/ChartType.hxx | 2 | ||||
-rw-r--r-- | chart2/source/inc/ChartTypeDialogController.hxx | 6 | ||||
-rw-r--r-- | chart2/source/model/main/Diagram.cxx | 6 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeManager.cxx | 20 | ||||
-rw-r--r-- | chart2/source/model/template/PieChartType.cxx | 6 | ||||
-rw-r--r-- | chart2/source/model/template/PieChartTypeTemplate.cxx | 15 | ||||
-rw-r--r-- | chart2/source/model/template/PieChartTypeTemplate.hxx | 1 | ||||
-rw-r--r-- | chart2/source/view/charttypes/PieChart.cxx | 21 | ||||
-rw-r--r-- | chart2/source/view/charttypes/PieChart.hxx | 8 | ||||
-rw-r--r-- | chart2/source/view/main/SeriesPlotterContainer.cxx | 6 |
14 files changed, 80 insertions, 45 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index 29618ddbfaf6..79eb36f41050 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -104,7 +104,7 @@ enum PROP_DIAGRAM_STARTING_ANGLE, PROP_DIAGRAM_OF_PIE_TYPE, - PROP_DIAGRAM_COMPOSITE_SIZE, + PROP_DIAGRAM_SPLIT_POS, PROP_DIAGRAM_RIGHT_ANGLED_AXES, PROP_DIAGRAM_PERSPECTIVE, @@ -236,8 +236,8 @@ void lcl_AddPropertiesToVector( cppu::UnoType<chart2::PieChartSubType>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT ); - rOutProperties.emplace_back( "CompositeSize", - PROP_DIAGRAM_COMPOSITE_SIZE, + rOutProperties.emplace_back( "SplitPos", + PROP_DIAGRAM_SPLIT_POS, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT ); diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index 308ff1930457..365df1c328f9 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -305,7 +305,8 @@ rtl::Reference< ChartTypeTemplate > ChartTypeDialogController::getCurrentTemplat } void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParameter - , const rtl::Reference<::chart::ChartModel>& xChartModel ) + , const rtl::Reference<::chart::ChartModel>& xChartModel + , const uno::Reference<beans::XPropertySet>& xTemplateProps) { rtl::Reference< ::chart::ChartTypeManager > xTemplateManager = xChartModel->getTypeManager(); rtl::Reference< ::chart::ChartTypeTemplate > xTemplate( getCurrentTemplate( rParameter, xTemplateManager ) ); @@ -329,6 +330,20 @@ void ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame if (xDiagram.is()) { xDiagram->setPropertyValue(CHART_UNONAME_SORT_BY_XVALUES, uno::Any(rParameter.bSortByXValues)); + + sal_Int32 nSplitPos; + try { + if (xTemplateProps.is()) { + xTemplateProps->getPropertyValue(u"SplitPos"_ustr) >>= nSplitPos; + xDiagram->setPropertyValue(u"SplitPos"_ustr, uno::Any(nSplitPos)); + } + } + catch( uno::Exception & ex ) + { + //not all templates need to support SplitPos + ex.Context.is();//to have debug information without compilation warnings + } + } } void ChartTypeDialogController::fillSubTypeList( ValueSet& rSubTypeList, const ChartTypeParameter& /*rParameter*/ ) @@ -763,7 +778,7 @@ void OfPieChartDialogController::fillExtraControls( { try { - xTemplateProps->getPropertyValue( u"CompositeSize"_ustr ) >>= nCompositeSize; + xTemplateProps->getPropertyValue( u"SplitPos"_ustr ) >>= nCompositeSize; } catch( const uno::Exception & ) { @@ -801,7 +816,7 @@ void OfPieChartDialogController::setTemplateProperties( const uno::Reference< be if( xTemplateProps.is()) { sal_Int32 nCompositeSize = m_xMF_CompositeSize->get_value(); - xTemplateProps->setPropertyValue( u"CompositeSize"_ustr , uno::Any(nCompositeSize) ); + xTemplateProps->setPropertyValue( u"SplitPos"_ustr , uno::Any(nCompositeSize) ); } } diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 811c4df19017..12fa0325cef4 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -166,7 +166,8 @@ void ChartTypeTabPage::commitToModel( const ChartTypeParameter& rParameter ) return; m_aTimerTriggeredControllerLock.startTimer(); - m_pCurrentMainType->commitToModel( rParameter, m_xChartModel ); + uno::Reference< beans::XPropertySet > xTemplateProps( static_cast<cppu::OWeakObject*>(getCurrentTemplate().get()), uno::UNO_QUERY ); + m_pCurrentMainType->commitToModel( rParameter, m_xChartModel, xTemplateProps ); } void ChartTypeTabPage::stateChanged() diff --git a/chart2/source/controller/sidebar/ChartTypePanel.cxx b/chart2/source/controller/sidebar/ChartTypePanel.cxx index 38ea92912a19..fa85ded6d4a6 100644 --- a/chart2/source/controller/sidebar/ChartTypePanel.cxx +++ b/chart2/source/controller/sidebar/ChartTypePanel.cxx @@ -391,7 +391,9 @@ void ChartTypePanel::commitToModel(const ChartTypeParameter& rParameter) return; m_aTimerTriggeredControllerLock.startTimer(); - m_pCurrentMainType->commitToModel(rParameter, m_xChartModel); + uno::Reference<beans::XPropertySet> xTemplateProps( + static_cast<cppu::OWeakObject*>(getCurrentTemplate().get()), uno::UNO_QUERY); + m_pCurrentMainType->commitToModel(rParameter, m_xChartModel, xTemplateProps); } void ChartTypePanel::selectMainType() diff --git a/chart2/source/inc/ChartType.hxx b/chart2/source/inc/ChartType.hxx index 7b1fccfb159e..697b0d7ffc91 100644 --- a/chart2/source/inc/ChartType.hxx +++ b/chart2/source/inc/ChartType.hxx @@ -43,7 +43,7 @@ enum PROP_PIECHARTTYPE_USE_RINGS, PROP_PIECHARTTYPE_3DRELATIVEHEIGHT, PROP_PIECHARTTYPE_SUBTYPE, // none, of-bar, of-pie - PROP_PIECHARTTYPE_COMPOSITESIZE + PROP_PIECHARTTYPE_SPLIT_POS }; diff --git a/chart2/source/inc/ChartTypeDialogController.hxx b/chart2/source/inc/ChartTypeDialogController.hxx index cbeeb8b59406..1d36a433d96a 100644 --- a/chart2/source/inc/ChartTypeDialogController.hxx +++ b/chart2/source/inc/ChartTypeDialogController.hxx @@ -130,8 +130,10 @@ public: virtual void adjustParameterToSubType(ChartTypeParameter& rParameter); virtual void adjustParameterToMainType(ChartTypeParameter& rParameter); OUString getServiceNameForParameter(const ChartTypeParameter& rParameter) const; - void commitToModel(const ChartTypeParameter& rParameter, - const rtl::Reference<::chart::ChartModel>& xChartModel); + void + commitToModel(const ChartTypeParameter& rParameter, + const rtl::Reference<::chart::ChartModel>& xChartModel, + const css::uno::Reference<com::sun::star::beans::XPropertySet>& xTemplateProps); rtl::Reference<::chart::ChartTypeTemplate> getCurrentTemplate(const ChartTypeParameter& rParameter, const rtl::Reference<::chart::ChartTypeManager>& xTemplateManager) const; diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index bbd5dd61fab2..c3c4e0be9cc6 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -98,6 +98,7 @@ enum PROP_DIAGRAM_3DRELATIVEHEIGHT, PROP_DIAGRAM_DATATABLEHBORDER, PROP_DIAGRAM_OF_PIE_TYPE, + PROP_DIAGRAM_SPLIT_POS, PROP_DIAGRAM_DATATABLEVBORDER, PROP_DIAGRAM_DATATABLEOUTLINE, PROP_DIAGRAM_EXTERNALDATA @@ -188,6 +189,10 @@ void lcl_AddPropertiesToVector( PROP_DIAGRAM_OF_PIE_TYPE, cppu::UnoType<chart2::PieChartSubType>::get(), beans::PropertyAttribute::MAYBEVOID ); + rOutProperties.emplace_back( "SplitPos", + PROP_DIAGRAM_SPLIT_POS, + cppu::UnoType<sal_Int32>::get(), + beans::PropertyAttribute::MAYBEVOID ); rOutProperties.emplace_back( "ExternalData", PROP_DIAGRAM_EXTERNALDATA, cppu::UnoType<OUString>::get(), @@ -209,6 +214,7 @@ const ::chart::tPropertyValueMap& StaticDiagramDefaults() ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_DIAGRAM_3DRELATIVEHEIGHT, 100 ); ::chart::PropertyHelper::setPropertyValueDefault< chart2::PieChartSubType >( aMap, PROP_DIAGRAM_OF_PIE_TYPE, chart2::PieChartSubType_NONE); + ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aMap, PROP_DIAGRAM_SPLIT_POS, 2 ); ::chart::SceneProperties::AddDefaultsToMap( aMap ); return aMap; }(); diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index b81e47ee3884..deb70d9aa03c 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -396,52 +396,52 @@ rtl::Reference< ::chart::ChartTypeTemplate > ChartTypeManager::createTemplate( case TEMPLATE_PIE: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_NONE, false, - chart2::PieChartSubType_NONE, 2 )); + chart2::PieChartSubType_NONE, 3, 2)); break; case TEMPLATE_PIEALLEXPLODED: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_ALL_EXPLODED, false, - chart2::PieChartSubType_NONE, 2 )); + chart2::PieChartSubType_NONE, 3, 2 )); break; case TEMPLATE_DONUT: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_NONE, true, - chart2::PieChartSubType_NONE, 2 )); + chart2::PieChartSubType_NONE, 3, 2 )); break; case TEMPLATE_DONUTALLEXPLODED: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_ALL_EXPLODED, true, - chart2::PieChartSubType_NONE, 2 )); + chart2::PieChartSubType_NONE, 3, 2 )); break; case TEMPLATE_BAROFPIE: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_NONE, false, - chart2::PieChartSubType_BAR, 2 )); + chart2::PieChartSubType_BAR, 3, 2 )); break; case TEMPLATE_PIEOFPIE: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_NONE, false, - chart2::PieChartSubType_PIE, 2 )); + chart2::PieChartSubType_PIE, 3, 2 )); break; case TEMPLATE_THREEDPIE: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_NONE, false, - chart2::PieChartSubType_NONE, 3 )); + chart2::PieChartSubType_NONE, 3, 3 )); break; case TEMPLATE_THREEDPIEALLEXPLODED: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_ALL_EXPLODED, false, - chart2::PieChartSubType_NONE, 3 )); + chart2::PieChartSubType_NONE, 3, 3 )); break; case TEMPLATE_THREEDDONUT: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_NONE, true, - chart2::PieChartSubType_NONE, 3 )); + chart2::PieChartSubType_NONE, 3, 3 )); break; case TEMPLATE_THREEDDONUTALLEXPLODED: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_ALL_EXPLODED, true, - chart2::PieChartSubType_NONE, 3 )); + chart2::PieChartSubType_NONE, 3, 3 )); break; case TEMPLATE_SCATTERLINESYMBOL: diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx index 224b37a88865..36f9a59d0862 100644 --- a/chart2/source/model/template/PieChartType.cxx +++ b/chart2/source/model/template/PieChartType.cxx @@ -47,7 +47,7 @@ namespace ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, ::chart::PROP_PIECHARTTYPE_USE_RINGS, false ); ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, ::chart::PROP_PIECHARTTYPE_3DRELATIVEHEIGHT, 100 ); ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, ::chart::PROP_PIECHARTTYPE_SUBTYPE, chart2::PieChartSubType_NONE ); - ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, ::chart::PROP_PIECHARTTYPE_COMPOSITESIZE, 2 ); + ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, ::chart::PROP_PIECHARTTYPE_SPLIT_POS, 2 ); return aOutMap; }(); return aStaticDefaults; @@ -72,8 +72,8 @@ namespace ::chart::PROP_PIECHARTTYPE_SUBTYPE, cppu::UnoType<chart2::PieChartSubType>::get(), beans::PropertyAttribute::MAYBEDEFAULT }, - { u"CompositeSize"_ustr, - ::chart::PROP_PIECHARTTYPE_COMPOSITESIZE, + { u"SplitPos"_ustr, + ::chart::PROP_PIECHARTTYPE_SPLIT_POS, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::MAYBEVOID } }; diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx index cc5c0c0ed09f..0cdeb48ecfce 100644 --- a/chart2/source/model/template/PieChartTypeTemplate.cxx +++ b/chart2/source/model/template/PieChartTypeTemplate.cxx @@ -56,7 +56,7 @@ enum PROP_PIE_TEMPLATE_DIMENSION, PROP_PIE_TEMPLATE_USE_RINGS, PROP_PIE_TEMPLATE_SUB_PIE_TYPE, - PROP_PIE_TEMPLATE_COMPOSITE_SIZE + PROP_PIE_TEMPLATE_SPLIT_POS }; ::chart::tPropertyValueMap& StaticPieChartTypeTemplateDefaults() @@ -69,7 +69,8 @@ enum ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_PIE_TEMPLATE_DIMENSION, 2 ); ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_PIE_TEMPLATE_USE_RINGS, false ); ::chart::PropertyHelper::setPropertyValueDefault( aOutMap, PROP_PIE_TEMPLATE_SUB_PIE_TYPE, chart2::PieChartSubType_NONE ); - ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( aOutMap, PROP_PIE_TEMPLATE_COMPOSITE_SIZE, 2 ); + ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( + aOutMap, PROP_PIE_TEMPLATE_SPLIT_POS, 2 ); return aOutMap; }(); return aStaticDefaults; @@ -106,8 +107,8 @@ enum cppu::UnoType<chart2::PieChartSubType>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT }, - { u"CompositeSize"_ustr, - PROP_PIE_TEMPLATE_COMPOSITE_SIZE, + { u"SplitPos"_ustr, + PROP_PIE_TEMPLATE_SPLIT_POS, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT } @@ -140,6 +141,7 @@ PieChartTypeTemplate::PieChartTypeTemplate( chart2::PieChartOffsetMode eMode, bool bRings, chart2::PieChartSubType eSubType, + sal_Int32 nCompositeSize, sal_Int32 nDim /* = 2 */ ) : ChartTypeTemplate( xContext, rServiceName ) { @@ -147,7 +149,7 @@ PieChartTypeTemplate::PieChartTypeTemplate( setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_DIMENSION, uno::Any( nDim )); setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_USE_RINGS, uno::Any( bRings )); setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_SUB_PIE_TYPE, uno::Any( eSubType )); - setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_COMPOSITE_SIZE, uno::Any( sal_Int32(2) )); + setFastPropertyValue_NoBroadcast( PROP_PIE_TEMPLATE_SPLIT_POS, uno::Any( nCompositeSize )); } PieChartTypeTemplate::~PieChartTypeTemplate() @@ -274,7 +276,8 @@ void PieChartTypeTemplate::createChartTypes( xCT->setFastPropertyValue( PROP_PIECHARTTYPE_SUBTYPE, getFastPropertyValue( PROP_PIE_TEMPLATE_SUB_PIE_TYPE )); // "SubType" xCT->setFastPropertyValue( - PROP_PIECHARTTYPE_COMPOSITESIZE, getFastPropertyValue( PROP_PIE_TEMPLATE_COMPOSITE_SIZE )); // "CompositeSize" + PROP_PIECHARTTYPE_SPLIT_POS, getFastPropertyValue( + PROP_PIE_TEMPLATE_SPLIT_POS )); // "CompositeSize" rCoordSys[0]->setChartTypes( std::vector{xCT} ); if( !aSeriesSeq.empty() ) diff --git a/chart2/source/model/template/PieChartTypeTemplate.hxx b/chart2/source/model/template/PieChartTypeTemplate.hxx index c7b3b9b6951c..d95b8c49d900 100644 --- a/chart2/source/model/template/PieChartTypeTemplate.hxx +++ b/chart2/source/model/template/PieChartTypeTemplate.hxx @@ -39,6 +39,7 @@ public: css::chart2::PieChartOffsetMode eMode, bool bRings, css::chart2::PieChartSubType eSubType, + sal_Int32 nCompositeSize, sal_Int32 nDim ); virtual ~PieChartTypeTemplate() override; diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index 4bda2129817d..82ed7f32f6d4 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -195,7 +195,7 @@ PieChart::PieChart( const rtl::Reference<ChartType>& xChartTypeModel , m_bUseRings(false) , m_bSizeExcludesLabelsAndExplodedSegments(bExcludingPositioning) , m_eSubType(PieChartSubType_NONE) - , m_nCompositeSize(2) + , m_nSplitPos(2) , m_fMaxOffset(std::numeric_limits<double>::quiet_NaN()) { PlotterBase::m_pPosHelper = &m_aPosHelper; @@ -230,7 +230,7 @@ PieChart::PieChart( const rtl::Reference<ChartType>& xChartTypeModel } try { - xChartTypeModel->getFastPropertyValue(PROP_PIECHARTTYPE_COMPOSITESIZE) >>= m_nCompositeSize; // "CompositeSize" + xChartTypeModel->getFastPropertyValue(PROP_PIECHARTTYPE_SPLIT_POS) >>= m_nSplitPos; // "CompositeSize" } catch( const uno::Exception& ) { @@ -1050,7 +1050,7 @@ void PieChart::createShapes() PieDataSrcBase *pDataSrc = nullptr; PieDataSrc normalPieSrc; - OfPieDataSrc ofPieSrc(m_nCompositeSize); + OfPieDataSrc ofPieSrc(m_nSplitPos); // Default to regular pie if too few points for of-pie ::css::chart2::PieChartSubType eSubType = @@ -2303,26 +2303,25 @@ uno::Reference< beans::XPropertySet > PieDataSrc::getProps( // class OfPieDataSrc //======================= -// For now, just implement the default Excel behavior, which is that the -// right pie consists of the last three entries in the series. Other -// behaviors should be supported later. +// Support data splits only of the type "last n entries go in right subchart", +// for now. // TODO sal_Int32 OfPieDataSrc::getNPoints(const VDataSeries* pSeries, enum SubPieType eType) const { if (eType == SubPieType::LEFT) { - return pSeries->getTotalPointCount() - m_nCompositeSize + 1; + return pSeries->getTotalPointCount() - m_nSplitPos + 1; } else { assert(eType == SubPieType::RIGHT); - return m_nCompositeSize; + return m_nSplitPos; } } double OfPieDataSrc::getData(const VDataSeries* pSeries, sal_Int32 nPtIdx, enum SubPieType eType) const { - const sal_Int32 n = pSeries->getTotalPointCount() - m_nCompositeSize; + const sal_Int32 n = pSeries->getTotalPointCount() - m_nSplitPos; if (eType == SubPieType::LEFT) { // nPtIdx should be in [0, n] if (nPtIdx < n) { @@ -2331,7 +2330,7 @@ double OfPieDataSrc::getData(const VDataSeries* pSeries, sal_Int32 nPtIdx, // composite wedge assert(nPtIdx == n); double total = 0; - for (sal_Int32 i = n; i < n + m_nCompositeSize; ++i) { + for (sal_Int32 i = n; i < n + m_nSplitPos; ++i) { total += pSeries->getYValue(i); } return total; @@ -2347,7 +2346,7 @@ uno::Reference< beans::XPropertySet > OfPieDataSrc::getProps( enum SubPieType eType) const { const sal_Int32 nPts = pSeries->getTotalPointCount(); - const sal_Int32 n = nPts - m_nCompositeSize; + const sal_Int32 n = nPts - m_nSplitPos; if (eType == SubPieType::LEFT) { // nPtIdx should be in [0, n] if (nPtIdx < n) { diff --git a/chart2/source/view/charttypes/PieChart.hxx b/chart2/source/view/charttypes/PieChart.hxx index c5cb1e535cc8..b2fa3b8982ec 100644 --- a/chart2/source/view/charttypes/PieChart.hxx +++ b/chart2/source/view/charttypes/PieChart.hxx @@ -101,8 +101,8 @@ public: class OfPieDataSrc : public PieDataSrcBase { public: - OfPieDataSrc(sal_Int32 nCompositeSize): - m_nCompositeSize(nCompositeSize) + OfPieDataSrc(sal_Int32 nSplitPos): + m_nSplitPos(nSplitPos) {} // Minimum sensible number of data points @@ -118,7 +118,7 @@ public: const VDataSeries* pSeries, sal_Int32 nPtIdx, enum SubPieType eType) const; private: - sal_Int32 m_nCompositeSize; + double m_nSplitPos; }; //======================= @@ -276,7 +276,7 @@ private: //member bool m_bSizeExcludesLabelsAndExplodedSegments; ::css::chart2::PieChartSubType m_eSubType; // Number of entries in an of-pie composite wedge - sal_Int32 m_nCompositeSize; + double m_nSplitPos; struct PieLabelInfo { diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx index 43b62ae747ad..8ad97c3d1717 100644 --- a/chart2/source/view/main/SeriesPlotterContainer.cxx +++ b/chart2/source/view/main/SeriesPlotterContainer.cxx @@ -154,6 +154,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart sal_Int32 nStartingAngle = 90; sal_Int32 n3DRelativeHeight = 100; PieChartSubType ePieChartSubType = PieChartSubType_NONE; + double nSplitPos = 2; try { xDiagram->getPropertyValue(CHART_UNONAME_SORT_BY_XVALUES) >>= bSortByXValues; @@ -167,6 +168,8 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart xDiagram->getPropertyValue(u"3DRelativeHeight"_ustr) >>= n3DRelativeHeight; } xDiagram->getPropertyValue(u"SubPieType"_ustr) >>= ePieChartSubType; + + xDiagram->getPropertyValue(u"SplitPos"_ustr) >>= nSplitPos; } catch (const uno::Exception&) { @@ -234,6 +237,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart uno::Any(ePieChartSubType)); // Reset the diagram-level property so it's not persistent. xDiagram->setPropertyValue(u"SubPieType"_ustr, uno::Any(PieChartSubType_NONE)); + + xChartType->setFastPropertyValue(PROP_PIECHARTTYPE_SPLIT_POS, uno::Any(nSplitPos)); + //xDiagram->setPropertyValue(u"SplitPos"_ustr, uno::Any(nSplitPos)); } if (nT == 0) |