summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-11-29 17:21:33 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-11-29 17:21:33 +0100
commit7222ffb79c9886d36b4c0740a51c1c94e763d178 (patch)
treec71c2d13cbeb41fa967c8671c69b1833fdc44b63 /connectivity
parentbffac17a8249416d24986d37a50c5e74a0cb32b2 (diff)
Rewrite some (trivial) assignments inside if/while conditions: connectivity
Change-Id: I67d4bb92db04b5103b98a2855ae6069a054f171b
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/file/FDatabaseMetaData.cxx12
-rw-r--r--connectivity/source/drivers/firebird/ResultSet.cxx6
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.cxx9
3 files changed, 16 insertions, 11 deletions
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index 25d95d842b20..47f9dd6c59c3 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -274,8 +274,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
}
else // no extension, filter myself
{
- bool bErg = false;
- do
+ for (;;)
{
if (aURL.getExtension().isEmpty())
{
@@ -287,12 +286,13 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
}
break;
}
- else if ( ( bErg = xResultSet->next() ) )
+ if ( !xResultSet->next() )
{
- aName = xRow->getString(1);
- aURL.SetSmartURL(aName);
+ break;
}
- } while (bErg);
+ aName = xRow->getString(1);
+ aURL.SetSmartURL(aName);
+ }
}
if(bNewRow)
{
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index f48046524364..f4911df892dd 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -429,7 +429,8 @@ OUString OResultSet::makeNumericString(const sal_Int32 nColumnIndex)
template <typename T>
T OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT nType)
{
- if ((m_bWasNull = isNull(nColumnIndex)))
+ m_bWasNull = isNull(nColumnIndex);
+ if (m_bWasNull)
return T();
if ((m_pSqlda->sqlvar[nColumnIndex-1].sqltype & ~1) == nType)
@@ -622,7 +623,8 @@ T OResultSet::safelyRetrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT
checkColumnIndex(nColumnIndex);
checkRowIndex();
- if ((m_bWasNull = isNull(nColumnIndex)))
+ m_bWasNull = isNull(nColumnIndex);
+ if (m_bWasNull)
return T();
return retrieveValue< T >(nColumnIndex, nType);
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index 53a75134d0be..b5799eadfdad 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -870,7 +870,8 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str )
break;
if ( start == strlen)
return ret;
- } while ( (c=str.iterateCodePoints(&start)) );
+ c=str.iterateCodePoints(&start);
+ } while ( c );
do
{
if (!iswdigit(c))
@@ -878,7 +879,8 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str )
if ( start == strlen)
return ret;
digits += OUString(&c, 1);
- } while ( (c = str.iterateCodePoints(&start)) );
+ c = str.iterateCodePoints(&start);
+ } while ( c );
vec.push_back( digits.toInt32() );
do
{
@@ -886,7 +888,8 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str )
break;
if ( start == strlen)
return ret;
- } while ( (c=str.iterateCodePoints(&start)) );
+ c = str.iterateCodePoints(&start);
+ } while ( c );
if ( c == L'}' )
break;
if ( str.iterateCodePoints(&start) != L',' )