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 /l10ntools/source | |
parent | tdf#138907 sw TitlePageDlg: fix round-tripping (diff) | |
download | core-042033f1e6da22616cb76c8d950c20c9efecbad5.tar.gz core-042033f1e6da22616cb76c8d950c20c9efecbad5.zip |
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 'l10ntools/source')
-rw-r--r-- | l10ntools/source/common.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/helper.cxx | 4 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 12 | ||||
-rw-r--r-- | l10ntools/source/po.cxx | 18 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 4 |
6 files changed, 21 insertions, 21 deletions
diff --git a/l10ntools/source/common.cxx b/l10ntools/source/common.cxx index 84adb767c7ba..e2d14ac36431 100644 --- a/l10ntools/source/common.cxx +++ b/l10ntools/source/common.cxx @@ -107,7 +107,7 @@ void writeUsage(const OString& rName, const OString& rFileType) void writePoEntry( const OString& rExecutable, PoOfstream& rPoStream, const OString& rSourceFile, - const OString& rResType, const OString& rGroupId, const OString& rLocalId, + std::string_view rResType, const OString& rGroupId, const OString& rLocalId, const OString& rHelpText, const OString& rText, const PoEntry::TYPE eType ) { try diff --git a/l10ntools/source/helper.cxx b/l10ntools/source/helper.cxx index 053375085911..80b079e27151 100644 --- a/l10ntools/source/helper.cxx +++ b/l10ntools/source/helper.cxx @@ -122,12 +122,12 @@ OString UnQuotHTML( const OString& rString ) return sReturn.makeStringAndClear(); } -bool isWellFormedXML( OString const & text ) +bool isWellFormedXML( std::string_view text ) { xmlDocPtr doc; bool result = true; - OString content = "<root>" + text + "</root>"; + OString content = OString::Concat("<root>") + text + "</root>"; doc = xmlParseMemory(content.getStr(),static_cast<int>(content.getLength())); if (doc == nullptr) { result = false; diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index c4643ea4fac4..e1beff7a5da4 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -81,7 +81,7 @@ HelpParser::HelpParser( const OString &rHelpFile ) bool HelpParser::CreatePO( /*****************************************************************************/ const OString &rPOFile_in, const OString &sHelpFile, - XMLFile* pXmlFile, const OString &rGsi1){ + XMLFile* pXmlFile, std::string_view rGsi1){ SimpleXMLParser aParser; //TODO: explicit BOM handling? diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 22beb6f1b962..02bfd9a74bbc 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -98,7 +98,7 @@ namespace } } -OString MergeEntrys::GetQTZText(const ResData& rResData, const OString& rOrigText) +OString MergeEntrys::GetQTZText(const ResData& rResData, std::string_view rOrigText) { const OString sFilename = rResData.sFilename.copy(rResData.sFilename.lastIndexOf('/')+1); const OString sKey = @@ -276,8 +276,8 @@ MergeEntrys *MergeDataFile::GetMergeEntrysCaseSensitive( ResData *pResData ) } void MergeDataFile::InsertEntry( - const OString &rTYP, const OString &rGID, - const OString &rLID, const OString &nLANG, + std::string_view rTYP, std::string_view rGID, + std::string_view rLID, const OString &nLANG, const OString &rTEXT, const OString &rQHTEXT, const OString &rTITLE, const OString &rInFilename, bool bFirstLang, bool bCaseSensitive ) @@ -318,11 +318,11 @@ void MergeDataFile::InsertEntry( } } -OString MergeDataFile::CreateKey(const OString& rTYP, const OString& rGID, - const OString& rLID, const OString& rFilename, bool bCaseSensitive) +OString MergeDataFile::CreateKey(std::string_view rTYP, std::string_view rGID, + std::string_view rLID, const OString& rFilename, bool bCaseSensitive) { static const char sStroke[] = "-"; - OString sKey = rTYP + sStroke + rGID + sStroke + rLID + sStroke + + OString sKey = OString::Concat(rTYP) + sStroke + rGID + sStroke + rLID + sStroke + lcl_NormalizeFilename(rFilename); if(bCaseSensitive) return sKey; // officecfg case sensitive identifier diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 3d001f28e3f4..5269b5e0f7f3 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -245,16 +245,16 @@ PoEntry::PoEntry() } PoEntry::PoEntry( - const OString& rSourceFile, const OString& rResType, const OString& rGroupId, - const OString& rLocalId, const OString& rHelpText, + const OString& rSourceFile, std::string_view rResType, std::string_view rGroupId, + std::string_view rLocalId, const OString& rHelpText, const OString& rText, const TYPE eType ) : m_bIsInitialized( false ) { if( rSourceFile.isEmpty() ) throw NOSOURCFILE; - else if ( rResType.isEmpty() ) + else if ( rResType.empty() ) throw NORESTYPE; - else if ( rGroupId.isEmpty() ) + else if ( rGroupId.empty() ) throw NOGROUPID; else if ( rText.isEmpty() ) throw NOSTRING; @@ -268,7 +268,7 @@ PoEntry::PoEntry( OString sMsgCtxt = sReference + "\n" + rGroupId + "\n" + - (rLocalId.isEmpty() ? OString() : rLocalId + "\n") + + (rLocalId.empty() ? OString() : OString::Concat(rLocalId) + "\n") + rResType; switch(eType){ case TTEXT: @@ -444,20 +444,20 @@ namespace } // when updating existing files (pocheck), reuse provided po-header -PoHeader::PoHeader( const OString& rExtSrc, const OString& rPoHeaderMsgStr ) +PoHeader::PoHeader( std::string_view rExtSrc, const OString& rPoHeaderMsgStr ) : m_pGenPo( new GenPoEntry() ) , m_bIsInitialized( false ) { - m_pGenPo->setExtractCom("extracted from " + rExtSrc); + m_pGenPo->setExtractCom(OString::Concat("extracted from ") + rExtSrc); m_pGenPo->setMsgStr(rPoHeaderMsgStr); m_bIsInitialized = true; } -PoHeader::PoHeader( const OString& rExtSrc ) +PoHeader::PoHeader( std::string_view rExtSrc ) : m_pGenPo( new GenPoEntry() ) , m_bIsInitialized( false ) { - m_pGenPo->setExtractCom("extracted from " + rExtSrc); + m_pGenPo->setExtractCom(OString::Concat("extracted from ") + rExtSrc); m_pGenPo->setMsgStr( "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?" diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 62734f04ddd9..6059ad19160d 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -258,9 +258,9 @@ void XRMResParser::Execute( int nToken, char * pToken ) } } -OString XRMResParser::GetAttribute( const OString &rToken, const OString &rAttribute ) +OString XRMResParser::GetAttribute( const OString &rToken, std::string_view rAttribute ) { - const OString sSearch{ " " + rAttribute + "=" }; + const OString sSearch{ OString::Concat(" ") + rAttribute + "=" }; OString sTmp{ rToken.replace('\t', ' ') }; sal_Int32 nPos = sTmp.indexOf( sSearch ); |