summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2021-01-24 19:01:34 +0000
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-30 08:12:47 +0100
commit4c7332e5f439774363f29cc7d47494854cc981f5 (patch)
tree0fa4030f05a0153231b90751c74229cffb1d3a21 /l10ntools
parentf2a9629658e35103a072181e6954cb2de8b1b0b0 (diff)
HelpParser::ProcessHelp: Tidy Null checks
cppcheck spotted a repeated nullptr pair of if's near the start that can be squashed. Those gurantee that later pXMLElement is non-null, so we don't need the test later. Change-Id: Ie8fc24490ef031416709d55e6fbdd99e9853c4f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/helpmerge.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index e1beff7a5da4..8fed8ffcb452 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -200,9 +200,8 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResDa
if( pXMLElement == nullptr )
{
printf("Error: Can't find en-US entry\n");
- }
- if( pXMLElement == nullptr )
return;
+ }
OString sNewText;
OString sNewdata;
@@ -239,13 +238,10 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResDa
}
if (!sNewdata.isEmpty())
{
- if( pXMLElement != nullptr )
- {
- XMLData *data = new XMLData( sNewdata , nullptr ); // Add new one
- pXMLElement->RemoveAndDeleteAllChildren();
- pXMLElement->AddChild( data );
- aLangHM->erase( sCur );
- }
+ XMLData *data = new XMLData( sNewdata , nullptr ); // Add new one
+ pXMLElement->RemoveAndDeleteAllChildren();
+ pXMLElement->AddChild( data );
+ aLangHM->erase( sCur );
}
else
{