summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-02-07 11:55:24 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-02-11 07:07:30 +0100
commit121182bddbce8f14cccdf7db9af8c08867a0912f (patch)
treedbad1ab9b7a4a4ea0f5862ae1a8679aa117c8829 /cui
parentusing ScopedVclPtr with StartExecuteAsync not good (diff)
downloadcore-121182bddbce8f14cccdf7db9af8c08867a0912f.tar.gz
core-121182bddbce8f14cccdf7db9af8c08867a0912f.zip
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I67462369d93e9d9ff3c056800947c4b75f71ba5f Reviewed-on: https://gerrit.libreoffice.org/67486 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/tpshadow.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 4b5d57c0e668..6b56087c2e27 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -368,16 +368,11 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
{
// determine default-distance
SfxItemPool* pPool = m_rOutAttrs.GetPool();
- const SdrMetricItem* pXDistItem = &pPool->GetDefaultItem(SDRATTR_SHADOWXDIST);
- const SdrMetricItem* pYDistItem = &pPool->GetDefaultItem(SDRATTR_SHADOWYDIST);
- if (pXDistItem && pYDistItem)
{
- sal_Int32 nX = pXDistItem->GetValue();
- sal_Int32 nY = pYDistItem->GetValue();
- if( nX != 0 )
- SetMetricValue( *m_xMtrDistance, nX < 0 ? -nX : nX, m_ePoolUnit );
- else
- SetMetricValue( *m_xMtrDistance, nY < 0 ? -nY : nY, m_ePoolUnit );
+ sal_Int32 n = pPool->GetDefaultItem(SDRATTR_SHADOWXDIST).GetValue();
+ if (n == 0)
+ n = pPool->GetDefaultItem(SDRATTR_SHADOWYDIST).GetValue();
+ SetMetricValue(*m_xMtrDistance, std::abs(n), m_ePoolUnit);
}
// Tristate, e. g. multiple objects have been marked of which some have a shadow and some don't.