summaryrefslogtreecommitdiff
path: root/cui/source/options/optlingu.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-26 00:07:33 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-26 06:30:58 +0100
commit761546e088dcccf3aa66c3f5c4853f110b93770f (patch)
tree94dc648b78e78d685aab8b8b8e41b370a5b9db54 /cui/source/options/optlingu.cxx
parentd3144a09dc5e2c21ffa34e3527bb6c94cd9926e8 (diff)
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I1ac4c52ea51503373644bc58dcd4395c69f1a675 Reviewed-on: https://gerrit.libreoffice.org/64007 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui/source/options/optlingu.cxx')
-rw-r--r--cui/source/options/optlingu.cxx57
1 files changed, 28 insertions, 29 deletions
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index abf4a4b3b5a4..20ead90689cb 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -613,40 +613,40 @@ static void lcl_MergeDisplayArray(
for (sal_uLong i = 0; i < nEntries; ++i)
{
- ServiceInfo_Impl* pEntry = &rSvcInfoArr[i];
- if (pEntry && pEntry->sDisplayName == rToAdd.sDisplayName)
+ ServiceInfo_Impl& rEntry = rSvcInfoArr[i];
+ if (rEntry.sDisplayName == rToAdd.sDisplayName)
{
if(rToAdd.xSpell.is())
{
- DBG_ASSERT( !pEntry->xSpell.is() &&
- pEntry->sSpellImplName.isEmpty(),
+ DBG_ASSERT( !rEntry.xSpell.is() &&
+ rEntry.sSpellImplName.isEmpty(),
"merge conflict" );
- pEntry->sSpellImplName = rToAdd.sSpellImplName;
- pEntry->xSpell = rToAdd.xSpell;
+ rEntry.sSpellImplName = rToAdd.sSpellImplName;
+ rEntry.xSpell = rToAdd.xSpell;
}
if(rToAdd.xGrammar.is())
{
- DBG_ASSERT( !pEntry->xGrammar.is() &&
- pEntry->sGrammarImplName.isEmpty(),
+ DBG_ASSERT( !rEntry.xGrammar.is() &&
+ rEntry.sGrammarImplName.isEmpty(),
"merge conflict" );
- pEntry->sGrammarImplName = rToAdd.sGrammarImplName;
- pEntry->xGrammar = rToAdd.xGrammar;
+ rEntry.sGrammarImplName = rToAdd.sGrammarImplName;
+ rEntry.xGrammar = rToAdd.xGrammar;
}
if(rToAdd.xHyph.is())
{
- DBG_ASSERT( !pEntry->xHyph.is() &&
- pEntry->sHyphImplName.isEmpty(),
+ DBG_ASSERT( !rEntry.xHyph.is() &&
+ rEntry.sHyphImplName.isEmpty(),
"merge conflict" );
- pEntry->sHyphImplName = rToAdd.sHyphImplName;
- pEntry->xHyph = rToAdd.xHyph;
+ rEntry.sHyphImplName = rToAdd.sHyphImplName;
+ rEntry.xHyph = rToAdd.xHyph;
}
if(rToAdd.xThes.is())
{
- DBG_ASSERT( !pEntry->xThes.is() &&
- pEntry->sThesImplName.isEmpty(),
+ DBG_ASSERT( !rEntry.xThes.is() &&
+ rEntry.sThesImplName.isEmpty(),
"merge conflict" );
- pEntry->sThesImplName = rToAdd.sThesImplName;
- pEntry->xThes = rToAdd.xThes;
+ rEntry.sThesImplName = rToAdd.sThesImplName;
+ rEntry.xThes = rToAdd.xThes;
}
return ;
}
@@ -797,17 +797,17 @@ void SvxLinguData_Impl::SetChecked(const Sequence<OUString>& rConfiguredServices
{
for (sal_uLong i = 0; i < nDisplayServices; ++i)
{
- ServiceInfo_Impl* pEntry = &aDisplayServiceArr[i];
- if (pEntry && !pEntry->bConfigured)
+ ServiceInfo_Impl& rEntry = aDisplayServiceArr[i];
+ if (!rEntry.bConfigured)
{
const OUString &rSrvcImplName = pConfiguredServices[n];
if (!rSrvcImplName.isEmpty() &&
- (pEntry->sSpellImplName == rSrvcImplName ||
- pEntry->sGrammarImplName == rSrvcImplName ||
- pEntry->sHyphImplName == rSrvcImplName ||
- pEntry->sThesImplName == rSrvcImplName))
+ (rEntry.sSpellImplName == rSrvcImplName ||
+ rEntry.sGrammarImplName == rSrvcImplName ||
+ rEntry.sHyphImplName == rSrvcImplName ||
+ rEntry.sThesImplName == rSrvcImplName))
{
- pEntry->bConfigured = true;
+ rEntry.bConfigured = true;
break;
}
}
@@ -848,13 +848,12 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, bool bEnable
DBG_ASSERT( !rDisplayName.isEmpty(), "empty DisplayName" );
ServiceInfo_Impl *pInfo = nullptr;
- ServiceInfo_Impl *pTmp = nullptr;
for (sal_uLong i = 0; i < nDisplayServices; ++i)
{
- pTmp = &aDisplayServiceArr[i];
- if (pTmp && pTmp->sDisplayName == rDisplayName)
+ ServiceInfo_Impl& rTmp = aDisplayServiceArr[i];
+ if (rTmp.sDisplayName == rDisplayName)
{
- pInfo = pTmp;
+ pInfo = &rTmp;
break;
}
}