dbaccess/source/core/misc/dsntypes.cxx | 4 +-- dbaccess/source/inc/dsntypes.hxx | 2 - dbaccess/source/ui/app/AppDetailView.cxx | 24 +++++++++++----------- dbaccess/source/ui/app/AppDetailView.hxx | 2 - dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 2 - dbaccess/source/ui/dlg/generalpage.cxx | 2 - 6 files changed, 18 insertions(+), 18 deletions(-)
New commits: commit 40b89a47890eb706939f4d75d11c6eceee300841 Author: Noel Grandin <[email protected]> AuthorDate: Tue May 7 14:32:24 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat May 11 12:41:37 2024 +0200 replace createFromAscii with OUString literals in OApplicationDetailView Change-Id: Icb7961ad247711e6a3b4761e7d6922ba7e4848a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167501 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index ecd8a8dce7ee..a9613e1b4b36 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -48,8 +48,8 @@ using namespace ::com::sun::star::beans; using ::com::sun::star::util::URL; using ::com::sun::star::sdb::application::NamedDatabaseObject; -TaskEntry::TaskEntry( const char* _pAsciiUNOCommand, TranslateId _pHelpID, TranslateId pTitleResourceID, bool _bHideWhenDisabled ) - :sUNOCommand( OUString::createFromAscii( _pAsciiUNOCommand ) ) +TaskEntry::TaskEntry( const OUString& _rAsciiUNOCommand, TranslateId _pHelpID, TranslateId pTitleResourceID, bool _bHideWhenDisabled ) + :sUNOCommand( _rAsciiUNOCommand ) ,pHelpID( _pHelpID ) ,sTitle( DBA_RES(pTitleResourceID) ) ,bHideWhenDisabled( _bHideWhenDisabled ) @@ -259,28 +259,28 @@ void OApplicationDetailView::impl_fillTaskPaneData(ElementType _eType, TaskPaneD switch ( _eType ) { case E_TABLE: - rList.emplace_back( ".uno:DBNewTable", RID_STR_TABLES_HELP_TEXT_DESIGN, RID_STR_NEW_TABLE ); - rList.emplace_back( ".uno:DBNewTableAutoPilot", RID_STR_TABLES_HELP_TEXT_WIZARD, RID_STR_NEW_TABLE_AUTO ); - rList.emplace_back( ".uno:DBNewView", RID_STR_VIEWS_HELP_TEXT_DESIGN, RID_STR_NEW_VIEW, true ); + rList.emplace_back( u".uno:DBNewTable"_ustr, RID_STR_TABLES_HELP_TEXT_DESIGN, RID_STR_NEW_TABLE ); + rList.emplace_back( u".uno:DBNewTableAutoPilot"_ustr, RID_STR_TABLES_HELP_TEXT_WIZARD, RID_STR_NEW_TABLE_AUTO ); + rList.emplace_back( u".uno:DBNewView"_ustr, RID_STR_VIEWS_HELP_TEXT_DESIGN, RID_STR_NEW_VIEW, true ); _rData.pTitleId = RID_STR_TABLES_CONTAINER; break; case E_FORM: - rList.emplace_back( ".uno:DBNewForm", RID_STR_FORMS_HELP_TEXT, RID_STR_NEW_FORM ); - rList.emplace_back( ".uno:DBNewFormAutoPilot", RID_STR_FORMS_HELP_TEXT_WIZARD, RID_STR_NEW_FORM_AUTO ); + rList.emplace_back( u".uno:DBNewForm"_ustr, RID_STR_FORMS_HELP_TEXT, RID_STR_NEW_FORM ); + rList.emplace_back( u".uno:DBNewFormAutoPilot"_ustr, RID_STR_FORMS_HELP_TEXT_WIZARD, RID_STR_NEW_FORM_AUTO ); _rData.pTitleId = RID_STR_FORMS_CONTAINER; break; case E_REPORT: - rList.emplace_back( ".uno:DBNewReport", RID_STR_REPORT_HELP_TEXT, RID_STR_NEW_REPORT, true ); - rList.emplace_back( ".uno:DBNewReportAutoPilot", RID_STR_REPORTS_HELP_TEXT_WIZARD, RID_STR_NEW_REPORT_AUTO ); + rList.emplace_back( u".uno:DBNewReport"_ustr, RID_STR_REPORT_HELP_TEXT, RID_STR_NEW_REPORT, true ); + rList.emplace_back( u".uno:DBNewReportAutoPilot"_ustr, RID_STR_REPORTS_HELP_TEXT_WIZARD, RID_STR_NEW_REPORT_AUTO ); _rData.pTitleId = RID_STR_REPORTS_CONTAINER; break; case E_QUERY: - rList.emplace_back( ".uno:DBNewQuery", RID_STR_QUERIES_HELP_TEXT, RID_STR_NEW_QUERY ); - rList.emplace_back( ".uno:DBNewQueryAutoPilot", RID_STR_QUERIES_HELP_TEXT_WIZARD, RID_STR_NEW_QUERY_AUTO ); - rList.emplace_back( ".uno:DBNewQuerySql", RID_STR_QUERIES_HELP_TEXT_SQL, RID_STR_NEW_QUERY_SQL ); + rList.emplace_back( u".uno:DBNewQuery"_ustr, RID_STR_QUERIES_HELP_TEXT, RID_STR_NEW_QUERY ); + rList.emplace_back( u".uno:DBNewQueryAutoPilot"_ustr, RID_STR_QUERIES_HELP_TEXT_WIZARD, RID_STR_NEW_QUERY_AUTO ); + rList.emplace_back( u".uno:DBNewQuerySql"_ustr, RID_STR_QUERIES_HELP_TEXT_SQL, RID_STR_NEW_QUERY_SQL ); _rData.pTitleId = RID_STR_QUERIES_CONTAINER; break; diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index f074df4401f7..18c572b1a957 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -47,7 +47,7 @@ namespace dbaui // If an entry is disabled in the latter, it should also be disabled in the former. // If an entry is *hidden* in the former, it should also be hidden in the latter. - TaskEntry( const char* _pAsciiUNOCommand, TranslateId pHelpID, TranslateId pTitleResourceID, bool _bHideWhenDisabled = false ); + TaskEntry( const OUString& _rAsciiUNOCommand, TranslateId pHelpID, TranslateId pTitleResourceID, bool _bHideWhenDisabled = false ); }; typedef std::vector< TaskEntry > TaskEntryList; commit 57374ccc5b08818f14479d403899209b6259fbaf Author: Noel Grandin <[email protected]> AuthorDate: Tue May 7 14:23:35 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat May 11 12:41:28 2024 +0200 replace createFromAscii with OUString literals in ODsnTypeCollection Change-Id: I943e784bf3becd48e617b814b008f1f946987d28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167498 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index 0a25d603d4f1..f3d792b4f59e 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -124,9 +124,9 @@ OUString ODsnTypeCollection::getPrefix(std::u16string_view _sURL) const return sRet; } -bool ODsnTypeCollection::hasDriver( const char* _pAsciiPattern ) const +bool ODsnTypeCollection::hasDriver( std::u16string_view _rAsciiPattern ) const { - OUString sPrefix( getPrefix( OUString::createFromAscii( _pAsciiPattern ) ) ); + OUString sPrefix( getPrefix( _rAsciiPattern ) ); return !sPrefix.isEmpty(); } diff --git a/dbaccess/source/inc/dsntypes.hxx b/dbaccess/source/inc/dsntypes.hxx index ebd287099fa1..c6529ab6c34a 100644 --- a/dbaccess/source/inc/dsntypes.hxx +++ b/dbaccess/source/inc/dsntypes.hxx @@ -128,7 +128,7 @@ public: OUString getPrefix(std::u16string_view _sURL) const; /// determines whether there is a driver for the given URL prefix/pattern - bool hasDriver( const char* _pAsciiPattern ) const; + bool hasDriver( std::u16string_view _rAsciiPattern ) const; /// on a given string, return the Java Driver Class OUString getJavaDriverClass(std::u16string_view _sURL) const; diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index cf581081b289..8665a0d9ef2d 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -235,7 +235,7 @@ using namespace ::com::sun::star; { // show the "Connect directly" option only if the driver is installed const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rSet.GetItem(DSID_TYPECOLLECTION) ); - bool bHasMySQLNative = ( pCollectionItem != nullptr ) && pCollectionItem->getCollection()->hasDriver( "sdbc:mysql:mysqlc:" ); + bool bHasMySQLNative = ( pCollectionItem != nullptr ) && pCollectionItem->getCollection()->hasDriver( u"sdbc:mysql:mysqlc:" ); if ( bHasMySQLNative ) m_xNATIVEDatabase->show(); diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 79c1580116cb..03887054becb 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -310,7 +310,7 @@ namespace dbaui { // do not display the Connector/OOo driver itself, it is always wrapped via the MySQL-Driver, if // this driver is installed - if ( m_pCollection->hasDriver( "sdbc:mysql:mysqlc:" ) ) + if ( m_pCollection->hasDriver( u"sdbc:mysql:mysqlc:" ) ) _inout_rDisplayName.clear(); }
