diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-23 12:34:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-06-26 13:12:31 +0200 |
commit | 0193b284e880a659ab73160e42238e1d5fe5cf8f (patch) | |
tree | da09299838a6afb43d7c601803a6bab787489854 /xmloff/source/draw/shapeexport.cxx | |
parent | 2ef138de767c312188d41a7f206234eafac3108b (diff) |
new loplugin:constexprliteral
OUStringLiteral should be declared constexpr, to enforce
that it is initialised at compile-time and not runtime.
This seems to make a different at least on Visual Studio
Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/draw/shapeexport.cxx')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 51976a625c97..a7f91d9326ef 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3127,7 +3127,7 @@ void XMLShapeExport::ImpExportPageShape( // export page number used for this page uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); - static const OUStringLiteral aPageNumberStr(u"PageNumber"); + static constexpr OUStringLiteral aPageNumberStr(u"PageNumber"); if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(aPageNumberStr)) { sal_Int32 nPageNumber = 0; @@ -3527,14 +3527,14 @@ void XMLShapeExport::ImpExportMediaShape( const OUString aFalseStr( "false" ), aTrueStr( "true" ); bool bLoop = false; - static const OUStringLiteral aLoopStr( u"Loop" ); + static constexpr OUStringLiteral aLoopStr( u"Loop" ); xPropSet->getPropertyValue( aLoopStr ) >>= bLoop; mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aLoopStr ); mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_VALUE, bLoop ? aTrueStr : aFalseStr ); delete new SvXMLElementExport( mrExport, XML_NAMESPACE_DRAW, XML_PARAM, false, true ); bool bMute = false; - static const OUStringLiteral aMuteStr( u"Mute" ); + static constexpr OUStringLiteral aMuteStr( u"Mute" ); xPropSet->getPropertyValue( aMuteStr ) >>= bMute; mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, aMuteStr ); mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_VALUE, bMute ? aTrueStr : aFalseStr ); @@ -3910,9 +3910,9 @@ void XMLShapeExport::export3DLamps( const css::uno::Reference< css::beans::XProp OUString aStr; OUStringBuffer sStringBuffer; - static const OUStringLiteral aColorPropName(u"D3DSceneLightColor"); - static const OUStringLiteral aDirectionPropName(u"D3DSceneLightDirection"); - static const OUStringLiteral aLightOnPropName(u"D3DSceneLightOn"); + static constexpr OUStringLiteral aColorPropName(u"D3DSceneLightColor"); + static constexpr OUStringLiteral aDirectionPropName(u"D3DSceneLightDirection"); + static constexpr OUStringLiteral aLightOnPropName(u"D3DSceneLightOn"); ::basegfx::B3DVector aLightDirection; drawing::Direction3D aLightDir; @@ -4366,7 +4366,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); // geometry - static const OUStringLiteral sCustomShapeGeometry( u"CustomShapeGeometry" ); + static constexpr OUStringLiteral sCustomShapeGeometry( u"CustomShapeGeometry" ); if ( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( sCustomShapeGeometry ) ) { uno::Any aGeoPropSet( xPropSet->getPropertyValue( sCustomShapeGeometry ) ); |