Kaydet (Commit) 35109fe7 authored tarafından Jochen Nitschke's avatar Jochen Nitschke Kaydeden (comit) Noel Grandin

cppcheck: knownConditionTrueFalse in chart2

Change-Id: I89164a9bc4710d9a90d415c2369c2cde3857c778
Reviewed-on: https://gerrit.libreoffice.org/60552
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 3d57e965
...@@ -1435,12 +1435,9 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) ...@@ -1435,12 +1435,9 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
if( bAlternate && pChartWindow ) if( bAlternate && pChartWindow )
{ {
// together with Alt-key: 1 px in each direction // together with Alt-key: 1 px in each direction
if( pChartWindow ) Size aPixelSize = pChartWindow->PixelToLogic( Size( 2, 2 ));
{ fGrowAmountX = static_cast< double >( aPixelSize.Width());
Size aPixelSize = pChartWindow->PixelToLogic( Size( 2, 2 )); fGrowAmountY = static_cast< double >( aPixelSize.Height());
fGrowAmountX = static_cast< double >( aPixelSize.Width());
fGrowAmountY = static_cast< double >( aPixelSize.Height());
}
} }
if( nCode == KEY_SUBTRACT ) if( nCode == KEY_SUBTRACT )
{ {
...@@ -1465,12 +1462,9 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) ...@@ -1465,12 +1462,9 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
if( bAlternate && pChartWindow ) if( bAlternate && pChartWindow )
{ {
// together with Alt-key: 1 px // together with Alt-key: 1 px
if(pChartWindow) Size aPixelSize = pChartWindow->PixelToLogic( Size( 1, 1 ));
{ fShiftAmountX = static_cast< double >( aPixelSize.Width());
Size aPixelSize = pChartWindow->PixelToLogic( Size( 1, 1 )); fShiftAmountY = static_cast< double >( aPixelSize.Height());
fShiftAmountX = static_cast< double >( aPixelSize.Width());
fShiftAmountY = static_cast< double >( aPixelSize.Height());
}
} }
switch( nCode ) switch( nCode )
{ {
......
...@@ -1392,11 +1392,10 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed( ...@@ -1392,11 +1392,10 @@ bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
if( xOtherDataSeriesContainer.is() ) if( xOtherDataSeriesContainer.is() )
{ {
uno::Sequence< uno::Reference< XDataSeries > > aOtherSeriesList( xOtherDataSeriesContainer->getDataSeries() ); uno::Sequence< uno::Reference< XDataSeries > > aOtherSeriesList( xOtherDataSeriesContainer->getDataSeries() );
sal_Int32 nOtherSeriesIndex = 0; if( 0 < aOtherSeriesList.getLength() )
if( nOtherSeriesIndex >= 0 && nOtherSeriesIndex < aOtherSeriesList.getLength() )
{ {
uno::Reference< XDataSeries > xExchangeSeries( aOtherSeriesList[nOtherSeriesIndex] ); uno::Reference< XDataSeries > xExchangeSeries( aOtherSeriesList[0] );
aOtherSeriesList[nOtherSeriesIndex] = xGivenDataSeries; aOtherSeriesList[0] = xGivenDataSeries;
xOtherDataSeriesContainer->setDataSeries(aOtherSeriesList); xOtherDataSeriesContainer->setDataSeries(aOtherSeriesList);
aSeriesList[nOldSeriesIndex]=xExchangeSeries; aSeriesList[nOldSeriesIndex]=xExchangeSeries;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment