diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-28 17:56:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-29 16:42:33 +0100 |
commit | 042033f1e6da22616cb76c8d950c20c9efecbad5 (patch) | |
tree | 26b3f1f42d067506f44550b410f3fb9640616a5b /xmlhelp/source | |
parent | ccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff) |
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmlhelp/source')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 25 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.hxx | 7 |
2 files changed, 17 insertions, 15 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index fc6cdd2ed717..583de4123e88 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -32,6 +32,7 @@ #include <algorithm> #include <cassert> #include <string.h> +#include <string_view> #include <helpcompiler/HelpIndexer.hxx> @@ -306,7 +307,7 @@ const std::vector< OUString >& Databases::getModuleList( const OUString& Languag return m_avModules; } -StaticModuleInformation* Databases::getStaticInformationForModule( const OUString& Module, +StaticModuleInformation* Databases::getStaticInformationForModule( std::u16string_view Module, const OUString& Language ) { osl::MutexGuard aGuard( m_aMutex ); @@ -417,17 +418,17 @@ OUString Databases::processLang( const OUString& Language ) return ret; } -helpdatafileproxy::Hdf* Databases::getHelpDataFile( const OUString& Database, +helpdatafileproxy::Hdf* Databases::getHelpDataFile( std::u16string_view Database, const OUString& Language, bool helpText, const OUString* pExtensionPath ) { - if( Database.isEmpty() || Language.isEmpty() ) + if( Database.empty() || Language.isEmpty() ) return nullptr; osl::MutexGuard aGuard( m_aMutex ); OUString aFileExt( helpText ? OUString(".ht") : OUString(".db") ); - OUString dbFileName = "/" + Database + aFileExt; + OUString dbFileName = OUString::Concat("/") + Database + aFileExt; OUString key; if( pExtensionPath == nullptr ) key = processLang( Language ) + dbFileName; @@ -1270,10 +1271,10 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextBundledHelpP } OUString ExtensionIteratorBase::implGetFileFromPackage( - const OUString& rFileExtension, const Reference< deployment::XPackage >& xPackage ) + std::u16string_view rFileExtension, const Reference< deployment::XPackage >& xPackage ) { // No extension -> search for pure language folder - bool bLangFolderOnly = rFileExtension.isEmpty(); + bool bLangFolderOnly = rFileExtension.empty(); OUString aFile; OUString aLanguage = m_aLanguage; @@ -1282,7 +1283,7 @@ OUString ExtensionIteratorBase::implGetFileFromPackage( OUString aStr = xPackage->getRegistrationDataURL().Value + "/" + aLanguage; if( !bLangFolderOnly ) { - aStr += "/help" + rFileExtension; + aStr += OUString::Concat("/help") + rFileExtension; } aFile = m_rDatabases.expandURL( aStr ); @@ -1517,7 +1518,7 @@ OUString KeyDataBaseFileIterator::implGetDbFileFromPackage ( const Reference< deployment::XPackage >& xPackage ) { OUString aExpandedURL = - implGetFileFromPackage( ".key", xPackage ); + implGetFileFromPackage( u".key", xPackage ); return aExpandedURL; } @@ -1587,7 +1588,7 @@ Reference< XHierarchicalNameAccess > JarFileIterator::implGetJarFromPackage Reference< XHierarchicalNameAccess > xNA; OUString zipFile = - implGetFileFromPackage( ".jar", xPackage ); + implGetFileFromPackage( u".jar", xPackage ); try { @@ -1712,13 +1713,13 @@ OUString IndexFolderIterator::nextIndexFolder( bool& o_rbExtension, bool& o_rbTe OUString IndexFolderIterator::implGetIndexFolderFromPackage( bool& o_rbTemporary, const Reference< deployment::XPackage >& xPackage ) { OUString aIndexFolder = - implGetFileFromPackage( ".idxl", xPackage ); + implGetFileFromPackage( u".idxl", xPackage ); o_rbTemporary = false; if( !m_xSFA->isFolder( aIndexFolder ) ) { // i98680: Missing index? Try to generate now - OUString aLangURL = implGetFileFromPackage( OUString(), xPackage ); + OUString aLangURL = implGetFileFromPackage( std::u16string_view(), xPackage ); if( m_xSFA->isFolder( aLangURL ) ) { // Test write access (shared extension may be read only) @@ -1773,7 +1774,7 @@ OUString IndexFolderIterator::implGetIndexFolderFromPackage( bool& o_rbTemporary aIndexer.indexDocuments(); if( bIsWriteAccess ) - aIndexFolder = implGetFileFromPackage( ".idxl", xPackage ); + aIndexFolder = implGetFileFromPackage( u".idxl", xPackage ); else aIndexFolder = aZipDir + "/help.idxl"; } diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 9431328143c8..4c719a61c862 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -23,6 +23,7 @@ #include <sal/config.h> #include <memory> +#include <string_view> #include <unordered_map> #include <unordered_set> #include <vector> @@ -147,14 +148,14 @@ namespace chelp { const std::vector< OUString >& getModuleList( const OUString& Language ); - StaticModuleInformation* getStaticInformationForModule( const OUString& Module, + StaticModuleInformation* getStaticInformationForModule( std::u16string_view Module, const OUString& Language ); bool checkModuleMatchForExtension( std::u16string_view Database, const OUString& doclist ); KeywordInfo* getKeyword( const OUString& Module, const OUString& Language ); - helpdatafileproxy::Hdf* getHelpDataFile( const OUString& Module, + helpdatafileproxy::Hdf* getHelpDataFile( std::u16string_view Module, const OUString& Language, bool helpText = false, const OUString* pExtensionPath = nullptr ); @@ -322,7 +323,7 @@ namespace chelp { ( css::uno::Reference< css::deployment::XPackage >& o_xParentPackageBundle ); css::uno::Reference< css::deployment::XPackage > implGetNextBundledHelpPackage ( css::uno::Reference< css::deployment::XPackage >& o_xParentPackageBundle ); - OUString implGetFileFromPackage( const OUString& rFileExtension, + OUString implGetFileFromPackage( std::u16string_view rFileExtension, const css::uno::Reference< css::deployment::XPackage >& xPackage ); void implGetLanguageVectorFromPackage( ::std::vector< OUString > &rv, const css::uno::Reference< css::deployment::XPackage >& xPackage ); |