summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-06-03 14:13:33 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-06-03 16:13:24 +0200
commit268f27f6623334b81762b068f842c944a7541f25 (patch)
tree270a489ce3f65ab544af0916e26044acb4d66d80 /l10ntools
parentac8d986655f5eb9c4b92ba56c779e036485525dd (diff)
-Werror,-Wunused-but-set-variable (Clang 13 trunk)
sLanguage and sTmpStrVal are unused since c9611c5e6465948de029e9c2fbd17e75ee07d31f "loplugin:unusedfields in l10ntools..sax". Simplify the for loop now that it only checks for a single item, and expand the ID macro at its last remaining use. Change-Id: I3cf6692fc5a4efd58d0df1dbc24b3610916b2fd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116665 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/xmlparse.cxx17
1 files changed, 3 insertions, 14 deletions
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 4bd58b1a49f6..b7bc613613e2 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -38,7 +38,6 @@ using namespace std;
using namespace osl;
#define XML_LANG "xml-lang"
-#define ID "id"
@@ -343,7 +342,7 @@ void XMLFile::InsertL10NElement( XMLElement* pElement )
{
const OString sTempStr((*pElement->GetAttributeList())[ j ]->GetName());
// Get the "id" Attribute
- if (sTempStr == ID)
+ if (sTempStr == "id")
{
sId = (*pElement->GetAttributeList())[ j ]->GetValue();
}
@@ -449,24 +448,14 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur )
bool bInsert = true;
XMLElement *pElement = static_cast<XMLElement*>(pCur);
const OString sName(pElement->GetName().toAsciiLowerCase());
- OString sLanguage("en-US");
- OString sTmpStrVal;
if ( pElement->GetAttributeList())
{
for ( size_t j = 0 , cnt = pElement->GetAttributeList()->size(); j < cnt && bInsert; ++j )
{
- const OString sTmpStr = (*pElement->GetAttributeList())[j]->GetName();
- if (sTmpStr == ID)
- {
- sTmpStrVal=(*pElement->GetAttributeList())[ j ]->GetValue();
- }
- if (sTmpStr == "localize")
+ if ((*pElement->GetAttributeList())[j]->GetName() == "localize")
{
bInsert=false;
- }
- if (sTmpStr == XML_LANG) // Get the "xml-lang" Attribute
- {
- sLanguage=(*pElement->GetAttributeList())[ j ]->GetValue();
+ break;
}
}
}