summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-06-23 12:34:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-06-26 13:12:31 +0200
commit0193b284e880a659ab73160e42238e1d5fe5cf8f (patch)
treeda09299838a6afb43d7c601803a6bab787489854 /xmloff
parent2ef138de767c312188d41a7f206234eafac3108b (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')
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx2
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx8
-rw-r--r--xmloff/source/core/SettingsExportHelper.cxx30
-rw-r--r--xmloff/source/core/xmlexp.cxx4
-rw-r--r--xmloff/source/draw/XMLGraphicsDefaultStyle.cxx2
-rw-r--r--xmloff/source/draw/layerexp.cxx12
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx8
-rw-r--r--xmloff/source/draw/shapeexport.cxx14
-rw-r--r--xmloff/source/draw/xexptran.cxx24
-rw-r--r--xmloff/source/draw/ximppage.cxx8
-rw-r--r--xmloff/source/draw/ximpshap.cxx12
-rw-r--r--xmloff/source/meta/xmlmetai.cxx4
-rw-r--r--xmloff/source/style/XMLPageExport.cxx2
-rw-r--r--xmloff/source/style/xmlnume.cxx2
-rw-r--r--xmloff/source/table/XMLTableExport.cxx2
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx2
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx4
-rw-r--r--xmloff/source/text/XMLTextHeaderFooterContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListAutoStylePool.cxx2
-rw-r--r--xmloff/source/text/txtimp.cxx12
-rw-r--r--xmloff/source/text/txtparae.cxx4
22 files changed, 81 insertions, 81 deletions
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 5304f43ab014..b559d5f075e0 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -886,7 +886,7 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe
// this property)
bool bHasErrorBarRangesFromData = false;
{
- static const OUStringLiteral aErrorBarStylePropName( u"ErrorBarStyle");
+ static constexpr OUStringLiteral aErrorBarStylePropName( u"ErrorBarStyle");
uno::Any aErrorBarStyle(
SchXMLTools::getPropertyFromContext( aErrorBarStylePropName, pPropStyleContext, pStylesCtxt ));
if( aErrorBarStyle.hasValue())
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 27ae7311364c..b12f5886e69b 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -104,7 +104,7 @@ void lcl_fillRangeMapping(
sal_Int32 nColOffset = ( rTable.bHasHeaderColumn ? 1 : 0 );
const OUString lcl_aCategoriesRange(aCategoriesRange);
- static const OUStringLiteral lcl_aLabelPrefix(u"label ");
+ static constexpr OUStringLiteral lcl_aLabelPrefix(u"label ");
// Fill range mapping
const size_t nTableRowCount( rTable.aData.size());
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index b6299a4b0ed7..ff344f164edc 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -91,7 +91,7 @@ sal_Int32 lcl_getBuildIDFromGenerator( std::u16string_view rGenerator )
{
//returns -1 if nothing found
sal_Int32 nBuildId = -1;
- static const OUStringLiteral sBuildCompare( u"$Build-" );
+ static constexpr OUStringLiteral sBuildCompare( u"$Build-" );
size_t nBegin = rGenerator.find( sBuildCompare );
if( nBegin != std::u16string_view::npos )
{
@@ -632,7 +632,7 @@ void setXMLRangePropertyAtDataSequence(
return;
try
{
- static const OUStringLiteral aXMLRangePropName( u"CachedXMLRange" );
+ static constexpr OUStringLiteral aXMLRangePropName( u"CachedXMLRange" );
Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY_THROW );
Reference< beans::XPropertySetInfo > xInfo( xProp->getPropertySetInfo());
if( xInfo.is() && xInfo->hasPropertyByName( aXMLRangePropName ))
@@ -654,7 +654,7 @@ bool getXMLRangePropertyFromDataSequence(
{
try
{
- static const OUStringLiteral aXMLRangePropName( u"CachedXMLRange" );
+ static constexpr OUStringLiteral aXMLRangePropName( u"CachedXMLRange" );
Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY_THROW );
Reference< beans::XPropertySetInfo > xInfo( xProp->getPropertySetInfo());
bResult =
@@ -840,7 +840,7 @@ Reference< chart2::data::XDataProvider > getDataProviderFromParent( const Refere
Reference< lang::XMultiServiceFactory > xFact( xChild->getParent(), uno::UNO_QUERY );
if( xFact.is() )
{
- static const OUStringLiteral aDataProviderServiceName( u"com.sun.star.chart2.data.DataProvider");
+ static constexpr OUStringLiteral aDataProviderServiceName( u"com.sun.star.chart2.data.DataProvider");
const uno::Sequence< OUString > aServiceNames( xFact->getAvailableServiceNames());
const OUString * pBegin = aServiceNames.getConstArray();
const OUString * pEnd = pBegin + aServiceNames.getLength();
diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx
index ad73fe9843d1..8cd0519918a5 100644
--- a/xmloff/source/core/SettingsExportHelper.cxx
+++ b/xmloff/source/core/SettingsExportHelper.cxx
@@ -287,16 +287,16 @@ void XMLSettingsExportHelper::exportSymbolDescriptors(
{
rtl::Reference< comphelper::IndexedPropertyValuesContainer > xBox = new comphelper::IndexedPropertyValuesContainer();
- static const OUStringLiteral sName ( u"Name" );
- static const OUStringLiteral sExportName ( u"ExportName" );
- static const OUStringLiteral sSymbolSet ( u"SymbolSet" );
- static const OUStringLiteral sCharacter ( u"Character" );
- static const OUStringLiteral sFontName ( u"FontName" );
- static const OUStringLiteral sCharSet ( u"CharSet" );
- static const OUStringLiteral sFamily ( u"Family" );
- static const OUStringLiteral sPitch ( u"Pitch" );
- static const OUStringLiteral sWeight ( u"Weight" );
- static const OUStringLiteral sItalic ( u"Italic" );
+ static constexpr OUStringLiteral sName ( u"Name" );
+ static constexpr OUStringLiteral sExportName ( u"ExportName" );
+ static constexpr OUStringLiteral sSymbolSet ( u"SymbolSet" );
+ static constexpr OUStringLiteral sCharacter ( u"Character" );
+ static constexpr OUStringLiteral sFontName ( u"FontName" );
+ static constexpr OUStringLiteral sCharSet ( u"CharSet" );
+ static constexpr OUStringLiteral sFamily ( u"Family" );
+ static constexpr OUStringLiteral sPitch ( u"Pitch" );
+ static constexpr OUStringLiteral sWeight ( u"Weight" );
+ static constexpr OUStringLiteral sItalic ( u"Italic" );
sal_Int32 nCount = rProps.getLength();
const formula::SymbolDescriptor *pDescriptor = rProps.getConstArray();
@@ -427,11 +427,11 @@ void XMLSettingsExportHelper::exportForbiddenCharacters(
* xmloff/source/core/DocumentSettingsContext.cxx
* XMLConfigItemMapIndexedContext::EndElement() */
- static const OUStringLiteral sLanguage ( u"Language" );
- static const OUStringLiteral sCountry ( u"Country" );
- static const OUStringLiteral sVariant ( u"Variant" );
- static const OUStringLiteral sBeginLine ( u"BeginLine" );
- static const OUStringLiteral sEndLine ( u"EndLine" );
+ static constexpr OUStringLiteral sLanguage ( u"Language" );
+ static constexpr OUStringLiteral sCountry ( u"Country" );
+ static constexpr OUStringLiteral sVariant ( u"Variant" );
+ static constexpr OUStringLiteral sBeginLine ( u"BeginLine" );
+ static constexpr OUStringLiteral sEndLine ( u"EndLine" );
sal_Int32 nPos = 0;
for( const auto& rLocale : aLocales )
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 03277884ae0b..36e0a8454ebf 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -731,7 +731,7 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen
mpImpl->mStreamName = sName; // Note: may be empty (XSLT)
// Written OpenDocument file format doesn't fit to the created text document (#i69627#)
- static const OUStringLiteral sOutlineStyleAsNormalListStyle(
+ static constexpr OUStringLiteral sOutlineStyleAsNormalListStyle(
u"OutlineStyleAsNormalListStyle" );
if( xPropertySetInfo->hasPropertyByName( sOutlineStyleAsNormalListStyle ) )
{
@@ -743,7 +743,7 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen
if( xPropertySetInfo->hasPropertyByName( sTargetStorage ) )
mxExportInfo->getPropertyValue( sTargetStorage ) >>= mpImpl->mxTargetStorage;
- static const OUStringLiteral sExportTextNumberElement(
+ static constexpr OUStringLiteral sExportTextNumberElement(
u"ExportTextNumberElement" );
if( xPropertySetInfo->hasPropertyByName( sExportTextNumberElement ) )
{
diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
index 4341c6db98cc..a13c58b41d91 100644
--- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
+++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
@@ -119,7 +119,7 @@ void XMLGraphicsDefaultStyle::SetDefaults()
) )
bWordWrapDefault = false;
- static const OUStringLiteral sTextWordWrap( u"TextWordWrap" );
+ static constexpr OUStringLiteral sTextWordWrap( u"TextWordWrap" );
Reference< XPropertySetInfo > xInfo( xDefaults->getPropertySetInfo() );
if ( xInfo->hasPropertyByName( sTextWordWrap ) )
xDefaults->setPropertyValue( sTextWordWrap, Any( bWordWrapDefault ) );
diff --git a/xmloff/source/draw/layerexp.cxx b/xmloff/source/draw/layerexp.cxx
index 491d28c9d4ab..82a8dd410d6a 100644
--- a/xmloff/source/draw/layerexp.cxx
+++ b/xmloff/source/draw/layerexp.cxx
@@ -53,12 +53,12 @@ void SdXMLayerExporter::exportLayer( SvXMLExport& rExport )
if( nCount == 0 )
return;
- static const OUStringLiteral strName( u"Name" );
- static const OUStringLiteral strTitle( u"Title" );
- static const OUStringLiteral strDescription( u"Description" );
- static const OUStringLiteral strIsVisible( u"IsVisible");
- static const OUStringLiteral strIsPrintable( u"IsPrintable");
- static const OUStringLiteral strIsLocked( u"IsLocked" );
+ static constexpr OUStringLiteral strName( u"Name" );
+ static constexpr OUStringLiteral strTitle( u"Title" );
+ static constexpr OUStringLiteral strDescription( u"Description" );
+ static constexpr OUStringLiteral strIsVisible( u"IsVisible");
+ static constexpr OUStringLiteral strIsPrintable( u"IsPrintable");
+ static constexpr OUStringLiteral strIsLocked( u"IsLocked" );
OUString sTmp;
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 915c3e9360c0..6b28da6fd2e2 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -1377,7 +1377,7 @@ HeaderFooterPageSettingsImpl SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( cons
OUString aStrText;
- static const OUStringLiteral aStrHeaderTextProp( u"HeaderText" );
+ static constexpr OUStringLiteral aStrHeaderTextProp( u"HeaderText" );
if( xInfo->hasPropertyByName( aStrHeaderTextProp ) )
{
xSet->getPropertyValue( aStrHeaderTextProp ) >>= aStrText;
@@ -1385,7 +1385,7 @@ HeaderFooterPageSettingsImpl SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( cons
aSettings.maStrHeaderDeclName = findOrAppendImpl( maHeaderDeclsVector, aStrText, gpStrHeaderTextPrefix );
}
- static const OUStringLiteral aStrFooterTextProp( u"FooterText" );
+ static constexpr OUStringLiteral aStrFooterTextProp( u"FooterText" );
if( xInfo->hasPropertyByName( aStrFooterTextProp ) )
{
xSet->getPropertyValue( aStrFooterTextProp ) >>= aStrText;
@@ -1393,7 +1393,7 @@ HeaderFooterPageSettingsImpl SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( cons
aSettings.maStrFooterDeclName = findOrAppendImpl( maFooterDeclsVector, aStrText, gpStrFooterTextPrefix );
}
- static const OUStringLiteral aStrDateTimeTextProp( u"DateTimeText" );
+ static constexpr OUStringLiteral aStrDateTimeTextProp( u"DateTimeText" );
if( xInfo->hasPropertyByName( aStrDateTimeTextProp ) )
{
bool bFixed = false;
@@ -1508,7 +1508,7 @@ OUString SdXMLExport::ImpCreatePresPageStyleName( const Reference<XDrawPage>& xD
// which itself is a property of the pages property set
// we now merge these two propertysets if possible to simulate
// a single propertyset with all draw page properties
- static const OUStringLiteral aBackground(u"Background");
+ static constexpr OUStringLiteral aBackground(u"Background");
Reference< beans::XPropertySet > xPropSet2;
Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) )
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 ) );
diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx
index 3665533eeff7..c3ea5a4b0f70 100644
--- a/xmloff/source/draw/xexptran.cxx
+++ b/xmloff/source/draw/xexptran.cxx
@@ -355,12 +355,12 @@ void SdXMLImExTransform2D::SetString(const OUString& rNew, const SvXMLUnitConver
const OUString aStr = msString;
const sal_Int32 nLen(aStr.getLength());
- static const OUStringLiteral aString_rotate( u"rotate" );
- static const OUStringLiteral aString_scale( u"scale" );
- static const OUStringLiteral aString_translate( u"translate" );
- static const OUStringLiteral aString_skewX( u"skewX" );
- static const OUStringLiteral aString_skewY( u"skewY" );
- static const OUStringLiteral aString_matrix( u"matrix" );
+ static constexpr OUStringLiteral aString_rotate( u"rotate" );
+ static constexpr OUStringLiteral aString_scale( u"scale" );
+ static constexpr OUStringLiteral aString_translate( u"translate" );
+ static constexpr OUStringLiteral aString_skewX( u"skewX" );
+ static constexpr OUStringLiteral aString_skewY( u"skewY" );
+ static constexpr OUStringLiteral aString_matrix( u"matrix" );
sal_Int32 nPos(0);
@@ -762,12 +762,12 @@ void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConver
const OUString aStr = msString;
const sal_Int32 nLen(aStr.getLength());
- static const OUStringLiteral aString_rotatex( u"rotatex" );
- static const OUStringLiteral aString_rotatey( u"rotatey" );
- static const OUStringLiteral aString_rotatez( u"rotatez" );
- static const OUStringLiteral aString_scale( u"scale" );
- static const OUStringLiteral aString_translate( u"translate" );
- static const OUStringLiteral aString_matrix( u"matrix" );
+ static constexpr OUStringLiteral aString_rotatex( u"rotatex" );
+ static constexpr OUStringLiteral aString_rotatey( u"rotatey" );
+ static constexpr OUStringLiteral aString_rotatez( u"rotatez" );
+ static constexpr OUStringLiteral aString_scale( u"scale" );
+ static constexpr OUStringLiteral aString_translate( u"translate" );
+ static constexpr OUStringLiteral aString_matrix( u"matrix" );
sal_Int32 nPos(0);
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 117942c72f0b..c97be226bd3e 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -286,7 +286,7 @@ void SdXMLGenericPageContext::endFastElement(sal_Int32 )
if( !maUseHeaderDeclName.isEmpty() )
{
- static const OUStringLiteral aStrHeaderTextProp( u"HeaderText" );
+ static constexpr OUStringLiteral aStrHeaderTextProp( u"HeaderText" );
if( xInfo->hasPropertyByName( aStrHeaderTextProp ) )
xSet->setPropertyValue( aStrHeaderTextProp,
Any( GetSdImport().GetHeaderDecl( maUseHeaderDeclName ) ) );
@@ -294,7 +294,7 @@ void SdXMLGenericPageContext::endFastElement(sal_Int32 )
if( !maUseFooterDeclName.isEmpty() )
{
- static const OUStringLiteral aStrFooterTextProp( u"FooterText" );
+ static constexpr OUStringLiteral aStrFooterTextProp( u"FooterText" );
if( xInfo->hasPropertyByName( aStrFooterTextProp ) )
xSet->setPropertyValue( aStrFooterTextProp,
Any( GetSdImport().GetFooterDecl( maUseFooterDeclName ) ) );
@@ -302,7 +302,7 @@ void SdXMLGenericPageContext::endFastElement(sal_Int32 )
if( !maUseDateTimeDeclName.isEmpty() )
{
- static const OUStringLiteral aStrDateTimeTextProp( u"DateTimeText" );
+ static constexpr OUStringLiteral aStrDateTimeTextProp( u"DateTimeText" );
if( xInfo->hasPropertyByName( aStrDateTimeTextProp ) )
{
bool bFixed;
@@ -369,7 +369,7 @@ void SdXMLGenericPageContext::SetStyle( OUString const & rStyleName )
Reference< beans::XPropertySet > xPropSet( xPropSet1 );
Reference< beans::XPropertySet > xBackgroundSet;
- static const OUStringLiteral aBackground(u"Background");
+ static constexpr OUStringLiteral aBackground(u"Background");
if( xPropSet1->getPropertySetInfo()->hasPropertyByName( aBackground ) )
{
Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 5e965eba5aaa..c64a80b756a1 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2195,7 +2195,7 @@ void SdXMLPageShapeContext::startFastElement (sal_Int32 nElement,
if(xPropSet.is())
{
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))
xPropSet->setPropertyValue(aPageNumberStr, uno::Any( mnPageNumber ));
}
@@ -2627,7 +2627,7 @@ void SdXMLObjectShapeContext::startFastElement (sal_Int32 /*nElement*/,
if ( GetImport().IsPackageURL( maHref ) )
{
- static const OUStringLiteral sURL( u"vnd.sun.star.EmbeddedObject:" );
+ static constexpr OUStringLiteral sURL( u"vnd.sun.star.EmbeddedObject:" );
if ( aPersistName.startsWith( sURL ) )
aPersistName = aPersistName.copy( sURL.getLength() );
@@ -2675,7 +2675,7 @@ void SdXMLObjectShapeContext::endFastElement(sal_Int32 nElement)
if( mxBase64Stream.is() )
{
OUString aPersistName( GetImport().ResolveEmbeddedObjectURLFromBase64() );
- static const OUStringLiteral sURL( u"vnd.sun.star.EmbeddedObject:" );
+ static constexpr OUStringLiteral sURL( u"vnd.sun.star.EmbeddedObject:" );
aPersistName = aPersistName.copy( sURL.getLength() );
@@ -2991,7 +2991,7 @@ void SdXMLPluginShapeContext::endFastElement(sal_Int32 nElement)
{
if ( maSize.Width && maSize.Height )
{
- static const OUStringLiteral sVisibleArea( u"VisibleArea" );
+ static constexpr OUStringLiteral sVisibleArea( u"VisibleArea" );
uno::Reference< beans::XPropertySetInfo > aXPropSetInfo( xProps->getPropertySetInfo() );
if ( !aXPropSetInfo.is() || aXPropSetInfo->hasPropertyByName( sVisibleArea ) )
{
@@ -3671,7 +3671,7 @@ void SdXMLCustomShapeContext::endFastElement(sal_Int32 nElement)
if (aScale.getX() < 0.0)
{
- static const OUStringLiteral sName(u"MirroredX");
+ static constexpr OUStringLiteral sName(u"MirroredX");
//fdo#84043 Merge, if property exists, otherwise append it
auto aI = std::find_if(maCustomShapeGeometry.begin(), maCustomShapeGeometry.end(),
[](beans::PropertyValue& rValue) { return rValue.Name == sName; });
@@ -3697,7 +3697,7 @@ void SdXMLCustomShapeContext::endFastElement(sal_Int32 nElement)
if (aScale.getY() < 0.0)
{
- static const OUStringLiteral sName(u"MirroredY");
+ static constexpr OUStringLiteral sName(u"MirroredY");
//fdo#84043 Merge, if property exists, otherwise append it
auto aI = std::find_if(maCustomShapeGeometry.begin(), maCustomShapeGeometry.end(),
[](beans::PropertyValue& rValue) { return rValue.Name == sName; });
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 6f75963056b2..e03b87662c1e 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -245,7 +245,7 @@ void SvXMLMetaDocumentContext::setBuildId(std::u16string_view i_rBuildId, const
{
OUStringBuffer sBuffer(
i_rBuildId.substr( nBegin+1, nEnd-nBegin-1 ) );
- static const OUStringLiteral sBuildCompare(
+ static constexpr OUStringLiteral sBuildCompare(
u"$Build-" );
nBegin = i_rBuildId.find( sBuildCompare, nEnd );
if ( nBegin != std::u16string_view::npos )
@@ -305,7 +305,7 @@ void SvXMLMetaDocumentContext::setBuildId(std::u16string_view i_rBuildId, const
{
if( xImportInfo.is() )
{
- static const OUStringLiteral aPropName(u"BuildId");
+ static constexpr OUStringLiteral aPropName(u"BuildId");
uno::Reference< beans::XPropertySetInfo > xSetInfo(
xImportInfo->getPropertySetInfo());
if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) )
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index a428cdf4c546..41f212901feb 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -215,7 +215,7 @@ XMLPageExport::XMLPageExport(SvXMLExport & rExp)
"getStyleFamilies() from XModel failed for export!" );
if( xFamilies.is() )
{
- static const OUStringLiteral aPageStyleName(u"PageStyles");
+ static constexpr OUStringLiteral aPageStyleName(u"PageStyles");
if( xFamilies->hasByName( aPageStyleName ) )
{
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index 8280ce2f47be..4c00fab10e96 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -798,7 +798,7 @@ void SvxXMLNumRuleExport::exportStyles( bool bUsed, bool bExportChapterNumbering
if( !xFamilies.is() )
return;
- static const OUStringLiteral aNumberStyleName( u"NumberingStyles" );
+ static constexpr OUStringLiteral aNumberStyleName( u"NumberingStyles" );
Reference< XIndexAccess > xStyles;
if( !xFamilies->hasByName( aNumberStyleName ) )
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 3bc2adba5cee..fe6613836bca 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -712,7 +712,7 @@ void XMLCellStyleExport::exportStyleAttributes(const Reference<XStyle>& rStyle)
return;
Reference<XPropertySetInfo> xPropSetInfo(xPropSet->getPropertySetInfo());
- static const OUStringLiteral sNumberFormat(u"NumberFormat");
+ static constexpr OUStringLiteral sNumberFormat(u"NumberFormat");
if (xPropSetInfo->hasPropertyByName(sNumberFormat))
{
Reference<XPropertyState> xPropState(xPropSet, UNO_QUERY);
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index cba9da2a7293..ceea38316150 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -1588,7 +1588,7 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
if ( !xTextFieldsSupp.is() )
return;
- static const OUStringLiteral sFieldMaster_Bibliography(u"com.sun.star.text.FieldMaster.Bibliography");
+ static constexpr OUStringLiteral sFieldMaster_Bibliography(u"com.sun.star.text.FieldMaster.Bibliography");
// get bibliography field master
Reference<XNameAccess> xMasters =
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 8d0bac4964dc..2df8234dfa0d 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -307,14 +307,14 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
xPropSet->setPropertyValue( sContourPolyPolygon, Any(aPointSequenceSequence) );
}
- static const OUStringLiteral sIsPixelContour(u"IsPixelContour");
+ static constexpr OUStringLiteral sIsPixelContour(u"IsPixelContour");
if( xPropSetInfo->hasPropertyByName( sIsPixelContour ) )
{
xPropSet->setPropertyValue( sIsPixelContour, Any(bPixelWidth) );
}
- static const OUStringLiteral sIsAutomaticContour(u"IsAutomaticContour");
+ static constexpr OUStringLiteral sIsAutomaticContour(u"IsAutomaticContour");
if( xPropSetInfo->hasPropertyByName( sIsAutomaticContour ) )
{
diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
index 9c176c7f4f47..db79c6933273 100644
--- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx
+++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
@@ -69,7 +69,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport,
}
if (bFirst)
{
- static const OUStringLiteral sShareContentFirst( u"FirstIsShared" );
+ static constexpr OUStringLiteral sShareContentFirst( u"FirstIsShared" );
aAny = xPropSet->getPropertyValue( sShareContentFirst );
bool bSharedFirst = bool();
if (!(aAny >>= bSharedFirst))
diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx
index 5f138010ec06..1e62a66e6846 100644
--- a/xmloff/source/text/XMLTextListAutoStylePool.cxx
+++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx
@@ -166,7 +166,7 @@ XMLTextListAutoStylePool::XMLTextListAutoStylePool( SvXMLExport& rExp ) :
xFamilies = xFamiliesSupp->getStyleFamilies();
Reference<XIndexAccess> xStyles;
- static const OUStringLiteral aNumberStyleName(u"NumberingStyles");
+ static constexpr OUStringLiteral aNumberStyleName(u"NumberingStyles");
if (xFamilies.is() && xFamilies->hasByName(aNumberStyleName))
xFamilies->getByName(aNumberStyleName) >>= xStyles;
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index b31c2b6ab99b..0a4a18ad10d3 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -456,42 +456,42 @@ XMLTextImportHelper::XMLTextImportHelper(
{
Reference< XNameAccess > xFamilies(xFamiliesSupp->getStyleFamilies());
- static const OUStringLiteral aParaStyles(u"ParagraphStyles");
+ static constexpr OUStringLiteral aParaStyles(u"ParagraphStyles");
if( xFamilies->hasByName( aParaStyles ) )
{
m_xImpl->m_xParaStyles.set(xFamilies->getByName(aParaStyles),
UNO_QUERY);
}
- static const OUStringLiteral aCharStyles(u"CharacterStyles");
+ static constexpr OUStringLiteral aCharStyles(u"CharacterStyles");
if( xFamilies->hasByName( aCharStyles ) )
{
m_xImpl->m_xTextStyles.set(xFamilies->getByName(aCharStyles),
UNO_QUERY);
}
- static const OUStringLiteral aNumStyles(u"NumberingStyles");
+ static constexpr OUStringLiteral aNumStyles(u"NumberingStyles");
if( xFamilies->hasByName( aNumStyles ) )
{
m_xImpl->m_xNumStyles.set(xFamilies->getByName(aNumStyles),
UNO_QUERY);
}
- static const OUStringLiteral aFrameStyles(u"FrameStyles");
+ static constexpr OUStringLiteral aFrameStyles(u"FrameStyles");
if( xFamilies->hasByName( aFrameStyles ) )
{
m_xImpl->m_xFrameStyles.set(xFamilies->getByName(aFrameStyles),
UNO_QUERY);
}
- static const OUStringLiteral aPageStyles(u"PageStyles");
+ static constexpr OUStringLiteral aPageStyles(u"PageStyles");
if( xFamilies->hasByName( aPageStyles ) )
{
m_xImpl->m_xPageStyles.set(xFamilies->getByName(aPageStyles),
UNO_QUERY);
}
- static const OUStringLiteral aCellStyles(u"CellStyles");
+ static constexpr OUStringLiteral aCellStyles(u"CellStyles");
if( xFamilies->hasByName( aCellStyles ) )
{
m_xImpl->m_xCellStyles.set(xFamilies->getByName(aCellStyles),
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 6407e0248626..3591e4c41c02 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -525,8 +525,8 @@ void BoundFrames::Fill(const filter_t& rFilter)
const Reference< XEnumeration > xEnum = m_xEnumAccess->createEnumeration();
if(!xEnum.is())
return;
- static const OUStringLiteral our_sAnchorType(u"AnchorType");
- static const OUStringLiteral our_sAnchorFrame(u"AnchorFrame");
+ static constexpr OUStringLiteral our_sAnchorType(u"AnchorType");
+ static constexpr OUStringLiteral our_sAnchorFrame(u"AnchorFrame");
while(xEnum->hasMoreElements())
{
Reference<XPropertySet> xPropSet(xEnum->nextElement(), UNO_QUERY);