diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-03 11:06:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-03 13:26:38 +0100 |
commit | 8e2fe1bb107c263cd3a0b04c14fc0267b3df2380 (patch) | |
tree | 5ed2795497b3ed9707dade3882d7a2b455236c6b /dbaccess/source | |
parent | 9e1e88ad5cf2dc0e9b188c60930445652a6c7519 (diff) |
loplugin:stringliteraldefine in dbaccess
Change-Id: Ic7c2d23747d56432037f145b7ce9a5b6cf3724cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126283
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/browser/dbloader.cxx | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx index 3530bf7a6acd..67645e92e611 100644 --- a/dbaccess/source/ui/browser/dbloader.cxx +++ b/dbaccess/source/ui/browser/dbloader.cxx @@ -113,22 +113,17 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU m_xListener = rListener; m_aArgs = rArgs; - static const struct ServiceNameToImplName + static constexpr struct ServiceNameToImplName { - const char* pAsciiServiceName; + rtl::OUStringConstExpr sServiceName; const char* pAsciiImplementationName; - ServiceNameToImplName( const char* _pService, const char* _pImpl ) - :pAsciiServiceName( _pService ) - ,pAsciiImplementationName( _pImpl ) - { - } } aImplementations[] = { - ServiceNameToImplName( URL_COMPONENT_FORMGRIDVIEW, "org.openoffice.comp.dbu.OFormGridView" ), - ServiceNameToImplName( URL_COMPONENT_DATASOURCEBROWSER, "org.openoffice.comp.dbu.ODatasourceBrowser" ), - ServiceNameToImplName( URL_COMPONENT_QUERYDESIGN, "org.openoffice.comp.dbu.OQueryDesign" ), - ServiceNameToImplName( URL_COMPONENT_TABLEDESIGN, "org.openoffice.comp.dbu.OTableDesign" ), - ServiceNameToImplName( URL_COMPONENT_RELATIONDESIGN, "org.openoffice.comp.dbu.ORelationDesign" ), - ServiceNameToImplName( URL_COMPONENT_VIEWDESIGN, "org.openoffice.comp.dbu.OViewDesign" ) + { URL_COMPONENT_FORMGRIDVIEW, "org.openoffice.comp.dbu.OFormGridView" }, + { URL_COMPONENT_DATASOURCEBROWSER, "org.openoffice.comp.dbu.ODatasourceBrowser" }, + { URL_COMPONENT_QUERYDESIGN, "org.openoffice.comp.dbu.OQueryDesign" }, + { URL_COMPONENT_TABLEDESIGN, "org.openoffice.comp.dbu.OTableDesign" }, + { URL_COMPONENT_RELATIONDESIGN, "org.openoffice.comp.dbu.ORelationDesign" }, + { URL_COMPONENT_VIEWDESIGN, "org.openoffice.comp.dbu.OViewDesign" } }; INetURLObject aParser( rURL ); @@ -137,7 +132,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU const OUString sComponentURL( aParser.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ) ); for (const ServiceNameToImplName& aImplementation : aImplementations) { - if ( sComponentURL.equalsAscii( aImplementation.pAsciiServiceName ) ) + if ( sComponentURL == aImplementation.sServiceName ) { xController.set( m_xContext->getServiceManager()-> createInstanceWithContext( OUString::createFromAscii( aImplementation.pAsciiImplementationName ), m_xContext), UNO_QUERY_THROW ); |