diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-11-10 11:58:48 +0100 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-11-10 11:58:48 +0100 |
commit | 8e0d67bed54633d555a4601a5d79e2d5ba7ab2bb (patch) | |
tree | 8c54c990ae50aef4c51c6ade53317c0640839058 | |
parent | 643ffdf621a056a266c1c6121388e4d0b06adb0d (diff) |
Add some check to renewpo
Change-Id: I7b90785516f172f7b552a9e5ae30d02f7c52d7cf
-rw-r--r-- | l10ntools/source/renewpo.cxx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/l10ntools/source/renewpo.cxx b/l10ntools/source/renewpo.cxx index 241db58b72cf..32d19d594c09 100644 --- a/l10ntools/source/renewpo.cxx +++ b/l10ntools/source/renewpo.cxx @@ -158,14 +158,23 @@ void HandleLanguage(struct dirent* pLangEntry, const OString& rPath, { sActUnTrans = DelLocalId(sActUnTrans); } - PoEntry aPE(sActUnTrans, vTypes[nIndex]); - const OString sActStr = - sActTrans.getToken(vTypes[nIndex],'\t'); - aPE.setMsgStr(sActStr); - aPE.setFuzzy( sActStr.isEmpty() ? false : - static_cast<bool>(sActTrans.getToken(PoEntry::DUMMY,'\t'). - copy(nDummyBit++,1).toBoolean())); - aNewPo.writeEntry(aPE); + try + { + PoEntry aPE(sActUnTrans, vTypes[nIndex]); + const OString sActStr = + sActTrans.getToken(vTypes[nIndex],'\t'); + aPE.setMsgStr(sActStr); + aPE.setFuzzy( sActStr.isEmpty() ? false : + static_cast<bool>(sActTrans.getToken(PoEntry::DUMMY,'\t'). + copy(nDummyBit++,1).toBoolean())); + aNewPo.writeEntry(aPE); + } + catch( PoEntry::Exception& ) + { + cerr + << "Invalid sdf line " + << sActUnTrans.replaceAll("\t","\\t").getStr() << '\n'; + } } } //Check wheather next entry is in the same po file |