diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 13:30:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 17:59:20 +0200 |
commit | f44bd7bb0ce23535f5e0ced7966677f4fff943fc (patch) | |
tree | 4e1801a7713e31b2b0f8f9d4fd586d5873511d2e /svx/source/fmcomp | |
parent | b1ef3c043d66e7cd529fc4fb13a3d2e8fdb4f2ee (diff) |
loplugin:referencecasting in svx
Change-Id: I2f6bc2467fa7689d186bc2bc45d2071ea0a38e63
Reviewed-on: https://gerrit.libreoffice.org/75998
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/fmcomp')
-rw-r--r-- | svx/source/fmcomp/fmgridcl.cxx | 4 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 18 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 11 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 3 |
4 files changed, 15 insertions, 21 deletions
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 221060d1abd3..8605f053e07c 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -138,7 +138,7 @@ sal_uInt16 FmGridHeader::GetModelColumnPos(sal_uInt16 nId) const void FmGridHeader::notifyColumnSelect(sal_uInt16 nColumnId) { sal_uInt16 nPos = GetModelColumnPos(nColumnId); - Reference< XIndexAccess > xColumns(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns(), UNO_QUERY); + Reference< XIndexAccess > xColumns = static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns(); if ( nPos < xColumns->getCount() ) { Reference< XSelectionSupplier > xSelSupplier(xColumns, UNO_QUERY); @@ -1985,7 +1985,7 @@ void FmGridControl::Select() try { - Reference< XIndexAccess > xColumns(GetPeer()->getColumns(), UNO_QUERY); + Reference< XIndexAccess > xColumns = GetPeer()->getColumns(); Reference< XSelectionSupplier > xSelSupplier(xColumns, UNO_QUERY); if (xSelSupplier.is()) { diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index a1cfd03bb854..007d1d8de543 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -562,8 +562,7 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< css::awt::XToolkit >& // as the FmGridControl touches the data source it is connected to we have to remember the current // cursor position (and restore afterwards) // OJ: but only when we stand on a valid row - Reference< XResultSet > xResultSet(xForm, UNO_QUERY); - if ( !xResultSet->isBeforeFirst() && !xResultSet->isAfterLast() ) + if ( !xForm->isBeforeFirst() && !xForm->isAfterLast() ) { try { @@ -2083,9 +2082,8 @@ void FmXGridPeer::startCursorListening() { if (!m_nCursorListening) { - Reference< XRowSet > xRowSet(m_xCursor, UNO_QUERY); - if (xRowSet.is()) - xRowSet->addRowSetListener(this); + if (m_xCursor.is()) + m_xCursor->addRowSetListener(this); Reference< XReset > xReset(m_xCursor, UNO_QUERY); if (xReset.is()) @@ -2107,9 +2105,8 @@ void FmXGridPeer::stopCursorListening() { if (!--m_nCursorListening) { - Reference< XRowSet > xRowSet(m_xCursor, UNO_QUERY); - if (xRowSet.is()) - xRowSet->removeRowSetListener(this); + if (m_xCursor.is()) + m_xCursor->removeRowSetListener(this); Reference< XReset > xReset(m_xCursor, UNO_QUERY); if (xReset.is()) @@ -2429,10 +2426,9 @@ void FmXGridPeer::registerDispatchProviderInterceptor(const Reference< css::fram { if (m_xFirstDispatchInterceptor.is()) { - Reference< css::frame::XDispatchProvider > xFirstProvider(m_xFirstDispatchInterceptor, UNO_QUERY); // there is already an interceptor; the new one will become its master - _xInterceptor->setSlaveDispatchProvider(xFirstProvider); - m_xFirstDispatchInterceptor->setMasterDispatchProvider(xFirstProvider); + _xInterceptor->setSlaveDispatchProvider(m_xFirstDispatchInterceptor); + m_xFirstDispatchInterceptor->setMasterDispatchProvider(m_xFirstDispatchInterceptor); } else { diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 5904a892904a..ab5705fd4cab 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -542,12 +542,12 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn ) ,m_pPainter( nullptr ) ,m_pWindow( nullptr ) { - Reference< XPropertySet > xColModelProps( _rColumn.getModel(), UNO_QUERY ); + Reference< XPropertySet > xColModelProps = _rColumn.getModel(); if ( !xColModelProps.is() ) return; // if our model's format key changes we want to propagate the new value to our windows - m_pModelChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, Reference< css::beans::XPropertySet > (_rColumn.getModel(), UNO_QUERY)); + m_pModelChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, _rColumn.getModel()); // be listener for some common properties implDoPropertyListening( FM_PROP_READONLY, false ); @@ -589,7 +589,7 @@ void DbCellControl::implDoPropertyListening(const OUString& _rPropertyName, bool { try { - Reference< XPropertySet > xColModelProps( m_rColumn.getModel(), UNO_QUERY ); + Reference< XPropertySet > xColModelProps = m_rColumn.getModel(); Reference< XPropertySetInfo > xPSI; if ( xColModelProps.is() ) xPSI = xColModelProps->getPropertySetInfo(); @@ -1316,10 +1316,9 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x // No? Maybe the css::form::component::Form behind the cursor? if (!m_xSupplier.is()) { - Reference< XRowSet > xCursorForm(xCursor, UNO_QUERY); - if (xCursorForm.is()) + if (xCursor.is()) { // If we take the formatter from the cursor, then also the key from the field to which we are bound - m_xSupplier = getNumberFormats(getConnection(xCursorForm)); + m_xSupplier = getNumberFormats(getConnection(xCursor)); if (m_rColumn.GetField().is()) nFormatKey = ::comphelper::getINT32(m_rColumn.GetField()->getPropertyValue(FM_PROP_FORMATKEY)); diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index ba1e06a712a8..202efac174f4 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -1449,8 +1449,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, DbGridCo Reference< css::util::XNumberFormatsSupplier > xSupplier = getNumberFormats(getConnection(_xCursor), true); if (xSupplier.is()) { - m_xFormatter.set( css::util::NumberFormatter::create(m_xContext), - UNO_QUERY); + m_xFormatter = css::util::NumberFormatter::create(m_xContext); m_xFormatter->attachNumberFormatsSupplier(xSupplier); // retrieve the datebase of the Numberformatter |