diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-02-09 19:02:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-10 07:50:12 +0100 |
commit | 5dfe561cffe6e2a41a76ee78244b16bdb80b0892 (patch) | |
tree | 687397adbeef44c75706add959e76168baf55bb4 /chart2 | |
parent | 5477193c9ca425509d529fb20dcb0db6a66b5d08 (diff) |
use more concrete types in chart2, SvxShape
Change-Id: Ieadcd95d7d75d925b2c5528ba231d4686d4fcb7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129738
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/axes/VCartesianAxis.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/charttypes/AreaChart.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/charttypes/BubbleChart.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/charttypes/NetChart.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/charttypes/PieChart.cxx | 22 | ||||
-rw-r--r-- | chart2/source/view/charttypes/PieChart.hxx | 4 |
6 files changed, 15 insertions, 22 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 8e7b3a1e728e..cb053a7ce986 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -202,7 +202,7 @@ static bool doesOverlap( const rtl::Reference<SvxShapeText>& xShape1 static void removeShapesAtWrongRhythm( TickIter& rIter , sal_Int32 nCorrectRhythm , sal_Int32 nMaxTickToCheck - , const Reference< drawing::XShapes >& xTarget ) + , const rtl::Reference< SvxShapeGroupAnyD >& xTarget ) { sal_Int32 nTick = 0; for( TickInfo* pTickInfo = rIter.firstInfo() diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 0dd77b97d7b7..9160ad8d93ee 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -799,7 +799,6 @@ void AreaChart::createShapes() pSeries->getPointCID_Stub(), nIndex ); rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes( createGroupShape(xSeriesGroupShape_Shapes,aPointCID) ); - uno::Reference<drawing::XShape> xPointGroupShape_Shape( static_cast<cppu::OWeakObject*>(xPointGroupShape_Shapes.get()), uno::UNO_QUERY ); { nCreatedPoints++; @@ -921,7 +920,7 @@ void AreaChart::createShapes() //remove PointGroupShape if empty if(!xPointGroupShape_Shapes->getCount()) - xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape); + xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shapes); } }//next series in x slot (next y slot) diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx index bf97f39c5061..803cf73b20d4 100644 --- a/chart2/source/view/charttypes/BubbleChart.cxx +++ b/chart2/source/view/charttypes/BubbleChart.cxx @@ -262,7 +262,6 @@ void BubbleChart::createShapes() pSeries->getPointCID_Stub(), nIndex ); rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes( createGroupShape(xSeriesGroupShape_Shapes,aPointCID) ); - uno::Reference<drawing::XShape> xPointGroupShape_Shape = xPointGroupShape_Shapes; { nCreatedPoints++; @@ -346,7 +345,7 @@ void BubbleChart::createShapes() //remove PointGroupShape if empty if(!xPointGroupShape_Shapes->getCount()) - xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape); + xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shapes); }//next series in x slot (next y slot) }//next x slot diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx index ed2b0e8387d0..1e23ad7f6ce9 100644 --- a/chart2/source/view/charttypes/NetChart.cxx +++ b/chart2/source/view/charttypes/NetChart.cxx @@ -529,7 +529,6 @@ void NetChart::createShapes() pSeries->getPointCID_Stub(), nIndex ); rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes( createGroupShape(xSeriesGroupShape_Shapes,aPointCID) ); - uno::Reference<drawing::XShape> xPointGroupShape_Shape( xPointGroupShape_Shapes ); { //create data point @@ -627,7 +626,7 @@ void NetChart::createShapes() //remove PointGroupShape if empty if(!xPointGroupShape_Shapes->getCount()) - xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape); + xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shapes); }//next series in x slot (next y slot) }//next x slot diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index d05f10070598..cf1bfde1c294 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -105,7 +105,7 @@ struct PieChart::ShapeParam namespace { -::basegfx::B2IRectangle lcl_getRect(const uno::Reference<drawing::XShape>& xShape) +::basegfx::B2IRectangle lcl_getRect(const rtl::Reference<SvxShape>& xShape) { ::basegfx::B2IRectangle aRect; if (xShape.is()) @@ -402,13 +402,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 ); + rtl::Reference< SvxShape > xChild = aPieLabelInfo.xTextShape; ///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.xLabelGroupShape = dynamic_cast<SvxShapeGroupAnyD*>(xChild->getParent().get()); if (bMovementAllowed && !m_bUseRings) { @@ -456,12 +456,11 @@ void PieChart::createTextLabelShape( aPieLabelInfo.xTextShape = createDataLabel(xTextTarget, rSeries, nPointIndex, nVal, rParam.mfLogicYSum, aScreenPosition2D, eAlignment, 0, nTextMaximumFrameWidth); - xChild.clear(); - xChild.set(uno::Reference<container::XChild>(aPieLabelInfo.xTextShape, uno::UNO_QUERY)); + xChild = aPieLabelInfo.xTextShape; if (!xChild.is()) return; - aPieLabelInfo.xLabelGroupShape.set(xChild->getParent(), uno::UNO_QUERY); + aPieLabelInfo.xLabelGroupShape = dynamic_cast<SvxShapeGroupAnyD*>(xChild->getParent().get()); } } @@ -519,13 +518,11 @@ void PieChart::createTextLabelShape( { drawing::PointSequenceSequence aPoints{ { {nX1, nY1}, {nX2, nY2} } }; - uno::Reference<beans::XPropertySet> xProp(aPieLabelInfo.xTextShape, - uno::UNO_QUERY); VLineProperties aVLineProperties; - if (xProp.is()) + if (aPieLabelInfo.xTextShape.is()) { sal_Int32 nColor = 0; - xProp->getPropertyValue("CharColor") >>= nColor; + aPieLabelInfo.xTextShape->SvxShape::getPropertyValue("CharColor") >>= nColor; //automatic font color does not work for lines -> fallback to black if (nColor != -1) aVLineProperties.Color <<= nColor; @@ -1290,11 +1287,10 @@ void PieChart::rearrangeLabelToAvoidOverlapIfRequested( const awt::Size& rPageSi drawing::PointSequenceSequence aPoints{ { {nX1, nY1}, {nX2, nY2} } }; - uno::Reference< beans::XPropertySet > xProp( labelInfo.xTextShape, uno::UNO_QUERY); - if( xProp.is() ) + if( labelInfo.xTextShape.is() ) { sal_Int32 nColor = 0; - xProp->getPropertyValue("CharColor") >>= nColor; + labelInfo.xTextShape->SvxShape::getPropertyValue("CharColor") >>= nColor; if( nColor != -1 )//automatic font color does not work for lines -> fallback to black aVLineProperties.Color <<= nColor; } diff --git a/chart2/source/view/charttypes/PieChart.hxx b/chart2/source/view/charttypes/PieChart.hxx index cb6b92dddae7..c990cc6e4a13 100644 --- a/chart2/source/view/charttypes/PieChart.hxx +++ b/chart2/source/view/charttypes/PieChart.hxx @@ -119,8 +119,8 @@ private: //member bool moveAwayFrom( const PieLabelInfo* pFix, const css::awt::Size& rPageSize , bool bMoveHalfWay, bool bMoveClockwise ); - css::uno::Reference< css::drawing::XShape > xTextShape; - css::uno::Reference< css::drawing::XShape > xLabelGroupShape; + rtl::Reference< SvxShapeText > xTextShape; + rtl::Reference< SvxShapeGroupAnyD > xLabelGroupShape; ::basegfx::B2IVector aFirstPosition; ::basegfx::B2IVector aOuterPosition; ::basegfx::B2IVector aOrigin; |