tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: Ieff0dde4faee209200b8f4e809e8bb4eb1b8f4a6
Reviewed-on: https://gerrit.libreoffice.org/64433
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 51898df..67662ee 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -296,15 +296,9 @@
// first we need a name for our query so ask the user
if(bNew)
{
OUString aDefaultName;
if (_bSaveAs && !bNew)
aDefaultName = m_sName;
else
{
OUString aName = DBA_RES(STR_TBL_TITLE);
aDefaultName = aName.getToken(0,' ');
aDefaultName = ::dbtools::createUniqueName(xTables,aDefaultName);
}
OUString aName = DBA_RES(STR_TBL_TITLE);
OUString aDefaultName = aName.getToken(0,' ');
aDefaultName = ::dbtools::createUniqueName(xTables,aDefaultName);
DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE );
ScopedVclPtrInstance< OSaveAsDlg > aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker, SADFlags::NONE );
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 86af8f6..404b1de 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -147,7 +147,7 @@
m_aSymbols[ aSymbolName ] = rSymbol;
bAdded = true;
}
else if (pFound && !bForceChange && bSymbolConflict)
else if (bSymbolConflict)
{
// TODO: to solve this a document owned symbol manager would be required ...
SAL_WARN("starmath", "symbol conflict, different symbol with same name found!");
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 07d4201..2a6dd21 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -307,7 +307,7 @@
{
sdr::table::SdrTableObj* pTableObj = mxTableObj.get();
if( !pWindow || !pTableObj || eHit == TableHitKind::NONE)
if (!pTableObj || eHit == TableHitKind::NONE)
{
mbLeftButtonDown = false;
}
@@ -1615,7 +1615,7 @@
// during text edit, check if we navigate out of the cell
ESelection aOldSelection = pOLV->GetSelection();
pOLV->PostKeyEvent(rKEvt);
bTextMove = pOLV && (aOldSelection == pOLV->GetSelection());
bTextMove = aOldSelection == pOLV->GetSelection();
if( !bTextMove )
{
nAction = TblAction::NONE;
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index 2428babd..8fd2384 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -226,7 +226,7 @@
for( size_t n = rLnks.size(); n; )
{
const ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
if( pLnk && OBJECT_CLIENT_GRF != pLnk->GetObjType() &&
if (OBJECT_CLIENT_GRF != pLnk->GetObjType() &&
dynamic_cast<const SwBaseLink*>( pLnk) != nullptr &&
!static_cast<const SwBaseLink*>(pLnk)->IsNoDataFlag() &&
static_cast<const SwBaseLink*>(pLnk)->IsInRange( nSttNd, nEndNd ))
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 59bdea7..74188bb 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2434,7 +2434,7 @@
}
const bool bSplitError = !Split( nDeadLine, bTryToSplit, ( bTableRowKeep && !(bAllowSplitOfRow || !bEmulateTableKeepFwdMoveAllowed) ) );
if( !bTryToSplit && !bSplitError && nUnSplitted > 0 )
if (!bTryToSplit && !bSplitError)
{
--nUnSplitted;
}
@@ -5197,7 +5197,7 @@
}
}
if ( ( bAttrSetChg && pNew &&
if ( ( bAttrSetChg &&
SfxItemState::SET == static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_PROTECT, false ) ) ||
( pNew && RES_PROTECT == pNew->Which()) )
{
@@ -5206,7 +5206,7 @@
pSh->Imp()->InvalidateAccessibleEditableState( true, this );
}
if ( bAttrSetChg && pNew &&
if ( bAttrSetChg &&
SfxItemState::SET == static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_FRAMEDIR, false, &pItem ) )
{
SetDerivedVert( false );
@@ -5214,7 +5214,7 @@
}
// #i29550#
if ( bAttrSetChg && pNew &&
if ( bAttrSetChg &&
SfxItemState::SET == static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_BOX, false, &pItem ) )
{
SwFrame* pTmpUpper = GetUpper();
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index f401e7a..e0d787f 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2473,7 +2473,7 @@
bool bIsCJK = false;
bool bIsCTL = false;
const size_t nCntAttr = (pTextNode && pTextNode->GetpSwpHints())
const size_t nCntAttr = pTextNode->GetpSwpHints()
? pTextNode->GetSwpHints().Count() : 0;
for(size_t i = 0; i < nCntAttr; ++i)
@@ -2893,8 +2893,7 @@
case RES_LR_SPACE:
if( pAttrPam->GetPoint()->nNode.GetIndex() ==
pAttrPam->GetMark()->nNode.GetIndex() &&
pCNd )
pAttrPam->GetMark()->nNode.GetIndex())
{
// because of numbering set this attribute directly at node
pCNd->SetAttr( *pAttr->m_pItem );
@@ -4912,7 +4911,7 @@
case HTML_SPTYPE_VERT:
if( nSize > 0 )
{
if( nSize && Application::GetDefaultDevice() )
if (Application::GetDefaultDevice())
{
nSize = Application::GetDefaultDevice()
->PixelToLogic( Size(0,nSize),
@@ -4960,7 +4959,7 @@
// If the paragraph is still empty, set first line
// indentation, otherwise apply letter spacing over a space.
if( nSize && Application::GetDefaultDevice() )
if (Application::GetDefaultDevice())
{
nSize = Application::GetDefaultDevice()
->PixelToLogic( Size(nSize,0),