Kaydet (Commit) 5bbe7927 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 PVS: V560 A part of conditional expression is always true/false

Change-Id: I5ca32214bab4b26208aecaa98eecc2a6297d9093
Reviewed-on: https://gerrit.libreoffice.org/65592
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst ff66e912
......@@ -262,7 +262,7 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt )
}
// automatically select right entry when dragging
if ((FirstSelected() != pEntry) || (FirstSelected() && NextSelected(FirstSelected())))
if ((FirstSelected() != pEntry) || NextSelected(FirstSelected()))
SelectAll(false);
Select(pEntry);
......
......@@ -1128,7 +1128,7 @@ SearchResult TextSearch::WildcardSrchFrwrd( const OUString& searchStr, sal_Int32
// Forward nStartPos inclusive, nEndPos exclusive, but allow for empty
// string match with [0,0).
if (nStartPos < 0 || nEndPos > nStringLen || nEndPos < nStartPos || nStartPos > nStringLen ||
if (nStartPos < 0 || nEndPos > nStringLen || nEndPos < nStartPos ||
(nStartPos == nStringLen && (nStringLen != 0 || nStartPos != nEndPos)))
return aRes;
......@@ -1300,7 +1300,7 @@ SearchResult TextSearch::WildcardSrchBkwrd( const OUString& searchStr, sal_Int32
// Backward nStartPos exclusive, nEndPos inclusive, but allow for empty
// string match with (0,0].
if (nStartPos > nStringLen || nEndPos < 0 || nStartPos < nEndPos || nEndPos > nStringLen ||
if (nStartPos > nStringLen || nEndPos < 0 || nStartPos < nEndPos ||
(nEndPos == nStringLen && (nStringLen != 0 || nStartPos != nEndPos)))
return aRes;
......
......@@ -1367,7 +1367,7 @@ SCROW lcl_LastVisible( const ScViewData& rViewData )
void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY )
{
if ( !pRowBar[SC_SPLIT_BOTTOM] || MAXROW < 10000 )
if (!pRowBar[SC_SPLIT_BOTTOM])
return;
SCROW nEndPos = MAXROW;
......
......@@ -1439,7 +1439,7 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint
if( pStyleSheetPool )
{
OUString aStr = GetSelectedEntry();
if( !aStr.isEmpty() && pStyleSheetPool )
if (!aStr.isEmpty())
{
const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
if( !pItem ) break;
......
......@@ -300,7 +300,7 @@ void GetTableSel( const SwLayoutFrame* pStart, const SwLayoutFrame* pEnd,
{
const SwLayoutFrame *pCell = pRow->FirstCell();
while( bTableIsValid && pCell && pRow->IsAnLower( pCell ) )
while (pCell && pRow->IsAnLower(pCell))
{
if( !pCell->isFrameAreaDefinitionValid() && nLoopMax )
{
......@@ -513,7 +513,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
{
const SwLayoutFrame *pCell = pRow->FirstCell();
while( bValidChartSel && bTableIsValid && pCell && pRow->IsAnLower( pCell ) )
while (pCell && pRow->IsAnLower(pCell))
{
if( !pCell->isFrameAreaDefinitionValid() && nLoopMax )
{
......
......@@ -1143,7 +1143,7 @@ SwTwips SwTableColumnPage::GetVisibleWidth(sal_uInt16 nPos)
while( nPos )
{
if(pTableData->GetColumns()[i].bVisible && nPos)
if(pTableData->GetColumns()[i].bVisible)
nPos--;
i++;
}
......@@ -1160,7 +1160,7 @@ void SwTableColumnPage::SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
sal_uInt16 i=0;
while( nPos )
{
if(pTableData->GetColumns()[i].bVisible && nPos)
if(pTableData->GetColumns()[i].bVisible)
nPos--;
i++;
}
......
......@@ -462,7 +462,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
long nMaxLineWidth = 0;
rLineInfo.Clear();
if ( !rStr.isEmpty() && (nWidth > 0) )
if (!rStr.isEmpty())
{
const bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation) == DrawTextFlags::WordBreakHyphenation;
css::uno::Reference< css::linguistic2::XHyphenator > xHyph;
......@@ -2177,7 +2177,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
if ( !(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::NoMnemonics) && !pVector
if (!(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::NoMnemonics)
&& accel && (!autoacc || !(nStyle & DrawTextFlags::HideMnemonic)) )
{
if ( nMnemonicPos != -1 )
......@@ -2213,7 +2213,7 @@ long OutputDevice::GetCtrlTextWidth( const OUString& rStr, const SalLayoutGlyphs
{
if ( nMnemonicPos < nIndex )
nIndex--;
else if ( (nMnemonicPos >= nIndex) && (static_cast<sal_uLong>(nMnemonicPos) < static_cast<sal_uLong>(nIndex+nLen)) )
else if (static_cast<sal_uLong>(nMnemonicPos) < static_cast<sal_uLong>(nIndex+nLen))
nLen--;
}
return GetTextWidth( aStr, nIndex, nLen, nullptr, pGlyphs );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment