diff options
Diffstat (limited to 'l10ntools/source')
-rw-r--r-- | l10ntools/source/localize.cxx | 10 | ||||
-rw-r--r-- | l10ntools/source/propmerge.cxx | 6 | ||||
-rw-r--r-- | l10ntools/source/treemerge.cxx | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 8dc1f26422ac..d89f89150d04 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -117,13 +117,13 @@ void handleCommand( void InitPoFile( std::string_view rProject, const OString& rInPath, - const OString& rPotDir, const OString& rOutPath ) + std::string_view rPotDir, const OString& rOutPath ) { //Create directory for po file { OUString outDir = OStringToOUString( - rPotDir.subView(0,rPotDir.lastIndexOf('/')), RTL_TEXTENCODING_UTF8); + rPotDir.substr(0,rPotDir.rfind('/')), RTL_TEXTENCODING_UTF8); OUString outDirUrl; if (osl::FileBase::getFileURLFromSystemPath(outDir, outDirUrl) != osl::FileBase::E_None) @@ -174,7 +174,7 @@ bool fileExists(const OString& fileName) OString gDestRoot; -bool handleFile(std::string_view rProject, const OUString& rUrl, const OString& rPotDir) +bool handleFile(std::string_view rProject, const OUString& rUrl, std::string_view rPotDir) { struct Command { std::u16string_view extension; @@ -216,7 +216,7 @@ bool handleFile(std::string_view rProject, const OUString& rUrl, const OString& if (bSimpleModuleCase) sOutPath = gDestRoot + "/" + rProject + "/messages.pot"; else - sOutPath = rPotDir + ".pot"; + sOutPath = OString::Concat(rPotDir) + ".pot"; if (!fileExists(sOutPath)) { @@ -280,7 +280,7 @@ bool handleFile(std::string_view rProject, const OUString& rUrl, const OString& void handleFilesOfDir( std::vector<OUString>& aFiles, std::string_view rProject, - const OString& rPotDir ) + std::string_view rPotDir ) { ///Handle files in lexical order std::sort(aFiles.begin(), aFiles.end()); diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx index 2e2cf19e4cc6..0fa81e4fb5ac 100644 --- a/l10ntools/source/propmerge.cxx +++ b/l10ntools/source/propmerge.cxx @@ -24,11 +24,11 @@ namespace { //Find ascii escaped unicode sal_Int32 lcl_IndexOfUnicode( - const OString& rSource, const sal_Int32 nFrom = 0 ) + std::string_view rSource, const sal_Int32 nFrom = 0 ) { const OString sHexDigits = "0123456789abcdefABCDEF"; - sal_Int32 nIndex = rSource.indexOf( "\\u", nFrom ); - if( nIndex == -1 ) + size_t nIndex = rSource.find( "\\u", nFrom ); + if( nIndex == std::string_view::npos ) { return -1; } diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx index b50311cce6af..8e577f3dadbc 100644 --- a/l10ntools/source/treemerge.cxx +++ b/l10ntools/source/treemerge.cxx @@ -58,7 +58,7 @@ namespace // Update id and content of the topic xmlNodePtr lcl_UpdateTopic( - const xmlNodePtr pCurrent, const OString& rXhpRoot ) + const xmlNodePtr pCurrent, std::string_view rXhpRoot ) { xmlNodePtr pReturn = pCurrent; xmlChar* pID = xmlGetProp(pReturn, reinterpret_cast<const xmlChar*>("id")); @@ -71,7 +71,7 @@ namespace { OString sNewID = OString::Concat(sID.subView( 0, nFirstSlash + 1 )) + - rXhpRoot.subView( rXhpRoot.lastIndexOf('/') + 1 ) + + rXhpRoot.substr( rXhpRoot.rfind('/') + 1 ) + sID.subView( sID.indexOf( '/', nFirstSlash + 1 ) ); xmlSetProp( pReturn, reinterpret_cast<const xmlChar*>("id"), @@ -79,7 +79,7 @@ namespace } const OString sXhpPath = - rXhpRoot + + OString::Concat(rXhpRoot) + sID.subView(sID.indexOf('/', nFirstSlash + 1)); xmlDocPtr pXhpFile = xmlParseFile( sXhpPath.getStr() ); // if xhpfile is missing than put this topic into comment |