summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2012-09-30 18:26:15 +0200
committerAndras Timar <atimar@suse.com>2012-09-30 18:31:34 +0000
commit9d300551b3dacd3693607e1015bea1461c173e1a (patch)
tree7fe61ba3009c70479f10a9f7afd11fdb805b3493
parent0359041aac89ef07325f6b8baa2d5ff304e833b5 (diff)
Use new startsWith() method of OString
Change-Id: If8787b007767aa2701ff1b13883bcf33df12a8fc Reviewed-on: https://gerrit.libreoffice.org/737 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
-rw-r--r--l10ntools/source/po.cxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index b9e1c17589ae..a922575e41fd 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -110,12 +110,6 @@ OString ImplGenNormString(const OString& rString)
return ImplUnEscapeText(rString.copy(1,rString.getLength()-2));
}
-//Decide whether a string starts with an other string
-bool ImplStartsWith(const OString& rString,const OString& rStart)
-{
- return rString.match(rStart);
-}
-
//Default constructor
GenPoEntry::GenPoEntry()
: m_sWhiteSpace( OString() )
@@ -215,37 +209,37 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream)
while(!rIFStream.eof())
{
OString sLine = OString(sTemp.data(),sTemp.length());
- if (ImplStartsWith(sLine,"#. "))
+ if (sLine.startsWith("#. "))
{
if (sLine.getLength()==7)
m_sKeyId = sLine.copy(3);
else
m_sExtractCom = sLine.copy(3);
}
- else if (ImplStartsWith(sLine,"#: "))
+ else if (sLine.startsWith("#: "))
{
m_sReference = sLine.copy(3);
}
- else if (ImplStartsWith(sLine,"#, fuzzy"))
+ else if (sLine.startsWith("#, fuzzy"))
{
m_bFuzzy = true;
}
- else if (ImplStartsWith(sLine,"msgctxt "))
+ else if (sLine.startsWith("msgctxt "))
{
m_sContext = ImplGenNormString(sLine.copy(8));
pLastMsg = &m_sContext;
}
- else if (ImplStartsWith(sLine,"msgid "))
+ else if (sLine.startsWith("msgid "))
{
m_sUnTransStr = ImplGenNormString(sLine.copy(6));
pLastMsg = &m_sUnTransStr;
}
- else if (ImplStartsWith(sLine,"msgstr "))
+ else if (sLine.startsWith("msgstr "))
{
m_sTransStr = ImplGenNormString(sLine.copy(7));
pLastMsg = &m_sTransStr;
}
- else if (ImplStartsWith(sLine,"\"") && pLastMsg)
+ else if (sLine.startsWith("\"") && pLastMsg)
{
*pLastMsg += ImplGenNormString(sLine);
}
@@ -359,7 +353,7 @@ OString ImplEscapeTags(const OString& rText)
for(StrVec::const_iterator pEscape = vTagsForEscape.begin();
pEscape != vTagsForEscape.end(); ++pEscape)
{
- if (ImplStartsWith(*pFound,"<" + *pEscape) ||
+ if (pFound->startsWith("<" + *pEscape) ||
*pFound == "</" + *pEscape + ">")
{
bEscapeThis = true;