summaryrefslogtreecommitdiff
path: root/chart2/source/view/axes/VPolarGrid.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view/axes/VPolarGrid.cxx')
-rw-r--r--chart2/source/view/axes/VPolarGrid.cxx56
1 files changed, 29 insertions, 27 deletions
diff --git a/chart2/source/view/axes/VPolarGrid.cxx b/chart2/source/view/axes/VPolarGrid.cxx
index 46d176b6d91b..7c49842640a7 100644
--- a/chart2/source/view/axes/VPolarGrid.cxx
+++ b/chart2/source/view/axes/VPolarGrid.cxx
@@ -20,6 +20,7 @@
#include "VPolarGrid.hxx"
#include "VCartesianGrid.hxx"
#include "Tickmarks.hxx"
+#include <GridProperties.hxx>
#include <PlottingPositionHelper.hxx>
#include <ShapeFactory.hxx>
#include <ObjectIdentifier.hxx>
@@ -38,22 +39,20 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
VPolarGrid::VPolarGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
- , const uno::Sequence< Reference< beans::XPropertySet > > & rGridPropertiesList )
+ , std::vector< rtl::Reference< ::chart::GridProperties > > aGridPropertiesList )
: VAxisOrGridBase( nDimensionIndex, nDimensionCount )
- , m_aGridPropertiesList( rGridPropertiesList )
- , m_pPosHelper( new PolarPlottingPositionHelper() )
- , m_aIncrements()
+ , m_aGridPropertiesList( std::move(aGridPropertiesList) )
{
- PlotterBase::m_pPosHelper = m_pPosHelper.get();
+ PlotterBase::m_pPosHelper = &m_aPosHelper;
}
VPolarGrid::~VPolarGrid()
{
}
-void VPolarGrid::setIncrements( const std::vector< ExplicitIncrementData >& rIncrements )
+void VPolarGrid::setIncrements( std::vector< ExplicitIncrementData >&& rIncrements )
{
- m_aIncrements = rIncrements;
+ m_aIncrements = std::move(rIncrements);
}
void VPolarGrid::getAllTickInfos( sal_Int32 nDimensionIndex, TickInfoArraysType& rAllTickInfos ) const
@@ -77,28 +76,31 @@ void VPolarGrid::createLinePointSequence_ForAngleAxis(
sal_Int32 nTick = 0;
EquidistantTickIter aIter( rAllTickInfos, rIncrement, 0 );
+ auto pPoints = rPoints.getArray();
for( TickInfo* pTickInfo = aIter.firstInfo()
; pTickInfo
; pTickInfo = aIter.nextInfo(), nTick++ )
{
if(nTick>=rPoints[0].getLength())
- rPoints[0].realloc(rPoints[0].getLength()+30);
+ pPoints[0].realloc(rPoints[0].getLength()+30);
+ auto pPoints0 = pPoints[0].getArray();
//xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
double fLogicAngle = pTickInfo->getUnscaledTickValue();
drawing::Position3D aScenePosition3D( pPosHelper->transformAngleRadiusToScene( fLogicAngle, fLogicRadius, fLogicZ ) );
- rPoints[0][nTick].X = static_cast<sal_Int32>(aScenePosition3D.PositionX);
- rPoints[0][nTick].Y = static_cast<sal_Int32>(aScenePosition3D.PositionY);
+ pPoints0[nTick].X = static_cast<sal_Int32>(aScenePosition3D.PositionX);
+ pPoints0[nTick].Y = static_cast<sal_Int32>(aScenePosition3D.PositionY);
}
if(rPoints[0].getLength()>1)
{
- rPoints[0].realloc(nTick+1);
- rPoints[0][nTick].X = rPoints[0][0].X;
- rPoints[0][nTick].Y = rPoints[0][0].Y;
+ pPoints[0].realloc(nTick+1);
+ auto pPoints0 = pPoints[0].getArray();
+ pPoints0[nTick].X = rPoints[0][0].X;
+ pPoints0[nTick].Y = rPoints[0][0].Y;
}
else
- rPoints[0].realloc(0);
+ pPoints[0].realloc(0);
}
#ifdef NOTYET
void VPolarGrid::create2DAngleGrid( const Reference< drawing::XShapes >& xLogicTarget
@@ -144,7 +146,7 @@ void VPolarGrid::create2DAngleGrid( const Reference< drawing::XShapes >& xLogicT
appendPointSequence( aAllPoints, aPoints );
}
- Reference< drawing::XShape > xShape = m_pShapeFactory->createLine2D(
+ rtl::Reference<SvxShapePolyPolygon> xShape = ShapeFactory::createLine2D(
xMainTarget, aAllPoints, &rLinePropertiesList[nDepth] );
//because of this name this line will be used for marking
m_pShapeFactory->setShapeName( xShape, "MarkHandles" );
@@ -152,13 +154,13 @@ void VPolarGrid::create2DAngleGrid( const Reference< drawing::XShapes >& xLogicT
}
#endif
-void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogicTarget
+void VPolarGrid::create2DRadiusGrid( const rtl::Reference<SvxShapeGroupAnyD>& xLogicTarget
, TickInfoArraysType& rRadiusTickInfos
, TickInfoArraysType& rAngleTickInfos
, const std::vector<VLineProperties>& rLinePropertiesList )
{
- Reference< drawing::XShapes > xMainTarget(
- createGroupShape( xLogicTarget, m_aCID ) );
+ rtl::Reference<SvxShapeGroupAnyD> xMainTarget =
+ createGroupShape( xLogicTarget, m_aCID );
const std::vector<ExplicitScaleData>& rScales = m_pPosHelper->getScales();
const ExplicitScaleData& rRadiusScale = rScales[1];
@@ -178,14 +180,14 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
if( !rLinePropertiesList[nDepth].isLineVisible() )
continue;
- Reference< drawing::XShapes > xTarget( xMainTarget );
+ rtl::Reference<SvxShapeGroupAnyD> xTarget( xMainTarget );
if( nDepth > 0 )
{
- xTarget.set( createGroupShape( xLogicTarget
+ xTarget = createGroupShape( xLogicTarget
, ObjectIdentifier::addChildParticle( m_aCID, ObjectIdentifier::createChildParticleWithIndex( OBJECTTYPE_SUBGRID, nDepth-1 ) )
- ) );
+ );
if(!xTarget.is())
- xTarget.set( xMainTarget );
+ xTarget = xMainTarget;
}
//create axis main lines
@@ -201,12 +203,12 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
drawing::PointSequenceSequence aPoints(1);
VPolarGrid::createLinePointSequence_ForAngleAxis( aPoints, rAngleTickInfos
- , rAngleIncrement, rAngleScale, m_pPosHelper.get(), fLogicRadius, fLogicZ );
+ , rAngleIncrement, rAngleScale, &m_aPosHelper, fLogicRadius, fLogicZ );
if(aPoints[0].getLength())
appendPointSequence( aAllPoints, aPoints );
}
- Reference< drawing::XShape > xShape = m_pShapeFactory->createLine2D(
+ rtl::Reference<SvxShapePolyPolygon> xShape = ShapeFactory::createLine2D(
xTarget, aAllPoints, &rLinePropertiesList[nDepth] );
//because of this name this line will be used for marking
::chart::ShapeFactory::setShapeName( xShape, "MarkHandles" );
@@ -215,10 +217,10 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
void VPolarGrid::createShapes()
{
- OSL_PRECOND(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is(),"Axis is not proper initialized");
- if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()))
+ OSL_PRECOND(m_xLogicTarget.is()&&m_xFinalTarget.is(),"Axis is not proper initialized");
+ if(!(m_xLogicTarget.is()&&m_xFinalTarget.is()))
return;
- if(!m_aGridPropertiesList.hasElements())
+ if(m_aGridPropertiesList.empty())
return;
//create all scaled tickmark values