summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-06 09:23:33 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-09 08:34:40 +0000
commit6c80a8fe89fadf9a2c7260a09c037a09462f53d1 (patch)
treed36da9ee2a5fdc579d2a57ff6ba02deaddfa785a /oox
parente1fc599eb764186e5d511ace9785463eebbc7028 (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 'oox')
-rw-r--r--oox/source/drawingml/customshapegeometry.cxx60
-rw-r--r--oox/source/drawingml/table/tableproperties.cxx6
-rw-r--r--oox/source/export/chartexport.cxx3
3 files changed, 15 insertions, 54 deletions
diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index 6875629f87f2..9eabc38637f1 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -146,76 +146,40 @@ OUString GetFormulaParameter( const EnhancedCustomShapeParameter& rParameter )
}
break;
case EnhancedCustomShapeParameterType::LEFT :
- {
- const OUString sLeft( "left" );
- aRet = sLeft;
- }
+ aRet = "left";
break;
case EnhancedCustomShapeParameterType::TOP :
- {
- const OUString sTop( "top" );
- aRet = sTop;
- }
+ aRet = "top";
break;
case EnhancedCustomShapeParameterType::RIGHT :
- {
- const OUString sRight( "right" );
- aRet = sRight;
- }
+ aRet = "right";
break;
case EnhancedCustomShapeParameterType::BOTTOM :
- {
- const OUString sBottom( "bottom" );
- aRet = sBottom;
- }
+ aRet = "bottom";
break;
case EnhancedCustomShapeParameterType::XSTRETCH :
- {
- const OUString sXStretch( "xstretch" );
- aRet = sXStretch;
- }
+ aRet = "xstretch";
break;
case EnhancedCustomShapeParameterType::YSTRETCH :
- {
- const OUString sYStretch( "ystretch" );
- aRet = sYStretch;
- }
+ aRet = "ystretch";
break;
case EnhancedCustomShapeParameterType::HASSTROKE :
- {
- const OUString sHasStroke( "hasstroke" );
- aRet = sHasStroke;
- }
+ aRet = "hasstroke";
break;
case EnhancedCustomShapeParameterType::HASFILL :
- {
- const OUString sHasFill( "hasfill" );
- aRet = sHasFill;
- }
+ aRet = "hasfill";
break;
case EnhancedCustomShapeParameterType::WIDTH :
- {
- const OUString sWidth( "width" );
- aRet = sWidth;
- }
+ aRet = "width";
break;
case EnhancedCustomShapeParameterType::HEIGHT :
- {
- const OUString sHeight( "height" );
- aRet = sHeight;
- }
+ aRet = "height";
break;
case EnhancedCustomShapeParameterType::LOGWIDTH :
- {
- const OUString sLogWidth( "logwidth" );
- aRet = sLogWidth;
- }
+ aRet = "logwidth";
break;
case EnhancedCustomShapeParameterType::LOGHEIGHT :
- {
- const OUString sLogHeight( "logheight" );
- aRet = sLogHeight;
- }
+ aRet = "logheight";
break;
}
return aRet;
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx
index 380fcfb11bd2..fc8e8a95cf6a 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -58,11 +58,10 @@ void CreateTableRows( uno::Reference< XTableRows > xTableRows, const std::vector
xTableRows->insertByIndex( 0, rvTableRows.size() - 1 );
std::vector< TableRow >::const_iterator aTableRowIter( rvTableRows.begin() );
uno::Reference< container::XIndexAccess > xIndexAccess( xTableRows, UNO_QUERY_THROW );
- const OUString sHeight("Height");
for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ )
{
Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW );
- xPropSet->setPropertyValue( sHeight, Any( static_cast< sal_Int32 >( aTableRowIter->getHeight() / 360 ) ) );
+ xPropSet->setPropertyValue( "Height", Any( static_cast< sal_Int32 >( aTableRowIter->getHeight() / 360 ) ) );
++aTableRowIter;
}
}
@@ -73,11 +72,10 @@ void CreateTableColumns( Reference< XTableColumns > xTableColumns, const std::ve
xTableColumns->insertByIndex( 0, rvTableGrid.size() - 1 );
std::vector< sal_Int32 >::const_iterator aTableGridIter( rvTableGrid.begin() );
uno::Reference< container::XIndexAccess > xIndexAccess( xTableColumns, UNO_QUERY_THROW );
- const OUString sWidth("Width");
for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ )
{
Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW );
- xPropSet->setPropertyValue( sWidth, Any( static_cast< sal_Int32 >( *aTableGridIter++ / 360 ) ) );
+ xPropSet->setPropertyValue( "Width", Any( static_cast< sal_Int32 >( *aTableGridIter++ / 360 ) ) );
}
}
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index d3952fc150bc..3b4967bd2520 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3558,7 +3558,6 @@ Reference< chart2::data::XDataSequence> getLabeledSequence(
const uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > >& aSequences,
bool bPositive )
{
- const OUString aRolePrefix( "error-bars" );
OUString aDirection;
if(bPositive)
aDirection = "positive";
@@ -3573,7 +3572,7 @@ Reference< chart2::data::XDataSequence> getLabeledSequence(
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;
}