diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-06 09:23:33 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-09 08:34:40 +0000 |
commit | 6c80a8fe89fadf9a2c7260a09c037a09462f53d1 (patch) | |
tree | d36da9ee2a5fdc579d2a57ff6ba02deaddfa785a /chart2 | |
parent | e1fc599eb764186e5d511ace9785463eebbc7028 (diff) |
new loplugin: oncevar
Change-Id: If57390510dde4d166be3141b9f658a7453755d3f
Reviewed-on: https://gerrit.libreoffice.org/19815
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx | 18 | ||||
-rw-r--r-- | chart2/source/tools/DataSeriesHelper.cxx | 3 | ||||
-rw-r--r-- | chart2/source/tools/ErrorBar.cxx | 3 | ||||
-rw-r--r-- | chart2/source/tools/ExplicitCategoriesProvider.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/main/VLegend.cxx | 3 |
5 files changed, 10 insertions, 20 deletions
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx index a4796a815175..80255fb15264 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -133,16 +133,13 @@ namespace ::chart::LightSource aResult; if( 0 <= nIndex && nIndex < 8 ) { - OUString aColorPropertyPrefix("D3DSceneLightColor"); - OUString aDirectionPropertyPrefix("D3DSceneLightDirection"); - OUString aEnabledPropertyPrefix("D3DSceneLightOn"); OUString aIndex( OUString::number( nIndex + 1 )); try { - xSceneProperties->getPropertyValue( aColorPropertyPrefix + aIndex ) >>= aResult.nDiffuseColor; - xSceneProperties->getPropertyValue( aDirectionPropertyPrefix + aIndex ) >>= aResult.aDirection; - xSceneProperties->getPropertyValue( aEnabledPropertyPrefix + aIndex ) >>= aResult.bIsEnabled; + xSceneProperties->getPropertyValue( "D3DSceneLightColor" + aIndex ) >>= aResult.nDiffuseColor; + xSceneProperties->getPropertyValue( "D3DSceneLightDirection" + aIndex ) >>= aResult.aDirection; + xSceneProperties->getPropertyValue( "D3DSceneLightOn" + aIndex ) >>= aResult.bIsEnabled; } catch( const uno::Exception & ex ) { @@ -161,18 +158,15 @@ namespace { if( 0 <= nIndex && nIndex < 8 ) { - OUString aColorPropertyPrefix("D3DSceneLightColor"); - OUString aDirectionPropertyPrefix("D3DSceneLightDirection"); - OUString aEnabledPropertyPrefix("D3DSceneLightOn"); OUString aIndex( OUString::number( nIndex + 1 )); try { - xSceneProperties->setPropertyValue( aColorPropertyPrefix + aIndex, + xSceneProperties->setPropertyValue( "D3DSceneLightColor" + aIndex, uno::makeAny( rLightSource.nDiffuseColor )); - xSceneProperties->setPropertyValue( aDirectionPropertyPrefix + aIndex, + xSceneProperties->setPropertyValue( "D3DSceneLightDirection" + aIndex, uno::makeAny( rLightSource.aDirection )); - xSceneProperties->setPropertyValue( aEnabledPropertyPrefix + aIndex, + xSceneProperties->setPropertyValue( "D3DSceneLightOn" + aIndex, uno::makeAny( rLightSource.bIsEnabled )); } catch( const uno::Exception & ex ) diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index 6cea3031b228..eea642e0ace9 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -390,7 +390,6 @@ void setStackModeAtSeries( if( eStackMode == StackMode_AMBIGUOUS ) return; - const OUString aPropName( "StackingDirection" ); const uno::Any aPropValue = uno::makeAny( ( (eStackMode == StackMode_Y_STACKED) || (eStackMode == StackMode_Y_STACKED_PERCENT) ) @@ -407,7 +406,7 @@ void setStackModeAtSeries( Reference< beans::XPropertySet > xProp( aSeries[i], uno::UNO_QUERY ); if( xProp.is() ) { - xProp->setPropertyValue( aPropName, aPropValue ); + xProp->setPropertyValue( "StackingDirection", aPropValue ); sal_Int32 nAxisIndex; xProp->getPropertyValue( "AttachedAxisIndex" ) >>= nAxisIndex; diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index 4f301e460fb7..c22e592028b0 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -179,7 +179,6 @@ namespace { OUString getSourceRangeStrFromLabeledSequences( const uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > >& aSequences, bool bPositive ) { - const OUString aRolePrefix( "error-bars" ); OUString aDirection; if(bPositive) aDirection = "positive"; @@ -196,7 +195,7 @@ OUString getSourceRangeStrFromLabeledSequences( const uno::Sequence< uno::Refere uno::Reference< beans::XPropertySet > xSeqProp( xSequence, uno::UNO_QUERY_THROW ); OUString aRole; if( ( xSeqProp->getPropertyValue( "Role" ) >>= aRole ) && - aRole.match( aRolePrefix ) && aRole.indexOf(aDirection) >= 0 ) + aRole.match( "error-bars" ) && aRole.indexOf(aDirection) >= 0 ) { return xSequence->getSourceRangeRepresentation(); } diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx index 56977db55e4b..c7c588b699c9 100644 --- a/chart2/source/tools/ExplicitCategoriesProvider.cxx +++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx @@ -371,7 +371,6 @@ Sequence< OUString > lcl_getExplicitSimpleCategories( { aRet.realloc(nMaxCategoryCount); aOuterEnd = aComplexCatsPerIndex.end(); - OUString aSpace(" "); for(sal_Int32 nN=0; nN<nMaxCategoryCount; nN++) { OUString aText; @@ -383,7 +382,7 @@ Sequence< OUString > lcl_getExplicitSimpleCategories( if( !aAddText.isEmpty() ) { if(!aText.isEmpty()) - aText += aSpace; + aText += " "; aText += aAddText; } } diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 584ea6bd9877..478cd1928920 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -288,8 +288,7 @@ awt::Size lcl_placeLegendEntries( const sal_Int32 nSymbolToTextDistance = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.22 ) );//minimum 1mm const sal_Int32 nSymbolPlusDistanceWidth = rMaxSymbolExtent.Width + nSymbolToTextDistance; sal_Int32 nMaxTextWidth = rAvailableSpace.Width - (2 * nXPadding) - nSymbolPlusDistanceWidth; - OUString aPropNameTextMaximumFrameWidth( "TextMaximumFrameWidth" ); - uno::Any* pFrameWidthAny = PropertyMapper::getValuePointer( rTextProperties.second, rTextProperties.first, aPropNameTextMaximumFrameWidth); + uno::Any* pFrameWidthAny = PropertyMapper::getValuePointer( rTextProperties.second, rTextProperties.first, "TextMaximumFrameWidth"); if(pFrameWidthAny) { if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_HIGH ) |