diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-13 08:47:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 08:26:14 +0200 |
commit | 9b5dad13b56bdde7c40970351af3da3a2c3c9350 (patch) | |
tree | abfd4b02743a0e6a93c51c026f4c53f0e21100bc /l10ntools | |
parent | fa71320329999c968feb16ff65be328b5b8ff5e4 (diff) |
loplugin:stringadd look for unnecessary temporaries
which defeat the *StringConcat optimisation.
Also make StringConcat conversions treat a nullptr as an empty string,
to match the O*String(char*) constructors.
Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b
Reviewed-on: https://gerrit.libreoffice.org/80724
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/po.cxx | 8 | ||||
-rw-r--r-- | l10ntools/source/pocheck.cxx | 20 |
2 files changed, 14 insertions, 14 deletions
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 20c728e6338c..4df1e1782d63 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -459,18 +459,18 @@ PoHeader::PoHeader( const OString& rExtSrc ) { m_pGenPo->setExtractCom("extracted from " + rExtSrc); m_pGenPo->setMsgStr( - OString("Project-Id-Version: PACKAGE VERSION\n" + "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?" "product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n" - "POT-Creation-Date: ") + lcl_GetTime() + - OString("\nPO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" + "POT-Creation-Date: " + lcl_GetTime() + + "\nPO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Accelerator-Marker: ~\n" - "X-Generator: LibreOffice\n")); + "X-Generator: LibreOffice\n"); m_bIsInitialized = true; } diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx index e080138ed3fc..6f3252451dfa 100644 --- a/l10ntools/source/pocheck.cxx +++ b/l10ntools/source/pocheck.cxx @@ -22,8 +22,8 @@ static void checkStyleNames(const OString& aLanguage) std::map<OString,sal_uInt16> aLocalizedNumStyleNames; std::vector<PoEntry> repeatedEntries; - OString aPoPath = OString(getenv("SRC_ROOT")) + - "/translations/source/" + + OString aPoPath = getenv("SRC_ROOT") + + OStringLiteral("/translations/source/") + aLanguage + "/sw/messages.po"; PoIfstream aPoInput; aPoInput.open(aPoPath); @@ -144,8 +144,8 @@ static void checkFunctionNames(const OString& aLanguage) OString aPoPaths[2]; OUString aPoPathURL; - aPoPaths[0] = OString(getenv("SRC_ROOT")) + - "/translations/source/" + + aPoPaths[0] = getenv("SRC_ROOT") + + OStringLiteral("/translations/source/") + aLanguage + "/formula/messages.po"; PoIfstream aPoInput; @@ -180,8 +180,8 @@ static void checkFunctionNames(const OString& aLanguage) } aPoInput.close(); - aPoPaths[1] = OString(getenv("SRC_ROOT")) + - "/translations/source/" + + aPoPaths[1] = getenv("SRC_ROOT") + + OStringLiteral("/translations/source/") + aLanguage + "/scaddins/messages.po"; aPoInput.open(aPoPaths[1]); @@ -290,8 +290,8 @@ static void checkFunctionNames(const OString& aLanguage) // with '|', too. static void checkVerticalBar(const OString& aLanguage) { - OString aPoPath = OString(getenv("SRC_ROOT")) + - "/translations/source/" + + OString aPoPath = getenv("SRC_ROOT") + + OStringLiteral("/translations/source/") + aLanguage + "/instsetoo_native/inc_openoffice/windows/msi_languages.po"; PoIfstream aPoInput; @@ -343,8 +343,8 @@ static void checkVerticalBar(const OString& aLanguage) // must not contain spaces static void checkMathSymbolNames(const OString& aLanguage) { - OString aPoPath = OString(getenv("SRC_ROOT")) + - "/translations/source/" + + OString aPoPath = getenv("SRC_ROOT") + + OStringLiteral("/translations/source/") + aLanguage + "/starmath/messages.po"; PoIfstream aPoInput; |