summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-15 09:07:04 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-15 09:07:04 +0100
commit2b9975f6cdc81c37d896a234c9fc69bbc8535cc0 (patch)
tree9e1195ec57ecdfec123237af73b6f79538542c06
parent51b56f7fc5cbd8a6d5e9d086b00c2d1ebb69b1fa (diff)
More loplugin:cstylecast: chart2
Change-Id: Id704acc62a62554a81673c512e84a71a71798013
-rw-r--r--chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx2
-rw-r--r--chart2/source/controller/dialogs/res_LegendPosition.cxx4
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx15
-rw-r--r--chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Position.cxx2
-rw-r--r--chart2/source/model/main/DataPointProperties.cxx2
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx2
8 files changed, 14 insertions, 17 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 6c83d564b6dd..7351ca30fcda 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -1133,7 +1133,7 @@ void WrappedDataRowSourceProperty::setPropertyValue( const Any& rOuterValue, con
css::chart::ChartDataRowSource eChartDataRowSource = css::chart::ChartDataRowSource_ROWS;
if( ! (rOuterValue >>= eChartDataRowSource) )
{
- sal_Int32 nNew = (sal_Int32)css::chart::ChartDataRowSource_ROWS;
+ sal_Int32 nNew = sal_Int32(css::chart::ChartDataRowSource_ROWS);
if( !(rOuterValue >>= nNew) )
throw lang::IllegalArgumentException( "Property DataRowSource requires css::chart::ChartDataRowSource value", nullptr, 0 );
eChartDataRowSource = css::chart::ChartDataRowSource(nNew);
diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
index aecf250adb20..4c5040caf4ef 100644
--- a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
+++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
@@ -59,7 +59,7 @@ void ShapeParagraphDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
TabulatorDisableFlags const nFlags(( TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft ) |
( TabulatorDisableFlags::FillMask &~TabulatorDisableFlags::FillNone ));
- aSet.Put( SfxUInt16Item( SID_SVXTABULATORTABPAGE_DISABLEFLAGS, (sal_uInt16)nFlags) );
+ aSet.Put( SfxUInt16Item( SID_SVXTABULATORTABPAGE_DISABLEFLAGS, static_cast<sal_uInt16>(nFlags)) );
rPage.PageCreated( aSet );
}
}
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index bac8ef363e17..e530fb07d241 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -181,7 +181,7 @@ void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs )
const SfxPoolItem* pPoolItem = nullptr;
if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS, true, &pPoolItem ) == SfxItemState::SET )
{
- chart2::LegendPosition nLegendPosition = (chart2::LegendPosition) static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ chart2::LegendPosition nLegendPosition = static_cast<chart2::LegendPosition>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
switch( nLegendPosition )
{
case chart2::LegendPosition_LINE_START:
@@ -219,7 +219,7 @@ void LegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const
nLegendPosition = chart2::LegendPosition_LINE_END;
else if( m_pRbtBottom->IsChecked() )
nLegendPosition = chart2::LegendPosition_PAGE_END;
- rOutAttrs.Put( SfxInt32Item(SCHATTR_LEGEND_POS, (sal_Int32)nLegendPosition ) );
+ rOutAttrs.Put( SfxInt32Item(SCHATTR_LEGEND_POS, static_cast<sal_Int32>(nLegendPosition) ) );
rOutAttrs.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, m_pCbxShow == nullptr || m_pCbxShow->IsChecked()) );
}
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index aa168a51e6e2..6b59fcb5394f 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -338,7 +338,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
{
css::chart::ChartAxisPosition eAxisPos( css::chart::ChartAxisPosition_ZERO );
GetPropertySet()->getPropertyValue( "CrossoverPosition" ) >>= eAxisPos;
- rOutItemSet.Put( SfxInt32Item( nWhichId, (sal_Int32)eAxisPos ) );
+ rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast<sal_Int32>(eAxisPos) ) );
}
break;
@@ -371,7 +371,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
{
css::chart::ChartAxisLabelPosition ePos( css::chart::ChartAxisLabelPosition_NEAR_AXIS );
GetPropertySet()->getPropertyValue( "LabelPosition" ) >>= ePos;
- rOutItemSet.Put( SfxInt32Item( nWhichId, (sal_Int32)ePos ) );
+ rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast<sal_Int32>(ePos) ) );
}
break;
@@ -379,7 +379,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
{
css::chart::ChartAxisMarkPosition ePos( css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
GetPropertySet()->getPropertyValue( "MarkPosition" ) >>= ePos;
- rOutItemSet.Put( SfxInt32Item( nWhichId, (sal_Int32)ePos ) );
+ rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast<sal_Int32>(ePos) ) );
}
break;
@@ -741,8 +741,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
case SCHATTR_AXIS_POSITION:
{
css::chart::ChartAxisPosition eAxisPos =
- (css::chart::ChartAxisPosition)
- static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
+ static_cast<css::chart::ChartAxisPosition>(static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue());
css::chart::ChartAxisPosition eOldAxisPos( css::chart::ChartAxisPosition_ZERO );
bool bPropExisted = ( GetPropertySet()->getPropertyValue( "CrossoverPosition" ) >>= eOldAxisPos );
@@ -813,8 +812,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
case SCHATTR_AXIS_LABEL_POSITION:
{
css::chart::ChartAxisLabelPosition ePos =
- (css::chart::ChartAxisLabelPosition)
- static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
+ static_cast<css::chart::ChartAxisLabelPosition>(static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue());
css::chart::ChartAxisLabelPosition eOldPos( css::chart::ChartAxisLabelPosition_NEAR_AXIS );
bool bPropExisted = ( GetPropertySet()->getPropertyValue( "LabelPosition" ) >>= eOldPos );
@@ -851,8 +849,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
case SCHATTR_AXIS_MARK_POSITION:
{
css::chart::ChartAxisMarkPosition ePos =
- (css::chart::ChartAxisMarkPosition)
- static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
+ static_cast<css::chart::ChartAxisMarkPosition>(static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue());
css::chart::ChartAxisMarkPosition eOldPos( css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
bool bPropExisted = ( GetPropertySet()->getPropertyValue( "MarkPosition" ) >>= eOldPos );
diff --git a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
index a3a30c165981..80e42df5c7fb 100644
--- a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
@@ -178,7 +178,7 @@ void LegendItemConverter::FillSpecialItem(
{
chart2::LegendPosition eLegendPos( chart2::LegendPosition_LINE_END );
GetPropertySet()->getPropertyValue( "AnchorPosition" ) >>= eLegendPos;
- rOutItemSet.Put( SfxInt32Item(SCHATTR_LEGEND_POS, (sal_Int32)eLegendPos ) );
+ rOutItemSet.Put( SfxInt32Item(SCHATTR_LEGEND_POS, static_cast<sal_Int32>(eLegendPos) ) );
}
break;
}
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 1421fc1cbc12..e0dee1b7f8d1 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -66,7 +66,7 @@ void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectang
if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)==SfxItemState::SET)
nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT,true,&pPoolItem)==SfxItemState::SET)
- eRP=(RectPoint)static_cast<const SfxAllEnumItem*>(pPoolItem)->GetValue();
+ eRP=static_cast<RectPoint>(static_cast<const SfxAllEnumItem*>(pPoolItem)->GetValue());
switch( eRP )
{
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 66e0b88d1f5a..217b30cbda20 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -480,7 +480,7 @@ void DataPointProperties::AddDefaultsToMap(
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_TEXT_WORD_WRAP, false );
PropertyHelper::setPropertyValueDefault< OUString >( rOutMap, PROP_DATAPOINT_LABEL_SEPARATOR, " " );
- PropertyHelper::setPropertyValueDefault<sal_Int32>(rOutMap, PROP_DATAPOINT_LABEL_BORDER_STYLE, (sal_Int32)drawing::LineStyle_NONE);
+ PropertyHelper::setPropertyValueDefault<sal_Int32>(rOutMap, PROP_DATAPOINT_LABEL_BORDER_STYLE, sal_Int32(drawing::LineStyle_NONE));
PropertyHelper::setEmptyPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_COLOR);
PropertyHelper::setPropertyValueDefault<sal_Int32>(rOutMap, PROP_DATAPOINT_LABEL_BORDER_WIDTH, 0);
PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LABEL_BORDER_DASH, drawing::LineDash());
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 387e83944c31..44129345dd5c 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -57,7 +57,7 @@ ChartItemPool::ChartItemPool():
rPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_SOURCE - SCHATTR_START] = new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
//legend
- rPoolDefaults[SCHATTR_LEGEND_POS - SCHATTR_START] = new SfxInt32Item(SCHATTR_LEGEND_POS, (sal_Int32)css::chart2::LegendPosition_LINE_END );
+ rPoolDefaults[SCHATTR_LEGEND_POS - SCHATTR_START] = new SfxInt32Item(SCHATTR_LEGEND_POS, sal_Int32(css::chart2::LegendPosition_LINE_END) );
rPoolDefaults[SCHATTR_LEGEND_SHOW - SCHATTR_START] = new SfxBoolItem(SCHATTR_LEGEND_SHOW, true);
//text