From 3d236177be255b2027a997bfc12fe0833ca9a2f7 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 11 Oct 2022 10:23:28 +0300 Subject: Deduplicate O(U)StringConcatenation And use an overloaded helper function with a better (?) unified name to show that the result is not an O(U)String. Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- l10ntools/source/po.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'l10ntools/source') diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 62d09e1e7407..b053067ea163 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -223,7 +223,7 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream) { sReference = m_sReferences.front(); } - if (pLastMsg != &m_sMsgCtxt || sLine != OStringConcatenation("\"" + sReference + "\\n\"")) + if (pLastMsg != &m_sMsgCtxt || sLine != Concat2View("\"" + sReference + "\\n\"")) { *pLastMsg += lcl_GenNormString(sLine); } @@ -279,7 +279,7 @@ PoEntry::PoEntry( } m_pGenPo->setMsgCtxt(sMsgCtxt); m_pGenPo->setMsgId(rText); - m_pGenPo->setExtractCom(OStringConcatenation( + m_pGenPo->setExtractCom(Concat2View( ( !rHelpText.empty() ? OString::Concat(rHelpText) + "\n" : OString()) + genKeyId( m_pGenPo->getReference().front() + rGroupId + rLocalId + rResType + rText ) )); m_bIsInitialized = true; @@ -446,7 +446,7 @@ PoHeader::PoHeader( std::string_view rExtSrc, const OString& rPoHeaderMsgStr ) : m_pGenPo( new GenPoEntry() ) , m_bIsInitialized( false ) { - m_pGenPo->setExtractCom(OStringConcatenation(OString::Concat("extracted from ") + rExtSrc)); + m_pGenPo->setExtractCom(Concat2View(OString::Concat("extracted from ") + rExtSrc)); m_pGenPo->setMsgStr(rPoHeaderMsgStr); m_bIsInitialized = true; } @@ -455,7 +455,7 @@ PoHeader::PoHeader( std::string_view rExtSrc ) : m_pGenPo( new GenPoEntry() ) , m_bIsInitialized( false ) { - m_pGenPo->setExtractCom(OStringConcatenation(OString::Concat("extracted from ") + rExtSrc)); + m_pGenPo->setExtractCom(Concat2View(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?" -- cgit