dbaccess/inc/core_resource.hxx | 4 ++-- dbaccess/source/core/api/RowSet.cxx | 2 +- dbaccess/source/core/dataaccess/databasedocument.cxx | 4 ++-- dbaccess/source/core/resource/core_resource.cxx | 8 ++++---- dbaccess/source/ui/browser/dbloader.cxx | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-)
New commits: commit 9e8fd61044aa290e9c809fa4472f2406202dc881 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue May 7 14:26:40 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 11 12:43:02 2024 +0200 replace createFromAscii with OUString literals in ResourceManager Change-Id: Iea6430d5f56a1f30a5dd168fcf2fee2ba7198f18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167499 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/dbaccess/inc/core_resource.hxx b/dbaccess/inc/core_resource.hxx index 000a59bf1713..e806c398d297 100644 --- a/dbaccess/inc/core_resource.hxx +++ b/dbaccess/inc/core_resource.hxx @@ -57,9 +57,9 @@ namespace dbaccess */ static OUString loadString( TranslateId pResId, - const char* _pPlaceholderAscii1, + std::u16string_view _rPlaceholderAscii1, std::u16string_view _rReplace1, - const char* _pPlaceholderAscii2, + std::u16string_view _rPlaceholderAscii2, std::u16string_view _rReplace2 ); }; diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index a65e842e8557..56bdcb3435be 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -2180,7 +2180,7 @@ Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionH { Any aError = ::cppu::getCaughtException(); OUString sMessage = ResourceManager::loadString( RID_NO_SUCH_DATA_SOURCE, - "$name$", m_aDataSourceName, "$error$", extractExceptionMessage( m_aContext, aError ) ); + u"$name$", m_aDataSourceName, u"$error$", extractExceptionMessage( m_aContext, aError ) ); ::dbtools::throwGenericSQLException( sMessage, *this, aError ); } } diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 117e49300c7d..5e0bb346b572 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -993,8 +993,8 @@ void ODatabaseDocument::impl_throwIOExceptionCausedBySave_throw( const Any& i_rE OUString sErrorMessage = extractExceptionMessage( m_pImpl->m_aContext, i_rError ); sErrorMessage = ResourceManager::loadString( RID_STR_ERROR_WHILE_SAVING, - "$location$", i_rTargetURL, - "$message$", sErrorMessage + u"$location$", i_rTargetURL, + u"$message$", sErrorMessage ); throw IOException( sErrorMessage, *const_cast< ODatabaseDocument* >( this ) ); } diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx index fdef07e1f8f8..8a0bba5b67de 100644 --- a/dbaccess/source/core/resource/core_resource.cxx +++ b/dbaccess/source/core/resource/core_resource.cxx @@ -28,12 +28,12 @@ namespace dbaccess return Translate::get(pResId, Translate::Create("dba")); } - OUString ResourceManager::loadString(TranslateId pResId, const char* _pPlaceholderAscii1, std::u16string_view _rReplace1, - const char* _pPlaceholderAscii2, std::u16string_view _rReplace2) + OUString ResourceManager::loadString(TranslateId pResId, std::u16string_view _rPlaceholderAscii1, std::u16string_view _rReplace1, + std::u16string_view _rPlaceholderAscii2, std::u16string_view _rReplace2) { OUString sString(loadString(pResId)); - sString = sString.replaceFirst( OUString::createFromAscii(_pPlaceholderAscii1), _rReplace1 ); - sString = sString.replaceFirst( OUString::createFromAscii(_pPlaceholderAscii2), _rReplace2 ); + sString = sString.replaceFirst( _rPlaceholderAscii1, _rReplace1 ); + sString = sString.replaceFirst( _rPlaceholderAscii2, _rReplace2 ); return sString; } } commit 3908d2aa90df3f600fdf2acd9f570b895669feab Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue May 7 14:34:32 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 11 12:42:53 2024 +0200 replace createFromAscii with OUString literals in DBContentLoader Change-Id: Iaa1169be4ab9db824af4406dd18e6c36326bdcd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167503 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx index 73cf00ccd942..ba4e206d446c 100644 --- a/dbaccess/source/ui/browser/dbloader.cxx +++ b/dbaccess/source/ui/browser/dbloader.cxx @@ -117,14 +117,14 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU static constexpr struct ServiceNameToImplName { OUString sServiceName; - const char* pAsciiImplementationName; + OUString aAsciiImplementationName; } aImplementations[] = { - { 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" } + { URL_COMPONENT_FORMGRIDVIEW, u"org.openoffice.comp.dbu.OFormGridView"_ustr }, + { URL_COMPONENT_DATASOURCEBROWSER, u"org.openoffice.comp.dbu.ODatasourceBrowser"_ustr }, + { URL_COMPONENT_QUERYDESIGN, u"org.openoffice.comp.dbu.OQueryDesign"_ustr }, + { URL_COMPONENT_TABLEDESIGN, u"org.openoffice.comp.dbu.OTableDesign"_ustr }, + { URL_COMPONENT_RELATIONDESIGN, u"org.openoffice.comp.dbu.ORelationDesign"_ustr }, + { URL_COMPONENT_VIEWDESIGN, u"org.openoffice.comp.dbu.OViewDesign"_ustr } }; INetURLObject aParser( rURL ); @@ -136,7 +136,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU if ( sComponentURL == aImplementation.sServiceName ) { xController.set( m_xContext->getServiceManager()-> - createInstanceWithContext( OUString::createFromAscii( aImplementation.pAsciiImplementationName ), m_xContext), UNO_QUERY_THROW ); + createInstanceWithContext( aImplementation.aAsciiImplementationName, m_xContext), UNO_QUERY_THROW ); break; } }