diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-24 21:55:10 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-25 09:13:12 +0100 |
commit | f2cd9c0c789b5825b4d5bb84b352d089e231e527 (patch) | |
tree | 95f6ecfaf25231ee4de3320995263780cd655792 /editeng | |
parent | e1cbd518118a5f2889213e5725e0e0a3c133de5d (diff) |
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: If173f42302553b164267909a0a3156bb25a6d558
Reviewed-on: https://gerrit.libreoffice.org/63957
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 9 | ||||
-rw-r--r-- | editeng/source/editeng/eehtml.cxx | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index aab666131456..3df5480422e8 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1305,12 +1305,11 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList ) bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFontList ) { - static const sal_uInt16 gFontSizeWichMap[] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL, 0 }; - - const SvxFontItem* pFontItem = &rSet.Get( EE_CHAR_FONTINFO ); - if( !pFontItem || !pFontList ) + if (!pFontList) return false; + static const sal_uInt16 gFontSizeWichMap[] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL, 0 }; + const SvxFontItem& rFontItem = rSet.Get(EE_CHAR_FONTINFO); bool bRet = false; const sal_uInt16* pWhich = gFontSizeWichMap; @@ -1321,7 +1320,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo const MapUnit eUnit = rSet.GetPool()->GetMetric( *pWhich ); nHeight = OutputDevice::LogicToLogic(nHeight * 10, eUnit, MapUnit::MapPoint); - FontMetric aFontMetric = pFontList->Get( pFontItem->GetFamilyName(), pFontItem->GetStyleName() ); + FontMetric aFontMetric = pFontList->Get( rFontItem.GetFamilyName(), rFontItem.GetStyleName() ); const sal_IntPtr* pAry = pFontList->GetSizeAry( aFontMetric ); if( bGrow ) diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index 12fb9e2e22ee..c9f16b6772df 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -625,7 +625,7 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel ) aItems.Put( aHeightItemCTL ); // Paragraph margins, when Heading: - if ( !nHLevel || ((nHLevel >= 1) && (nHLevel <= 6)) ) + if (nHLevel <= 6) { SvxULSpaceItem aULSpaceItem( EE_PARA_ULSPACE ); aULSpaceItem.SetUpper( static_cast<sal_uInt16>(OutputDevice::LogicToLogic( 42, MapUnit::Map10thMM, eUnit )) ); |