summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-03 14:55:29 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-03 14:13:57 +0100
commit2a3f5d11522cd69f0ce221cde3a63b7e85e94b53 (patch)
tree51a9483a42769f64fff5b329af6604cdf5a5f7ff /basctl
parente73bf95c00168bbf7d312cd11c40d0581ebd928e (diff)
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I856345576ff5c10a41509a97ad4539272bd55568 Reviewed-on: https://gerrit.libreoffice.org/62803 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2.cxx15
-rw-r--r--basctl/source/basicide/baside2b.cxx33
2 files changed, 18 insertions, 30 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 119f7c6b41a3..3c8efde81a15 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -341,15 +341,12 @@ void ModulWindow::BasicExecute()
ChooseMacro( uno::Reference< frame::XModel >() );
return;
}
- if ( pMethod )
- {
- pMethod->SetDebugFlags( m_aStatus.nBasicFlags );
- BasicDLL::SetDebugMode( true );
- RunMethod( pMethod );
- BasicDLL::SetDebugMode( false );
- // if cancelled during Interactive=false
- BasicDLL::EnableBreak( true );
- }
+ pMethod->SetDebugFlags(m_aStatus.nBasicFlags);
+ BasicDLL::SetDebugMode(true);
+ RunMethod(pMethod);
+ BasicDLL::SetDebugMode(false);
+ // if cancelled during Interactive=false
+ BasicDLL::EnableBreak(true);
ClearStatus( BASWIN_RUNNINGBASIC );
}
else
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 4dc3b0571851..a1ec27c3d636 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -148,13 +148,10 @@ void lcl_SeparateNameAndIndex( const OUString& rVName, OUString& rVar, OUString&
if ( nIndexStart != -1 )
{
sal_Int32 nIndexEnd = rVar.indexOf( ')', nIndexStart );
- if ( nIndexStart != -1 )
- {
- rIndex = rVar.copy( nIndexStart+1, nIndexEnd-nIndexStart-1 );
- rVar = rVar.copy( 0, nIndexStart );
- rVar = comphelper::string::stripEnd(rVar, ' ');
- rIndex = comphelper::string::strip(rIndex, ' ');
- }
+ rIndex = rVar.copy(nIndexStart + 1, nIndexEnd - nIndexStart - 1);
+ rVar = rVar.copy(0, nIndexStart);
+ rVar = comphelper::string::stripEnd(rVar, ' ');
+ rIndex = comphelper::string::strip(rIndex, ' ');
}
if ( !rVar.isEmpty() )
@@ -2412,7 +2409,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
SbxDimArray* pOldArray = pItem->mpArray.get();
bool bArrayChanged = false;
- if( pNewArray != nullptr && pOldArray != nullptr )
+ if (pOldArray != nullptr)
{
// Compare Array dimensions to see if array has changed
// Can be a copy, so comparing pointers does not work
@@ -2439,27 +2436,21 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
}
}
}
- else if( pNewArray == nullptr || pOldArray == nullptr )
+ else
{
bArrayChanged = true;
}
- if( pNewArray )
- {
- implEnableChildren( pEntry, true );
- }
+ implEnableChildren(pEntry, true);
// #i37227 Clear always and replace array
if( pNewArray != pOldArray )
{
pItem->clearWatchItem();
- if( pNewArray )
- {
- implEnableChildren( pEntry, true );
+ implEnableChildren(pEntry, true);
- pItem->mpArray = pNewArray;
- sal_uInt16 nDims = pNewArray->GetDims();
- pItem->nDimLevel = 0;
- pItem->nDimCount = nDims;
- }
+ pItem->mpArray = pNewArray;
+ sal_uInt16 nDims = pNewArray->GetDims();
+ pItem->nDimLevel = 0;
+ pItem->nDimCount = nDims;
}
if( bArrayChanged && pOldArray != nullptr )
{