summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-03 15:43:04 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-03 20:47:58 +0100
commit49747ff2337fd1f4a3ee8e16d6328b8dacad99ec (patch)
tree110901102d4ae356b161434a4e4064a28a0a738a /dbaccess
parent0981f1d8c8a8918b5f28bf5605023b07e73b0d44 (diff)
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I75082c85862b83ed2503900186ce9c70783e54db Reviewed-on: https://gerrit.libreoffice.org/62817 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx8
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx26
2 files changed, 14 insertions, 20 deletions
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 2bca0c619984..dc110202eeba 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1969,8 +1969,7 @@ bool ODocumentDefinition::prepareClose()
// document has not yet been activated, i.e. has no UI, yet
return true;
- bool bCouldSuspend = xController->suspend( true );
- if ( !bCouldSuspend )
+ if (!xController->suspend(true))
// controller vetoed the closing
return false;
@@ -1984,9 +1983,8 @@ bool ODocumentDefinition::prepareClose()
}
if ( !save( true ) )
{
- if ( bCouldSuspend )
- // revert suspension
- xController->suspend( false );
+ // revert suspension
+ xController->suspend(false);
// saving failed or was cancelled
return false;
}
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 4f22d829ff10..5322308e5c83 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -1085,9 +1085,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr )
m_bAdded = true;
}
- TOTypeInfoSP pFieldType;
- if( pFieldDescr )
- pFieldType = pFieldDescr->getTypeInfo();
+ TOTypeInfoSP pFieldType(pFieldDescr->getTypeInfo());
ActivateAggregate( tpColumnName );
ActivateAggregate( tpType );
@@ -1237,19 +1235,17 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr )
}
m_pPreviousType = pFieldType;
}
- if(pFieldDescr)
+
+ if (pFieldDescr->IsPrimaryKey())
{
- if(pFieldDescr->IsPrimaryKey())
- {
- DeactivateAggregate( tpRequired );
- }
- else if ( !pAutoIncrement && pFieldType.get() )
- {
- if ( pFieldType->bNullable )
- ActivateAggregate( tpRequired );
- else
- DeactivateAggregate( tpRequired );
- }
+ DeactivateAggregate(tpRequired);
+ }
+ else if (!pAutoIncrement && pFieldType.get())
+ {
+ if (pFieldType->bNullable)
+ ActivateAggregate(tpRequired);
+ else
+ DeactivateAggregate(tpRequired);
}
// Initialize Controls
if( pAutoIncrement )