diff options
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/axes/Tickmarks_Equidistant.cxx | 7 | ||||
-rw-r--r-- | chart2/source/view/axes/VCartesianAxis.cxx | 16 | ||||
-rw-r--r-- | chart2/source/view/main/ShapeFactory.cxx | 9 |
3 files changed, 8 insertions, 24 deletions
diff --git a/chart2/source/view/axes/Tickmarks_Equidistant.cxx b/chart2/source/view/axes/Tickmarks_Equidistant.cxx index 7b319974bbb5..85a6a4915a3c 100644 --- a/chart2/source/view/axes/Tickmarks_Equidistant.cxx +++ b/chart2/source/view/axes/Tickmarks_Equidistant.cxx @@ -311,8 +311,8 @@ bool EquidistantTickFactory::isVisible( double fScaledValue ) const void EquidistantTickFactory::getAllTicks( TickInfoArraysType& rAllTickInfos ) const { //create point sequences for each tick depth - sal_Int32 nDepthCount = getTickDepth(); - sal_Int32 nMaxMajorTickCount = getMaxTickCount(0); + const sal_Int32 nDepthCount = getTickDepth(); + const sal_Int32 nMaxMajorTickCount = getMaxTickCount(0); if (nDepthCount <= 0 || nMaxMajorTickCount <= 0) return; @@ -333,8 +333,7 @@ void EquidistantTickFactory::getAllTicks( TickInfoArraysType& rAllTickInfos ) co return; aAllTicks[0].realloc(nRealMajorTickCount); - if(nDepthCount>0) - addSubTicks( 1, aAllTicks ); + addSubTicks(1, aAllTicks); //so far we have added all ticks between the outer major tick marks //this was necessary to create sub ticks correctly diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 85da43f53daf..0b488abaa5e1 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1589,10 +1589,8 @@ void VCartesianAxis::createLabels() if (!m_aAxisProperties.m_bDisplayLabels) return; - std::unique_ptr< TickFactory2D > apTickFactory2D( createTickFactory2D() ); + std::unique_ptr<TickFactory2D> apTickFactory2D(createTickFactory2D()); // throws on failure TickFactory2D* pTickFactory2D = apTickFactory2D.get(); - if( !pTickFactory2D ) - return; //get the transformed screen values for all tickmarks in aAllTickInfos pTickFactory2D->updateScreenValues( m_aAllTickInfos ); @@ -1644,10 +1642,8 @@ void VCartesianAxis::createMaximumLabels() if (!m_aAxisProperties.m_bDisplayLabels) return; - std::unique_ptr< TickFactory2D > apTickFactory2D( createTickFactory2D() ); + std::unique_ptr<TickFactory2D> apTickFactory2D(createTickFactory2D()); // throws on failure TickFactory2D* pTickFactory2D = apTickFactory2D.get(); - if( !pTickFactory2D ) - return; //get the transformed screen values for all tickmarks in aAllTickInfos pTickFactory2D->updateScreenValues( m_aAllTickInfos ); @@ -1682,10 +1678,8 @@ void VCartesianAxis::updatePositions() if (!m_aAxisProperties.m_bDisplayLabels) return; - std::unique_ptr< TickFactory2D > apTickFactory2D( createTickFactory2D() ); + std::unique_ptr<TickFactory2D> apTickFactory2D(createTickFactory2D()); // throws on failure TickFactory2D* pTickFactory2D = apTickFactory2D.get(); - if( !pTickFactory2D ) - return; //update positions of all existing text shapes pTickFactory2D->updateScreenValues( m_aAllTickInfos ); @@ -1778,10 +1772,8 @@ void VCartesianAxis::createShapes() if( !prepareShapeCreation() ) return; - std::unique_ptr< TickFactory2D > apTickFactory2D( createTickFactory2D() ); + std::unique_ptr<TickFactory2D> apTickFactory2D(createTickFactory2D()); // throws on failure TickFactory2D* pTickFactory2D = apTickFactory2D.get(); - if( !pTickFactory2D ) - return; //create line shapes if(m_nDimension==2) diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index e9a9e6d5df11..548ecef28ccf 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2517,14 +2517,7 @@ uno::Reference< drawing::XShape > ShapeFactory* ShapeFactory::getOrCreateShapeFactory(const uno::Reference< lang::XMultiServiceFactory>& xFactory) { - static ShapeFactory* pShapeFactory = nullptr; - - if (pShapeFactory) - return pShapeFactory; - - if (!pShapeFactory) - pShapeFactory = new ShapeFactory(xFactory); - + static ShapeFactory* pShapeFactory = new ShapeFactory(xFactory); return pShapeFactory; } |