diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-08 10:03:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-08 10:34:50 +0100 |
commit | 7960ccb41db49a7883afa036b820a7b7ffcb4a89 (patch) | |
tree | d667c41a5dc20fed8ffda0404de4d04dab946e9f /connectivity | |
parent | 352bd98892c1cdf95756a49f38c84212eebffd7b (diff) |
loplugin:constantparam in canvas..comphelper
Change-Id: Ia666cb46c409852a13789389c032f0ce4377c0d5
Reviewed-on: https://gerrit.libreoffice.org/50927
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/dbtools.cxx | 15 | ||||
-rw-r--r-- | connectivity/source/drivers/writer/WTable.cxx | 12 |
2 files changed, 12 insertions, 15 deletions
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 834c7ba9aeda..c6737a7e07ad 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -337,7 +337,7 @@ Reference< XConnection> getConnection(const Reference< XRowSet>& _rxRowSet) // if connectRowset (which is deprecated) is removed, this function and one of its parameters are // not needed anymore, the whole implementation can be moved into ensureRowSetConnection then) SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext, - bool _bSetAsActiveConnection, bool _bAttachAutoDisposer ) + bool _bAttachAutoDisposer ) { SharedConnection xConnection; @@ -359,11 +359,8 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R || ( xExistingConn = findConnection( _rxRowSet ) ).is() ) { - if ( _bSetAsActiveConnection ) - { - xRowSetProps->setPropertyValue("ActiveConnection", makeAny( xExistingConn ) ); - // no auto disposer needed, since we did not create the connection - } + xRowSetProps->setPropertyValue("ActiveConnection", makeAny( xExistingConn ) ); + // no auto disposer needed, since we did not create the connection xConnection.reset( xExistingConn, SharedConnection::NoTakeOwnership ); break; @@ -424,7 +421,7 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R ); // now if we created a connection, forward it to the row set - if ( xConnection.is() && _bSetAsActiveConnection ) + if ( xConnection.is() ) { try { @@ -451,13 +448,13 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R Reference< XConnection> connectRowset(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext ) { - SharedConnection xConnection = lcl_connectRowSet( _rxRowSet, _rxContext, true/*bSetAsActiveConnection*/, true ); + SharedConnection xConnection = lcl_connectRowSet( _rxRowSet, _rxContext, true ); return xConnection.getTyped(); } SharedConnection ensureRowSetConnection(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext>& _rxContext ) { - return lcl_connectRowSet( _rxRowSet, _rxContext, true, false/*bUseAutoConnectionDisposer*/ ); + return lcl_connectRowSet( _rxRowSet, _rxContext, false/*bUseAutoConnectionDisposer*/ ); } Reference< XNameAccess> getTableFields(const Reference< XConnection>& _rxConn,const OUString& _rName) diff --git a/connectivity/source/drivers/writer/WTable.cxx b/connectivity/source/drivers/writer/WTable.cxx index 689abe5ac509..7c0018fa0948 100644 --- a/connectivity/source/drivers/writer/WTable.cxx +++ b/connectivity/source/drivers/writer/WTable.cxx @@ -45,14 +45,14 @@ static void lcl_GetDataArea(const uno::Reference<text::XTextTable>& xTable, sal_ } static void lcl_GetColumnInfo(const uno::Reference<text::XTextTable>& xTable, - sal_Int32 nDocColumn, sal_Int32 nStartRow, bool bHasHeaders, + sal_Int32 nDocColumn, bool bHasHeaders, OUString& rName, sal_Int32& rDataType, bool& rCurrency) { uno::Reference<table::XCellRange> xCellRange(xTable, uno::UNO_QUERY); // get column name from first row, if range contains headers if (bHasHeaders) { - uno::Reference<text::XText> xHeaderText(xCellRange->getCellByPosition(nDocColumn, nStartRow), uno::UNO_QUERY); + uno::Reference<text::XText> xHeaderText(xCellRange->getCellByPosition(nDocColumn, /*nStartRow*/0), uno::UNO_QUERY); if (xHeaderText.is()) rName = xHeaderText->getString(); } @@ -63,11 +63,11 @@ static void lcl_GetColumnInfo(const uno::Reference<text::XTextTable>& xTable, static void lcl_SetValue(connectivity::ORowSetValue& rValue, const uno::Reference<text::XTextTable>& xTable, - sal_Int32 nStartCol, sal_Int32 nStartRow, bool bHasHeaders, + sal_Int32 nStartCol, bool bHasHeaders, sal_Int32 nDBRow, sal_Int32 nDBColumn) { sal_Int32 nDocColumn = nStartCol + nDBColumn - 1; // database counts from 1 - sal_Int32 nDocRow = nStartRow + nDBRow - 1; + sal_Int32 nDocRow = nDBRow - 1; if (bHasHeaders) ++nDocRow; @@ -111,7 +111,7 @@ void OWriterTable::fillColumns() sal_Int32 eType = sdbc::DataType::OTHER; bool bCurrency = false; - lcl_GetColumnInfo(m_xTable, m_nStartCol + i, 0, m_bHasHeaders, + lcl_GetColumnInfo(m_xTable, m_nStartCol + i, m_bHasHeaders, aColumnName, eType, bCurrency); sal_Int32 nPrecision = 0; //! ... @@ -254,7 +254,7 @@ bool OWriterTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, { if ((_rRow->get())[i]->isBound()) { - lcl_SetValue((_rRow->get())[i]->get(), m_xTable, m_nStartCol, 0, m_bHasHeaders, + lcl_SetValue((_rRow->get())[i]->get(), m_xTable, m_nStartCol, m_bHasHeaders, m_nFilePos, i); } } |