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 /sdext | |
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 'sdext')
-rw-r--r-- | sdext/source/minimizer/graphiccollector.cxx | 16 | ||||
-rw-r--r-- | sdext/source/minimizer/impoptimizer.cxx | 12 |
2 files changed, 10 insertions, 18 deletions
diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx index e341371d3fc6..c5f59d6b4fec 100644 --- a/sdext/source/minimizer/graphiccollector.cxx +++ b/sdext/source/minimizer/graphiccollector.cxx @@ -62,9 +62,9 @@ const DeviceInfo& GraphicCollector::GetDeviceInfo( const Reference< XComponentCo void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, const GraphicSettings& rGraphicSettings, const GraphicCollector::GraphicUser& rUser ) { const OUString aGraphicURL( rUser.maGraphicURL ); - const OUString sPackageURL( "vnd.sun.star.GraphicObject:" ); - if ( rGraphicSettings.mbEmbedLinkedGraphics || (aGraphicURL.isEmpty() || aGraphicURL.match( sPackageURL ) ) ) + if ( rGraphicSettings.mbEmbedLinkedGraphics || + aGraphicURL.isEmpty() || aGraphicURL.match( "vnd.sun.star.GraphicObject:" ) ) { std::vector< GraphicCollector::GraphicEntity >::iterator aIter( rGraphicEntities.begin() ); while( aIter != rGraphicEntities.end() ) @@ -221,18 +221,16 @@ void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxMSF, cons { try { - const OUString sGraphicObjectShape( "com.sun.star.drawing.GraphicObjectShape" ); - const OUString sGroupShape( "com.sun.star.drawing.GroupShape" ); Reference< XShape > xShape( rxShapes->getByIndex( i ), UNO_QUERY_THROW ); const OUString sShapeType( xShape->getShapeType() ); - if ( sShapeType == sGroupShape ) + if ( sShapeType == "com.sun.star.drawing.GroupShape" ) { Reference< XShapes > xShapes( xShape, UNO_QUERY_THROW ); ImpCollectGraphicObjects( rxMSF, xShapes, rGraphicSettings, rGraphicEntities ); continue; } - if ( sShapeType == sGraphicObjectShape ) + if ( sShapeType == "com.sun.star.drawing.GraphicObjectShape" ) ImpAddGraphicEntity( rxMSF, xShape, rGraphicSettings, rGraphicEntities ); // now check for a fillstyle @@ -343,18 +341,16 @@ void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, const { try { - const OUString sGraphicObjectShape( "com.sun.star.drawing.GraphicObjectShape" ); - const OUString sGroupShape( "com.sun.star.drawing.GroupShape" ); Reference< XShape > xShape( rxShapes->getByIndex( i ), UNO_QUERY_THROW ); const OUString sShapeType( xShape->getShapeType() ); - if ( sShapeType == sGroupShape ) + if ( sShapeType == "com.sun.star.drawing.GroupShape" ) { Reference< XShapes > xShapes( xShape, UNO_QUERY_THROW ); ImpCountGraphicObjects( rxMSF, xShapes, rGraphicSettings, rnGraphics ); continue; } - if ( sShapeType == sGraphicObjectShape ) + if ( sShapeType == "com.sun.star.drawing.GraphicObjectShape" ) { rnGraphics++; } diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx index 44af41ce2889..f2be9365ed66 100644 --- a/sdext/source/minimizer/impoptimizer.cxx +++ b/sdext/source/minimizer/impoptimizer.cxx @@ -122,8 +122,7 @@ void ImpDeleteHiddenSlides( const Reference< XModel >& rxModel ) Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY_THROW ); bool bVisible = true; - const OUString sVisible( "Visible" ); - if ( xPropSet->getPropertyValue( sVisible ) >>= bVisible ) + if ( xPropSet->getPropertyValue( "Visible" ) >>= bVisible ) { if (!bVisible ) { @@ -153,8 +152,7 @@ void ImpDeleteNotesPages( const Reference< XModel >& rxModel ) while( xShapes->getCount() ) xShapes->remove( Reference< XShape >( xShapes->getByIndex( xShapes->getCount() - 1 ), UNO_QUERY_THROW ) ); - const OUString sLayout( "Layout" ); - xPropSet->setPropertyValue( sLayout, Any( (sal_Int16)21 ) ); + xPropSet->setPropertyValue( "Layout", Any( (sal_Int16)21 ) ); } } catch( Exception& ) @@ -173,9 +171,8 @@ void ImpConvertOLE( const Reference< XModel >& rxModel, sal_Int32 nOLEOptimizati Reference< XShapes > xShapes( xDrawPages->getByIndex( i ), UNO_QUERY_THROW ); for ( sal_Int32 j = 0; j < xShapes->getCount(); j++ ) { - const OUString sOLE2Shape( "com.sun.star.drawing.OLE2Shape" ); Reference< XShape > xShape( xShapes->getByIndex( j ), UNO_QUERY_THROW ); - if ( xShape->getShapeType() == sOLE2Shape ) + if ( xShape->getShapeType() == "com.sun.star.drawing.OLE2Shape" ) { Reference< XPropertySet > xPropSet( xShape, UNO_QUERY_THROW ); @@ -191,9 +188,8 @@ void ImpConvertOLE( const Reference< XModel >& rxModel, sal_Int32 nOLEOptimizati Reference< XGraphic > xGraphic; if ( xPropSet->getPropertyValue( "Graphic" ) >>= xGraphic ) { - const OUString sGraphicShape( "com.sun.star.drawing.GraphicObjectShape" ); Reference< XMultiServiceFactory > xFact( rxModel, UNO_QUERY_THROW ); - Reference< XShape > xShape2( xFact->createInstance( sGraphicShape ), UNO_QUERY_THROW ); + Reference< XShape > xShape2( xFact->createInstance( "com.sun.star.drawing.GraphicObjectShape" ), UNO_QUERY_THROW ); xShapes->add( xShape2 ); xShape2->setPosition( xShape->getPosition() ); xShape2->setSize( xShape->getSize() ); |