From 7767ff7b521b7d43a1ea2a4fd19a64bd171da5e0 Mon Sep 17 00:00:00 2001 From: Noel Date: Mon, 15 Feb 2021 19:58:15 +0200 Subject: loplugin:referencecasting in editeng..framework Change-Id: Ia3375011ecd0a65afed0f131f477fc1542603fde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110948 Tested-by: Jenkins Reviewed-by: Noel Grandin --- extensions/source/bibliography/bibload.cxx | 2 +- extensions/source/bibliography/framectr.cxx | 8 ++++---- extensions/source/bibliography/general.cxx | 4 ++-- extensions/source/dbpilots/gridwizard.cxx | 2 +- extensions/source/dbpilots/optiongrouplayouter.cxx | 6 +++--- extensions/source/propctrlr/browserlistbox.cxx | 2 +- extensions/source/propctrlr/cellbindinghelper.cxx | 6 +++--- extensions/source/propctrlr/composeduiupdate.cxx | 2 +- extensions/source/propctrlr/eventhandler.cxx | 2 +- extensions/source/propctrlr/formcomponenthandler.cxx | 2 +- extensions/source/propctrlr/formgeometryhandler.cxx | 6 +++--- extensions/source/propctrlr/handlerhelper.cxx | 4 ++-- extensions/source/update/feed/updatefeed.cxx | 4 ++-- 13 files changed, 25 insertions(+), 25 deletions(-) (limited to 'extensions/source') diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 312c47432f4a..2bacc3c31477 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -244,7 +244,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, pParentComponent->setVisible(true); } - Reference(m_xDatMan.get())->load(); + Reference(m_xDatMan)->load(); m_xDatMan->RegisterInterceptor(pBeamer); if ( rListener.is() ) diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 7f621eb72bea..2bb4246fe4c5 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -181,7 +181,7 @@ css::uno::Sequence< OUString > SAL_CALL BibFrameController_Impl::getSupportedSer void BibFrameController_Impl::attachFrame( const uno::Reference< XFrame > & xArg ) { xFrame = xArg; - xFrame->addFrameActionListener( mxImpl.get() ); + xFrame->addFrameActionListener( mxImpl ); } sal_Bool BibFrameController_Impl::attachModel( const uno::Reference< XModel > & /*xModel*/ ) @@ -192,9 +192,9 @@ sal_Bool BibFrameController_Impl::attachModel( const uno::Reference< XModel > & sal_Bool BibFrameController_Impl::suspend( sal_Bool bSuspend ) { if ( bSuspend ) - getFrame()->removeFrameActionListener( mxImpl.get() ); + getFrame()->removeFrameActionListener( mxImpl ); else - getFrame()->addFrameActionListener( mxImpl.get() ); + getFrame()->addFrameActionListener( mxImpl ); return true; } @@ -810,7 +810,7 @@ void BibFrameController_Impl::ChangeDataSource(const uno::Sequence< beans::Prope } else { - Reference xLoadable(m_xDatMan.get()); + Reference xLoadable(m_xDatMan); xLoadable->unload(); m_xDatMan->setActiveDataTable(aDBTableName); m_xDatMan->updateGridModel(); diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 1d2f66517a10..479aa7be18b8 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -403,7 +403,7 @@ void BibGeneralPage::RemoveListeners() { if(aControl.is()) { - aControl->removeFocusListener( mxBibGeneralPageFocusListener.get() ); + aControl->removeFocusListener( mxBibGeneralPageFocusListener ); aControl = nullptr; } } @@ -494,7 +494,7 @@ bool BibGeneralPage::AddXControl( // Peer as Child to the FrameWindow xCtrlContnr->addControl(rName, xControl); uno::Reference< awt::XWindow > xCtrWin(xControl, UNO_QUERY ); - xCtrWin->addFocusListener( mxBibGeneralPageFocusListener.get() ); + xCtrWin->addFocusListener( mxBibGeneralPageFocusListener ); rIndex = -1; // -> implies, that not found for(sal_uInt16 i = 0; i < FIELD_COUNT; i++) if(!aControls[i].is()) diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 1c5f568795e0..0559858ca1ca 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -172,7 +172,7 @@ namespace dbp // now loop through the descriptions and create the (grid)columns out of th descriptors { - Reference< XNameAccess > xExistenceChecker(xColumnContainer.get()); + Reference< XNameAccess > xExistenceChecker(xColumnContainer); std::vector< OUString >::const_iterator pColumnLabelPostfix = aColumnLabelPostfixes.begin(); std::vector< OUString >::const_iterator pFormFieldName = aFormFieldNames.begin(); diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx index 14a67ada98f7..23afd922cec4 100644 --- a/extensions/source/dbpilots/optiongrouplayouter.cxx +++ b/extensions/source/dbpilots/optiongrouplayouter.cxx @@ -90,7 +90,7 @@ namespace dbp // shape collection (for grouping the shapes) Reference< XShapes > xButtonCollection( ShapeCollection::create(mxContext) ); // first member : the shape of the control - xButtonCollection->add(_rContext.xObjectShape.get()); + xButtonCollection->add(_rContext.xObjectShape); sal_Int32 nTempHeight = (aControlShapeSize.Height - BUTTON_HEIGHT/4) / (nRadioButtons + 1); @@ -158,9 +158,9 @@ namespace dbp // xShapeProperties->setPropertyValue("Name", makeAny(sElementsName)); // add to the page - xPageShapes->add(xRadioShape.get()); + xPageShapes->add(xRadioShape); // add to the collection (for the later grouping) - xButtonCollection->add(xRadioShape.get()); + xButtonCollection->add(xRadioShape); // set the GroupBox as "LabelControl" for the RadioButton // (_after_ having inserted the model into the page!) diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index b30f4f3eeee5..8f164a249802 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -736,7 +736,7 @@ namespace pcr xControl = rLine.pLine->getControl(); if ( xControl.is() ) - xControl->setControlContext( m_pControlContextImpl.get() ); + xControl->setControlContext( m_pControlContextImpl ); // the initial property value if ( rPropertyData.bUnknownValue ) diff --git a/extensions/source/propctrlr/cellbindinghelper.cxx b/extensions/source/propctrlr/cellbindinghelper.cxx index 4b93d048ddaa..e27345e7fee7 100644 --- a/extensions/source/propctrlr/cellbindinghelper.cxx +++ b/extensions/source/propctrlr/cellbindinghelper.cxx @@ -477,19 +477,19 @@ namespace pcr bool CellBindingHelper::isCellBinding( const Reference< XValueBinding >& _rxBinding ) { - return doesComponentSupport( _rxBinding.get(), SERVICE_SHEET_CELL_BINDING ); + return doesComponentSupport( _rxBinding, SERVICE_SHEET_CELL_BINDING ); } bool CellBindingHelper::isCellIntegerBinding( const Reference< XValueBinding >& _rxBinding ) { - return doesComponentSupport( _rxBinding.get(), SERVICE_SHEET_CELL_INT_BINDING ); + return doesComponentSupport( _rxBinding, SERVICE_SHEET_CELL_INT_BINDING ); } bool CellBindingHelper::isCellRangeListSource( const Reference< XListEntrySource >& _rxSource ) { - return doesComponentSupport( _rxSource.get(), SERVICE_SHEET_CELLRANGE_LISTSOURCE ); + return doesComponentSupport( _rxSource, SERVICE_SHEET_CELLRANGE_LISTSOURCE ); } diff --git a/extensions/source/propctrlr/composeduiupdate.cxx b/extensions/source/propctrlr/composeduiupdate.cxx index 61c207341abd..0e32ef19a9db 100644 --- a/extensions/source/propctrlr/composeduiupdate.cxx +++ b/extensions/source/propctrlr/composeduiupdate.cxx @@ -389,7 +389,7 @@ namespace pcr ::rtl::Reference< CachedInspectorUI >& rUI = m_pCollectedUIs->aHandlers[ _rxHandler ]; if ( !rUI.is() ) rUI = new CachedInspectorUI( *this, &ComposedPropertyUIUpdate::callback_inspectorUIChanged_throw ); - return rUI.get(); + return rUI; } diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index f20107448ccb..74a1ba13a94b 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -781,7 +781,7 @@ namespace pcr PropertyHandlerHelper::getDialogParentFrame( m_xContext ), impl_getContextFrame_nothrow(), m_bIsDialogElement, - pEventHolder.get(), + pEventHolder, nInitialSelection ) ); diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index e63074053cf1..fd555b4867ad 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -3183,7 +3183,7 @@ namespace pcr return false; } - m_xCommandDesigner.set( new SQLCommandDesigner( m_xContext, xCommandUI.get(), m_xRowSetConnection, LINK( this, FormComponentPropertyHandler, OnDesignerClosed ) ) ); + m_xCommandDesigner.set( new SQLCommandDesigner( m_xContext, xCommandUI, m_xRowSetConnection, LINK( this, FormComponentPropertyHandler, OnDesignerClosed ) ) ); DBG_ASSERT( _rxInspectorUI.is(), "FormComponentPropertyHandler::OnDesignerClosed: no access to the property browser ui!" ); if ( m_xCommandDesigner->isActive() && _rxInspectorUI.is() ) diff --git a/extensions/source/propctrlr/formgeometryhandler.cxx b/extensions/source/propctrlr/formgeometryhandler.cxx index 8f7c04677538..282ecc8a3128 100644 --- a/extensions/source/propctrlr/formgeometryhandler.cxx +++ b/extensions/source/propctrlr/formgeometryhandler.cxx @@ -317,7 +317,7 @@ namespace pcr } if ( m_xAssociatedShape.is() ) - m_xChangeNotifier = new ShapeGeometryChangeNotifier( *this, m_aMutex, m_xAssociatedShape.get() ); + m_xChangeNotifier = new ShapeGeometryChangeNotifier( *this, m_aMutex, m_xAssociatedShape ); } @@ -689,10 +689,10 @@ namespace pcr css::awt::Point aRelativePosition( m_xAssociatedShape->getPosition() ); Reference< XTableColumns > xCols( xColsRows->getColumns(), UNO_SET_THROW ); - sal_Int32 nNewAnchorCol = lcl_getLowerBoundRowOrColumn( xCols.get(), false, aRelativePosition ); + sal_Int32 nNewAnchorCol = lcl_getLowerBoundRowOrColumn( xCols, false, aRelativePosition ); Reference< XTableRows > xRows( xColsRows->getRows(), UNO_SET_THROW ); - sal_Int32 nNewAnchorRow = lcl_getLowerBoundRowOrColumn( xRows.get(), true, aRelativePosition ); + sal_Int32 nNewAnchorRow = lcl_getLowerBoundRowOrColumn( xRows, true, aRelativePosition ); Any aNewAnchorCell( xSheet->getCellByPosition( nNewAnchorCol, nNewAnchorRow ) ); m_xShapeProperties->setPropertyValue( PROPERTY_ANCHOR, aNewAnchorCell ); diff --git a/extensions/source/propctrlr/handlerhelper.cxx b/extensions/source/propctrlr/handlerhelper.cxx index eb2d5f627d47..b83773b6f00a 100644 --- a/extensions/source/propctrlr/handlerhelper.cxx +++ b/extensions/source/propctrlr/handlerhelper.cxx @@ -128,7 +128,7 @@ namespace pcr for (auto const& initialEntry : aInitialEntries) xListControl->appendListEntry(initialEntry); - return xListControl.get(); + return xListControl; } } @@ -166,7 +166,7 @@ namespace pcr xNumericControl->setMinValue( _rMinValue ); xNumericControl->setMaxValue( _rMaxValue ); - return xNumericControl.get(); + return xNumericControl; } diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index 153233bbb67c..142bd301cffa 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -524,7 +524,7 @@ UpdateInformationProvider::getDocumentRoot(const uno::Reference< xml::dom::XNode * seems to evaluate expression always relative to the root node. */ uno::Reference< xml::dom::XDocument > xUpdateXML = m_xDocumentBuilder->newDocument(); - xUpdateXML->appendChild( xUpdateXML->importNode(xChildElement.get(), true ) ); + xUpdateXML->appendChild( xUpdateXML->importNode(xChildElement, true ) ); return xUpdateXML->getDocumentElement(); } } @@ -582,7 +582,7 @@ UpdateInformationProvider::getUpdateInformationEnumeration( uno::Reference< xml::dom::XNodeList > xNodeList; try { - xNodeList = m_xXPathAPI->selectNodeList(xDocument.get(), + xNodeList = m_xXPathAPI->selectNodeList(xDocument, aXPathExpression); } catch (const xml::xpath::XPathException &) { // ignore -- cgit