Rewrite some (trivial) assignments inside if/while conditions: connectivity

Change-Id: I67d4bb92db04b5103b98a2855ae6069a054f171b
This commit is contained in:
Stephan Bergmann 2016-11-29 17:21:33 +01:00
parent bffac17a82
commit 7222ffb79c
3 changed files with 16 additions and 11 deletions

View File

@ -274,8 +274,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
} }
else // no extension, filter myself else // no extension, filter myself
{ {
bool bErg = false; for (;;)
do
{ {
if (aURL.getExtension().isEmpty()) if (aURL.getExtension().isEmpty())
{ {
@ -287,12 +286,13 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
} }
break; break;
} }
else if ( ( bErg = xResultSet->next() ) ) if ( !xResultSet->next() )
{ {
aName = xRow->getString(1); break;
aURL.SetSmartURL(aName);
} }
} while (bErg); aName = xRow->getString(1);
aURL.SetSmartURL(aName);
}
} }
if(bNewRow) if(bNewRow)
{ {

View File

@ -429,7 +429,8 @@ OUString OResultSet::makeNumericString(const sal_Int32 nColumnIndex)
template <typename T> template <typename T>
T OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT nType) 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(); return T();
if ((m_pSqlda->sqlvar[nColumnIndex-1].sqltype & ~1) == nType) 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); checkColumnIndex(nColumnIndex);
checkRowIndex(); checkRowIndex();
if ((m_bWasNull = isNull(nColumnIndex))) m_bWasNull = isNull(nColumnIndex);
if (m_bWasNull)
return T(); return T();
return retrieveValue< T >(nColumnIndex, nType); return retrieveValue< T >(nColumnIndex, nType);

View File

@ -870,7 +870,8 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str )
break; break;
if ( start == strlen) if ( start == strlen)
return ret; return ret;
} while ( (c=str.iterateCodePoints(&start)) ); c=str.iterateCodePoints(&start);
} while ( c );
do do
{ {
if (!iswdigit(c)) if (!iswdigit(c))
@ -878,7 +879,8 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str )
if ( start == strlen) if ( start == strlen)
return ret; return ret;
digits += OUString(&c, 1); digits += OUString(&c, 1);
} while ( (c = str.iterateCodePoints(&start)) ); c = str.iterateCodePoints(&start);
} while ( c );
vec.push_back( digits.toInt32() ); vec.push_back( digits.toInt32() );
do do
{ {
@ -886,7 +888,8 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str )
break; break;
if ( start == strlen) if ( start == strlen)
return ret; return ret;
} while ( (c=str.iterateCodePoints(&start)) ); c = str.iterateCodePoints(&start);
} while ( c );
if ( c == L'}' ) if ( c == L'}' )
break; break;
if ( str.iterateCodePoints(&start) != L',' ) if ( str.iterateCodePoints(&start) != L',' )