From ac396f2f6b058ddff8c394443669b8c5d8b97b71 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 8 Jan 2021 19:54:55 +0000 Subject: fix coverity parse errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- dbaccess/source/core/api/FilteredContainer.cxx | 2 +- dbaccess/source/core/dataaccess/databasedocument.cxx | 2 +- dbaccess/source/core/misc/DatabaseDataProvider.cxx | 2 +- dbaccess/source/core/recovery/dbdocrecovery.cxx | 4 ++-- dbaccess/source/core/recovery/storagetextstream.cxx | 2 +- dbaccess/source/core/recovery/subcomponentrecovery.cxx | 4 ++-- dbaccess/source/ui/app/AppController.cxx | 2 +- dbaccess/source/ui/app/AppControllerGen.cxx | 2 +- dbaccess/source/ui/dlg/queryfilter.cxx | 4 ++-- dbaccess/source/ui/misc/indexcollection.cxx | 2 +- dbaccess/source/ui/querydesign/querycontroller.cxx | 4 ++-- 11 files changed, 15 insertions(+), 15 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index 74b522a4b459..1b08eb8fa7ca 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -343,7 +343,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std:: } } - static const OUStringLiteral sAll = u"%"; + static constexpr OUStringLiteral sAll = u"%"; Reference< XResultSet > xTables = m_xMetaData->getTables( Any(), sAll, sAll, aTableTypeFilter ); Reference< XRow > xCurrentRow( xTables, UNO_QUERY_THROW ); diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index b5a789fad212..21d0d3012077 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -311,7 +311,7 @@ namespace } } -const OUStringLiteral sPictures = u"Pictures"; +constexpr OUStringLiteral sPictures = u"Pictures"; // base documents seem to have a different behaviour to other documents, the // root storage contents at least seem to be re-used over different saves, thus if there is a diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index f317bd474c38..2098f513f343 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -266,7 +266,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::cre osl::MutexGuard g(m_aMutex); uno::Reference< chart2::data::XDataSequence > xData = m_xInternal->createDataSequenceByRangeRepresentation(_sRangeRepresentation); uno::Reference xProp(xData,uno::UNO_QUERY); - static const OUStringLiteral s_sNumberFormatKey = u"NumberFormatKey"; + static constexpr OUStringLiteral s_sNumberFormatKey = u"NumberFormatKey"; if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(s_sNumberFormatKey) ) { xProp->setPropertyValue(s_sNumberFormatKey,impl_getNumberFormatKey_nothrow(_sRangeRepresentation)); diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx index d111aa86b6cf..db7bb53bd53c 100644 --- a/dbaccess/source/core/recovery/dbdocrecovery.cxx +++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx @@ -86,9 +86,9 @@ namespace dbaccess return true; } - const OUStringLiteral sRecoveryDataSubStorageName = u"recovery"; + constexpr OUStringLiteral sRecoveryDataSubStorageName = u"recovery"; - const OUStringLiteral sObjectMapStreamName = u"storage-component-map.ini"; + constexpr OUStringLiteral sObjectMapStreamName = u"storage-component-map.ini"; void lcl_writeObjectMap_throw( const Reference & i_rContext, const Reference< XStorage >& i_rStorage, const MapStringToCompDesc& i_mapStorageToCompDesc ) diff --git a/dbaccess/source/core/recovery/storagetextstream.cxx b/dbaccess/source/core/recovery/storagetextstream.cxx index 1dd774bc8a31..32f68da9a087 100644 --- a/dbaccess/source/core/recovery/storagetextstream.cxx +++ b/dbaccess/source/core/recovery/storagetextstream.cxx @@ -36,7 +36,7 @@ namespace dbaccess Reference< XTextOutputStream2 > xTextOutput; }; - const OUStringLiteral sLineFeed = u"\n"; + constexpr OUStringLiteral sLineFeed = u"\n"; // StorageTextOutputStream StorageTextOutputStream::StorageTextOutputStream( const Reference& i_rContext, diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.cxx b/dbaccess/source/core/recovery/subcomponentrecovery.cxx index 11dfa49d17ad..3549cd647fd8 100644 --- a/dbaccess/source/core/recovery/subcomponentrecovery.cxx +++ b/dbaccess/source/core/recovery/subcomponentrecovery.cxx @@ -160,8 +160,8 @@ namespace dbaccess return xCommandProcessor; } - const OUStringLiteral sSettingsStreamName = u"settings.xml"; - const OUStringLiteral sCurrentQueryDesignName = u"ooo:current-query-design"; + constexpr OUStringLiteral sSettingsStreamName = u"settings.xml"; + constexpr OUStringLiteral sCurrentQueryDesignName = u"ooo:current-query-design"; } namespace { diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index d75d557615a2..8905536c853d 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -674,7 +674,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = xEnumAccess.is(); if ( aReturn.bEnabled ) { - static const OUStringLiteral s_sReportDesign = u"org.libreoffice.report.pentaho.SOReportJobFactory"; + static constexpr OUStringLiteral s_sReportDesign = u"org.libreoffice.report.pentaho.SOReportJobFactory"; Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(s_sReportDesign); aReturn.bEnabled = xEnumDrivers.is() && xEnumDrivers->hasMoreElements(); } diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 0ce728d7fa2a..28b4c4053da3 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -639,7 +639,7 @@ void OApplicationController::onLoadedMenu(const Reference< css::frame::XLayoutMa if ( !_xLayoutManager.is() ) return; - static const OUStringLiteral s_sStatusbar = u"private:resource/statusbar/statusbar"; + static constexpr OUStringLiteral s_sStatusbar = u"private:resource/statusbar/statusbar"; _xLayoutManager->createElement( s_sStatusbar ); _xLayoutManager->requestElement( s_sStatusbar ); diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index da4d61641936..1b75869cf15e 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -304,10 +304,10 @@ bool DlgFilterCrit::getCondition(const weld::ComboBox& _rField,const weld::Combo } } xColumn->getPropertyValue(PROPERTY_REALNAME) >>= _rFilter.Name; - static const OUStringLiteral sAgg = u"AggregateFunction"; + static constexpr OUStringLiteral sAgg = u"AggregateFunction"; if ( xInfo->hasPropertyByName(sAgg) ) xColumn->getPropertyValue(sAgg) >>= bHaving; - static const OUStringLiteral sFunction = u"Function"; + static constexpr OUStringLiteral sFunction = u"Function"; if ( xInfo->hasPropertyByName(sFunction) ) xColumn->getPropertyValue(sFunction) >>= bFunction; } diff --git a/dbaccess/source/ui/misc/indexcollection.cxx b/dbaccess/source/ui/misc/indexcollection.cxx index 046a41a000ea..8a5448e623f9 100644 --- a/dbaccess/source/ui/misc/indexcollection.cxx +++ b/dbaccess/source/ui/misc/indexcollection.cxx @@ -122,7 +122,7 @@ namespace dbaui } // set the properties - static const OUStringLiteral s_sNamePropertyName = u"Name"; + static constexpr OUStringLiteral s_sNamePropertyName = u"Name"; // the index' own props xIndexDescriptor->setPropertyValue("IsUnique", css::uno::makeAny(_rPos->bUnique)); xIndexDescriptor->setPropertyValue(s_sNamePropertyName, makeAny(_rPos->sName)); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 5bab3d26f30b..aa9145d5cb7a 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -149,8 +149,8 @@ namespace return; xLayoutManager->lock(); - static const OUStringLiteral s_sDesignToolbar = u"private:resource/toolbar/designobjectbar"; - static const OUStringLiteral s_sSqlToolbar = u"private:resource/toolbar/sqlobjectbar"; + static constexpr OUStringLiteral s_sDesignToolbar = u"private:resource/toolbar/designobjectbar"; + static constexpr OUStringLiteral s_sSqlToolbar = u"private:resource/toolbar/sqlobjectbar"; if ( _bDesign ) { xLayoutManager->destroyElement( s_sSqlToolbar ); -- cgit