summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-04 09:28:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-04 13:07:40 +0000
commit32f95a35514701ed16413125b440c16d90f52b4a (patch)
tree25ac5edca15ee02bc937ee47116c2197559da4cd /lingucomponent
parent0f98299f7aa44bbb55c1bfeddca7799f727d14b0 (diff)
V813: Decreased performance
Change-Id: I8a7528366156b288dc422b09cff0d5a32cde3c91
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/languageguessing/guess.cxx5
-rw-r--r--lingucomponent/source/languageguessing/guess.hxx2
-rw-r--r--lingucomponent/source/languageguessing/simpleguesser.cxx6
-rw-r--r--lingucomponent/source/languageguessing/simpleguesser.hxx6
4 files changed, 8 insertions, 11 deletions
diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx
index 833d6032f5d4..33fe2c37bf24 100644
--- a/lingucomponent/source/languageguessing/guess.cxx
+++ b/lingucomponent/source/languageguessing/guess.cxx
@@ -109,10 +109,7 @@ Guess::~Guess()
{
}
-
-
-
-bool Guess::operator==(string lang)
+bool Guess::operator==(const string& lang)
{
string toString;
toString += GetLanguage();
diff --git a/lingucomponent/source/languageguessing/guess.hxx b/lingucomponent/source/languageguessing/guess.hxx
index 65febf59e03b..4e9644f5ecd1 100644
--- a/lingucomponent/source/languageguessing/guess.hxx
+++ b/lingucomponent/source/languageguessing/guess.hxx
@@ -52,7 +52,7 @@ class Guess{
string GetCountry() { return country_str;}
string GetEncoding() { return encoding_str;}
- bool operator==(string lang);
+ bool operator==(const string& lang);
protected:
string language_str;
diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx b/lingucomponent/source/languageguessing/simpleguesser.cxx
index 055e785bd022..3c33b9844542 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.cxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.cxx
@@ -193,7 +193,7 @@ vector<Guess> SimpleGuesser::GetAllManagedLanguages()
return GetManagedLanguages( sal::static_int_cast< char >( 0xFF ));
}
-void SimpleGuesser::XableLanguage(string lang, char mask)
+void SimpleGuesser::XableLanguage(const string& lang, char mask)
{
textcat_t *tables = (textcat_t*)h;
@@ -207,12 +207,12 @@ void SimpleGuesser::XableLanguage(string lang, char mask)
}
}
-void SimpleGuesser::EnableLanguage(string lang)
+void SimpleGuesser::EnableLanguage(const string& lang)
{
XableLanguage(lang, sal::static_int_cast< char >( 0xF0 ));
}
-void SimpleGuesser::DisableLanguage(string lang)
+void SimpleGuesser::DisableLanguage(const string& lang)
{
XableLanguage(lang, sal::static_int_cast< char >( 0x0F ));
}
diff --git a/lingucomponent/source/languageguessing/simpleguesser.hxx b/lingucomponent/source/languageguessing/simpleguesser.hxx
index 102ff8fe724e..db6cc6a1491d 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.hxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.hxx
@@ -83,13 +83,13 @@ public:
* Mark a language enabled
* @param string lang the language to enable (build like language-COUNTRY-encoding)
*/
- void EnableLanguage(string lang);
+ void EnableLanguage(const string& lang);
/**
* Mark a language disabled
* @param string lang the language to disable (build like language-COUNTRY-encoding)
*/
- void DisableLanguage(string lang);
+ void DisableLanguage(const string& lang);
/**
* Load a new DB of fingerprints
@@ -107,7 +107,7 @@ protected:
vector<Guess> GetManagedLanguages(const char mask);
//Like getManagedLanguages, this function enable or disable a language and it depends of the mask
- void XableLanguage(string lang, char mask);
+ void XableLanguage(const string& lang, char mask);
};
#endif