diff options
author | Noel Grandin <noel@peralex.com> | 2014-03-06 15:29:08 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-03-18 08:32:26 +0200 |
commit | 86a32589e90ee983159fb5b2c6a594428ab7d422 (patch) | |
tree | 6de946fe2b9b25614f0d197af95e9d3aadcd1bd9 /l10ntools | |
parent | bb17844099ba98a77c8e5d7a25c0c416a4b0641e (diff) |
Find places where OUString and OString are passed by value.
It's not very efficient, because we generally end up copying it twice -
once into the parameter and again into the destination OUString.
So I create a clang plugin that finds such places and generates a
warning so that we can convert them to pass-by-reference.
Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/lngmerge.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/pocheck.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 2e3a4d68e12f..1ab50ac06f79 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -29,7 +29,7 @@ namespace { -OString getBracketedContent(OString text) { +OString getBracketedContent(const OString& text) { return text.getToken(1, '[').getToken(0, ']'); } diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx index 6043156cc951..c7c61643bacd 100644 --- a/l10ntools/source/pocheck.cxx +++ b/l10ntools/source/pocheck.cxx @@ -17,7 +17,7 @@ #include "po.hxx" // Translated style names must be unique -static void checkStyleNames(OString aLanguage) +static void checkStyleNames(const OString& aLanguage) { std::map<OString,sal_uInt16> aLocalizedStyleNames; std::map<OString,sal_uInt16> aLocalizedNumStyleNames; @@ -130,7 +130,7 @@ static void checkStyleNames(OString aLanguage) } // Translated spreadsheet function names must be unique -static void checkFunctionNames(OString aLanguage) +static void checkFunctionNames(const OString& aLanguage) { std::map<OString,sal_uInt16> aLocalizedFunctionNames; std::map<OString,sal_uInt16> aLocalizedCoreFunctionNames; @@ -352,7 +352,7 @@ static void checkFunctionNames(OString aLanguage) // In instsetoo_native/inc_openoffice/windows/msi_languages.po // where an en-US string ends with '|', translation must end // with '|', too. -static void checkVerticalBar(OString aLanguage) +static void checkVerticalBar(const OString& aLanguage) { OString aPoPath = OString(getenv("SRC_ROOT")) + "/translations/source/" + @@ -400,7 +400,7 @@ static void checkVerticalBar(OString aLanguage) // In starmath/source.po Math symbol names (from symbol.src) // must not contain spaces -static void checkMathSymbolNames(OString aLanguage) +static void checkMathSymbolNames(const OString& aLanguage) { OString aPoPath = OString(getenv("SRC_ROOT")) + "/translations/source/" + |