summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorRadu Ioan <ioan.radu.g@gmail.com>2015-02-14 00:31:54 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-02-17 06:15:54 +0000
commita8e6f0bea0e8bc028ee64d0b4d9046e52de94eda (patch)
tree49a2e34d88c5a0eb9d8a6a74e818d6597482fe36 /chart2
parenta30e2cb912c6bae240ced35a392151e34090665b (diff)
tdf#39440 - cppcheck cleanliness
Fixed some cppcheck defects Change-Id: I25fd6aba9d76df98d20b9a1bb4c9d3c1bf6f84bb Reviewed-on: https://gerrit.libreoffice.org/14487 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx2
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx11
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx4
-rw-r--r--chart2/source/tools/ThreeDHelper.cxx3
4 files changed, 9 insertions, 11 deletions
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
index 9a1966dc280d..8c86559b31b6 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
@@ -190,7 +190,7 @@ void WrappedScaleProperty::setPropertyValue( tScaleProperty eScaleProperty, cons
(aScaleData.IncrementData.Distance >>= fStepMain) )
{
// approximate interval count
- sal_Int32 nIntervalCount = static_cast< sal_Int32 >(fStepMain / fStepHelp);
+ sal_Int32 nIntervalCount = static_cast< sal_Int32 >(fStepMain / fStepHelp);//cppcheck-suppress zerodiv
rSubIncrements[ 0 ].IntervalCount <<= nIntervalCount;
}
}
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 5276546afff1..75b55d440344 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -641,8 +641,7 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
{
aResult = GetRowString( static_cast< sal_Int32 >( nRow ));
}
- else if( nRow >= 0 &&
- m_apDataBrowserModel.get())
+ else if( nRow >= 0 && m_apDataBrowserModel.get())
{
sal_Int32 nColIndex = static_cast< sal_Int32 >( nColumnId ) - 1;
@@ -650,13 +649,15 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
{
double fData( m_apDataBrowserModel->getCellNumber( nColIndex, nRow ));
sal_Int32 nLabelColor;
- bool bColorChanged = false;
if( ! ::rtl::math::isNan( fData ) &&
m_spNumberFormatterWrapper.get() )
+ {
+ bool bColorChanged = false;
aResult = m_spNumberFormatterWrapper->getFormattedString(
GetNumberFormatKey( nRow, nColumnId ),
fData, nLabelColor, bColorChanged );
+ }
}
else if( m_apDataBrowserModel->getCellType( nColIndex, nRow ) == DataBrowserModel::TEXTORDATE )
{
@@ -668,11 +669,13 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
else if( aAny>>=fDouble )
{
sal_Int32 nLabelColor;
- bool bColorChanged = false;
sal_Int32 nDateNumberFormat = DiagramHelper::getDateNumberFormat( Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY) );
if( ! ::rtl::math::isNan( fDouble ) && m_spNumberFormatterWrapper.get() )
+ {
+ bool bColorChanged = false;
aResult = m_spNumberFormatterWrapper->getFormattedString(
nDateNumberFormat, fDouble, nLabelColor, bColorChanged );
+ }
}
}
else
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index a8de0328fe0a..b7a677b545ea 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1722,7 +1722,6 @@ bool ChartController::impl_moveOrResizeObject(
double fAmountLogicY )
{
bool bResult = false;
- bool bNeedShift = true;
bool bNeedResize = ( eType == CENTERED_RESIZE_OBJECT );
uno::Reference< frame::XModel > xChartModel( getModel() );
@@ -1788,8 +1787,7 @@ bool ChartController::impl_moveOrResizeObject(
eActionType, ObjectNameProvider::getName( eObjectType )), m_xUndoManager );
{
ControllerLockGuardUNO aCLGuard( xChartModel );
- if( bNeedShift )
- xObjProp->setPropertyValue( "RelativePosition", uno::makeAny( aRelPos ));
+ xObjProp->setPropertyValue( "RelativePosition", uno::makeAny( aRelPos ));
if( bNeedResize || (eObjectType == OBJECTTYPE_DIAGRAM) )//Also set an explicat size at the diagram when an explicit position is set
xObjProp->setPropertyValue( "RelativeSize", uno::makeAny( aRelSize ));
}
diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx
index 1ae926115f24..407efb1002e3 100644
--- a/chart2/source/tools/ThreeDHelper.cxx
+++ b/chart2/source/tools/ThreeDHelper.cxx
@@ -1453,7 +1453,6 @@ CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeft
if( lcl_isRightAngledAxesSetAndSupported( xSceneProperties ) )
{
ThreeDHelper::adaptRadAnglesForRightAngledAxes( fXAngleRad, fYAngleRad );
- fZAngleRad=0.0;
}
if( sin(fYAngleRad)>0.0 )
eRet = CuboidPlanePosition_Right;
@@ -1469,7 +1468,6 @@ CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBack
if( lcl_isRightAngledAxesSetAndSupported( xSceneProperties ) )
{
ThreeDHelper::adaptRadAnglesForRightAngledAxes( fXAngleRad, fYAngleRad );
- fZAngleRad=0.0;
}
if( cos(fXAngleRad)*cos(fYAngleRad)<0.0 )
eRet = CuboidPlanePosition_Front;
@@ -1485,7 +1483,6 @@ CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBott
if( lcl_isRightAngledAxesSetAndSupported( xSceneProperties ) )
{
ThreeDHelper::adaptRadAnglesForRightAngledAxes( fXAngleRad, fYAngleRad );
- fZAngleRad=0.0;
}
if( sin(fXAngleRad)*cos(fYAngleRad)<0.0 )
eRet = CuboidPlanePosition_Top;