summaryrefslogtreecommitdiff
path: root/dbaccess/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 11:24:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 12:09:30 +0200
commit034e9eee277d5123258fedc1861edf49c99159ef (patch)
tree695219b776c3fcd61fa614800d2789866e8865d2 /dbaccess/source/core
parent8e5a43223ce421643213e6542c6a971b6164f6aa (diff)
loplugin:buriedassign in dbaccess
Change-Id: Ia97da8d228a8c4e3ced31718a756fb13757beb8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92407 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/core')
-rw-r--r--dbaccess/source/core/api/CacheSet.cxx6
-rw-r--r--dbaccess/source/core/api/RowSet.cxx15
-rw-r--r--dbaccess/source/core/api/RowSetBase.cxx8
3 files changed, 19 insertions, 10 deletions
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
index bb50f281d1c3..92c1484edd75 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -64,9 +64,9 @@ OCacheSet::OCacheSet(sal_Int32 i_nMaxRows)
OUString OCacheSet::getIdentifierQuoteString() const
{
OUString sQuote;
- Reference<XDatabaseMetaData> xMeta;
- if ( m_xConnection.is() && (xMeta = m_xConnection->getMetaData()).is() )
- sQuote = xMeta->getIdentifierQuoteString();
+ if ( m_xConnection.is() )
+ if (auto xMeta = m_xConnection->getMetaData())
+ sQuote = xMeta->getIdentifierQuoteString();
return sQuote;
}
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index f652dc0e60cd..b197d28787a1 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1284,8 +1284,10 @@ const ORowSetValue& ORowSet::getInsertValue(sal_Int32 columnIndex)
checkCache();
if ( m_pCache && isInsertRow() )
- return (**m_pCache->m_aInsertRow)[m_nLastColumnIndex = columnIndex];
-
+ {
+ m_nLastColumnIndex = columnIndex;
+ return (**m_pCache->m_aInsertRow)[m_nLastColumnIndex];
+ }
return getValue(columnIndex);
}
@@ -1368,7 +1370,8 @@ Reference< css::io::XInputStream > SAL_CALL ORowSet::getBinaryStream( sal_Int32
if ( m_pCache && isInsertRow() )
{
checkCache();
- return new ::comphelper::SequenceInputStream((**m_pCache->m_aInsertRow)[m_nLastColumnIndex = columnIndex].getSequence());
+ m_nLastColumnIndex = columnIndex;
+ return new ::comphelper::SequenceInputStream((**m_pCache->m_aInsertRow)[m_nLastColumnIndex].getSequence());
}
return ORowSetBase::getBinaryStream(columnIndex);
@@ -1380,7 +1383,8 @@ Reference< css::io::XInputStream > SAL_CALL ORowSet::getCharacterStream( sal_Int
if(m_pCache && isInsertRow() )
{
checkCache();
- return new ::comphelper::SequenceInputStream((**m_pCache->m_aInsertRow)[m_nLastColumnIndex = columnIndex].getSequence());
+ m_nLastColumnIndex = columnIndex;
+ return new ::comphelper::SequenceInputStream((**m_pCache->m_aInsertRow)[m_nLastColumnIndex].getSequence());
}
return ORowSetBase::getCharacterStream(columnIndex);
@@ -1402,7 +1406,8 @@ Reference< XBlob > SAL_CALL ORowSet::getBlob( sal_Int32 columnIndex )
if ( m_pCache && isInsertRow() )
{
checkCache();
- return new ::connectivity::BlobHelper((**m_pCache->m_aInsertRow)[m_nLastColumnIndex = columnIndex].getSequence());
+ m_nLastColumnIndex = columnIndex;
+ return new ::connectivity::BlobHelper((**m_pCache->m_aInsertRow)[m_nLastColumnIndex].getSequence());
}
return ORowSetBase::getBlob(columnIndex);
}
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx
index 2572be7fc0ec..0bbe5e80ae0a 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -233,7 +233,8 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex)
ORowSetRow rRow = *m_aCurrentRow;
OSL_ENSURE(rRow.is() && o3tl::make_unsigned(columnIndex) < rRow->size(),"Invalid size of vector!");
#endif
- return (**m_aCurrentRow)[m_nLastColumnIndex = columnIndex];
+ m_nLastColumnIndex = columnIndex;
+ return (**m_aCurrentRow)[m_nLastColumnIndex];
}
// we should normally never reach this
@@ -340,7 +341,10 @@ Reference< css::io::XInputStream > SAL_CALL ORowSetBase::getBinaryStream( sal_In
}
if ( bValidCurrentRow )
- return new ::comphelper::SequenceInputStream((**m_aCurrentRow)[m_nLastColumnIndex = columnIndex].getSequence());
+ {
+ m_nLastColumnIndex = columnIndex;
+ return new ::comphelper::SequenceInputStream((**m_aCurrentRow)[m_nLastColumnIndex].getSequence());
+ }
// we should normally never reach this
return Reference< css::io::XInputStream >();