diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-12 15:36:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-15 08:38:42 +0100 |
commit | 948c29710a0bb168ec07e3aca510fa6860f2da52 (patch) | |
tree | 6f65e78012a6a127c6efe2eaa9ba4ba57bc8302f /svx/source | |
parent | 881d8470eb9ede52690dbd75c02f72c6ee422261 (diff) |
loplugin:referencecasting in svx
Change-Id: I072ba9da976cefd61f4a916e70b0601439e8a123
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110818
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
38 files changed, 90 insertions, 95 deletions
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index f11ce49b3beb..f8ff9013e929 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -855,7 +855,7 @@ namespace accessibility auto aHardRef( rPara.first.get() ); if( aHardRef.is() ) - mrImpl.FireEvent(AccessibleEventId::CHILD, uno::Any(), uno::makeAny<css::uno::Reference<css::accessibility::XAccessible>>(aHardRef.get()) ); + mrImpl.FireEvent(AccessibleEventId::CHILD, uno::Any(), uno::makeAny<css::uno::Reference<css::accessibility::XAccessible>>(aHardRef) ); } private: @@ -1084,7 +1084,7 @@ namespace accessibility // #i61812# remember para to be removed for later notification // AFTER the new state is applied (that after the para got removed) - ::uno::Reference< XAccessible > xPara(begin->first.get().get()); + ::uno::Reference< XAccessible > xPara(begin->first.get()); // release everything from the remove position until the end maParaManager.Release(aFunctor.GetParaIndex(), nCurrParas); diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index 5eb01420269f..5553b4ae8fa3 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -673,7 +673,7 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::disposing() { for (const auto& rEntry : mxShapes) { - rtl::Reference<XAccessible> pAcc(rEntry.second.get()); + rtl::Reference<XAccessible> pAcc(rEntry.second); Reference< XComponent > xComp( pAcc.get(), UNO_QUERY ); if( xComp.is() ) xComp->dispose(); diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx index c2863a997b60..2325a4cede21 100644 --- a/svx/source/accessibility/charmapacc.cxx +++ b/svx/source/accessibility/charmapacc.cxx @@ -63,7 +63,7 @@ uno::Reference< css::accessibility::XAccessible > SvxShowCharSetItem::GetAccessi m_xItem = new SvxShowCharSetItemAcc( this ); } - return m_xItem.get(); + return m_xItem; } SvxShowCharSetAcc::SvxShowCharSetAcc(SvxShowCharSet* pParent) diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index aedb8d297bac..813efa3a5a30 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -381,7 +381,7 @@ uno::Reference< XAccessible > SAL_CALL SvxPixelCtlAccessibleChild::getAccessible uno::Reference< XAccessible > SAL_CALL SvxPixelCtlAccessibleChild::getAccessibleParent() { - return mxParent.get(); + return mxParent; } sal_Int16 SAL_CALL SvxPixelCtlAccessibleChild::getAccessibleRole() diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index d400ea955b0c..0e1c8150063e 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -141,7 +141,7 @@ Reference< XAccessible > SAL_CALL SvxRectCtlAccessibleContext::getAccessibleChil { checkChildIndex( nIndex ); - Reference< XAccessible > xChild(mvChildren[ nIndex ].get()); + Reference< XAccessible > xChild(mvChildren[ nIndex ]); if( !xChild.is() ) { ::SolarMutexGuard aSolarGuard; diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index a8328fc137b5..a96e404353d1 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -811,7 +811,7 @@ css::uno::Reference< XAccessible > SvxShowCharSet::CreateAccessible() { OSL_ENSURE(!m_xAccessible.is(),"Accessible already created!"); m_xAccessible = new svx::SvxShowCharSetAcc(this); - return m_xAccessible.get(); + return m_xAccessible; } svx::SvxShowCharSetItem* SvxShowCharSet::ImplGetItem( int _nPos ) diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index bd562618d09b..bf5ca03e7747 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -553,7 +553,7 @@ tools::Rectangle SvxRectCtl::CalculateFocusRectangle( RectPoint eRectPoint ) con Reference< XAccessible > SvxRectCtl::CreateAccessible() { pAccContext = new SvxRectCtlAccessibleContext(this); - return pAccContext.get(); + return pAccContext; } RectPoint SvxRectCtl::GetApproxRPFromPixPt( const css::awt::Point& r ) const @@ -574,7 +574,7 @@ css::uno::Reference< css::accessibility::XAccessible > SvxPixelCtl::CreateAccess { if (!m_xAccess.is()) m_xAccess = new SvxPixelCtlAccessible(this); - return m_xAccess.get(); + return m_xAccess; } tools::Long SvxPixelCtl::PointToIndex(const Point &aPt) const diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 09a72b3b9918..696a05d39964 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -1027,7 +1027,7 @@ Reference< XAccessible > FrameSelector::CreateAccessible() { if( !mxAccess.is() ) mxAccess = new a11y::AccFrameSelector(*this); - return mxAccess.get(); + return mxAccess; } rtl::Reference< a11y::AccFrameSelectorChild > FrameSelector::GetChildAccessible( FrameBorderType eBorder ) @@ -1046,7 +1046,7 @@ rtl::Reference< a11y::AccFrameSelectorChild > FrameSelector::GetChildAccessible( Reference< XAccessible > FrameSelector::GetChildAccessible( sal_Int32 nIndex ) { - return GetChildAccessible( GetEnabledBorderType( nIndex ) ).get(); + return GetChildAccessible( GetEnabledBorderType( nIndex ) ); } Reference< XAccessible > FrameSelector::GetChildAccessible( const Point& rPos ) diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 05a02788d246..4f1ad5049deb 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -835,7 +835,7 @@ css::uno::Reference< css::accessibility::XAccessible > GraphCtrl::CreateAccessib if (pView && pModel) mpAccContext = new SvxGraphCtrlAccessibleContext(*this); } - return mpAccContext.get(); + return mpAccContext; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 376b4cfba9e2..59a4898e2be5 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -761,7 +761,7 @@ css::uno::Reference<css::accessibility::XAccessible> WeldEditView::CreateAccessi { if (!m_xAccessible.is()) m_xAccessible.set(new WeldEditAccessible(this)); - return css::uno::Reference<css::accessibility::XAccessible>(m_xAccessible.get()); + return m_xAccessible; } WeldEditView::~WeldEditView() diff --git a/svx/source/form/fmcontrollayout.cxx b/svx/source/form/fmcontrollayout.cxx index 154ffa0bce2f..5acd501a4fda 100644 --- a/svx/source/form/fmcontrollayout.cxx +++ b/svx/source/form/fmcontrollayout.cxx @@ -203,12 +203,12 @@ namespace svxform Reference< XPropertySet > ControlLayouter::getDefaultDocumentTextStyle( const Reference< XPropertySet >& _rxModel ) { // the style family collection - Reference< XStyleFamiliesSupplier > xSuppStyleFamilies( getTypedModelNode< XStyleFamiliesSupplier >( _rxModel.get() ), UNO_SET_THROW ); + Reference< XStyleFamiliesSupplier > xSuppStyleFamilies( getTypedModelNode< XStyleFamiliesSupplier >( _rxModel ), UNO_SET_THROW ); Reference< XNameAccess > xStyleFamilies( xSuppStyleFamilies->getStyleFamilies(), UNO_SET_THROW ); // the names of the family, and the style - depends on the document type we live in OUString sFamilyName, sStyleName; - if ( !lcl_getDocumentDefaultStyleAndFamily( xSuppStyleFamilies.get(), sFamilyName, sStyleName ) ) + if ( !lcl_getDocumentDefaultStyleAndFamily( xSuppStyleFamilies, sFamilyName, sStyleName ) ) throw RuntimeException("unknown document type!"); // the concrete style @@ -233,7 +233,7 @@ namespace svxform // the document type if ( _eDocType == eUnknownDocumentType ) - _eDocType = DocumentClassification::classifyHostDocument( _rxControlModel.get() ); + _eDocType = DocumentClassification::classifyHostDocument( _rxControlModel ); // let's see what the configuration says about the visual effect OConfigurationNode aConfig = getLayoutSettings( _eDocType ); diff --git a/svx/source/form/fmdocumentclassification.cxx b/svx/source/form/fmdocumentclassification.cxx index 43e485d3cd9a..3b2f97c9150e 100644 --- a/svx/source/form/fmdocumentclassification.cxx +++ b/svx/source/form/fmdocumentclassification.cxx @@ -150,7 +150,7 @@ namespace svxform try { - Reference< XModel > xDocument( getDocument( _rxFormComponent.get() ) ); + Reference< XModel > xDocument( getDocument( _rxFormComponent ) ); if ( !xDocument.is() ) return eUnknownDocumentType; eType = classifyDocument( xDocument ); diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index 620599a25f0d..bd2d6186914a 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -186,7 +186,7 @@ void FmFormObj::impl_isolateControlModel_nothrow() Reference< XIndexContainer> xParent( xControlModel->getParent(), UNO_QUERY ); if ( xParent.is() ) { - sal_Int32 nPos = getElementPos( xParent.get(), xControlModel ); + sal_Int32 nPos = getElementPos( xParent, xControlModel ); xParent->removeByIndex( nPos ); } } diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx index c1376df08f38..73ad3f83eceb 100644 --- a/svx/source/form/fmscriptingenv.cxx +++ b/svx/source/form/fmscriptingenv.cxx @@ -770,9 +770,9 @@ namespace svxform try { if ( _bRegister ) - _rxManager->addScriptListener( m_pScriptListener.get() ); + _rxManager->addScriptListener( m_pScriptListener ); else - _rxManager->removeScriptListener( m_pScriptListener.get() ); + _rxManager->removeScriptListener( m_pScriptListener ); } catch( const RuntimeException& ) { throw; } catch( const Exception& ) diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 96f10415d48b..e0986c8ef0b0 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1852,7 +1852,7 @@ void FmXFormShell::setActiveController_Lock(const Reference<runtime::XFormContro } else if ( bResult && bIsNew ) { - Reference< XResultSet > xCursor( m_aActiveControllerFeatures->getCursor().get() ); + Reference< XResultSet > xCursor( m_aActiveControllerFeatures->getCursor() ); if ( xCursor.is() ) { DO_SAFE( xCursor->last(); ); @@ -3738,7 +3738,7 @@ namespace try { Reference< XConnection > xConn; - if ( isEmbeddedInDatabase( _rxLoadable.get(), xConn ) ) + if ( isEmbeddedInDatabase( _rxLoadable, xConn ) ) return true; // is there already an active connection diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index b868e5069cb4..60613663eda5 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -135,7 +135,7 @@ void FmRecordCountListener::propertyChange(const css::beans::PropertyChangeEven // FmSearchEngine - local classes SimpleTextWrapper::SimpleTextWrapper(const Reference< css::awt::XTextComponent > & _xText) - :ControlTextWrapper(_xText.get()) + :ControlTextWrapper(_xText) ,m_xText(_xText) { DBG_ASSERT(m_xText.is(), "FmSearchEngine::SimpleTextWrapper::SimpleTextWrapper : invalid argument !"); @@ -149,7 +149,7 @@ OUString SimpleTextWrapper::getCurrentText() const ListBoxWrapper::ListBoxWrapper(const Reference< css::awt::XListBox > & _xBox) - :ControlTextWrapper(_xBox.get()) + :ControlTextWrapper(_xBox) ,m_xBox(_xBox) { DBG_ASSERT(m_xBox.is(), "FmSearchEngine::ListBoxWrapper::ListBoxWrapper : invalid argument !"); @@ -163,7 +163,7 @@ OUString ListBoxWrapper::getCurrentText() const CheckBoxWrapper::CheckBoxWrapper(const Reference< css::awt::XCheckBox > & _xBox) - :ControlTextWrapper(_xBox.get()) + :ControlTextWrapper(_xBox) ,m_xBox(_xBox) { DBG_ASSERT(m_xBox.is(), "FmSearchEngine::CheckBoxWrapper::CheckBoxWrapper : invalid argument !"); diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 2cd568898a6c..6838066736b1 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -210,7 +210,7 @@ void FmXUndoEnvironment::dispose() FmFormPage* pPage = dynamic_cast<FmFormPage*>( rModel.GetPage(i) ); if ( pPage ) { - Reference< css::form::XForms > xForms = pPage->GetForms( false ).get(); + Reference< css::form::XForms > xForms = pPage->GetForms( false ); if ( xForms.is() ) RemoveElement( xForms ); } @@ -222,7 +222,7 @@ void FmXUndoEnvironment::dispose() FmFormPage* pPage = dynamic_cast<FmFormPage*>( rModel.GetMasterPage(i) ); if ( pPage ) { - Reference< css::form::XForms > xForms = pPage->GetForms( false ).get(); + Reference< css::form::XForms > xForms = pPage->GetForms( false ); if ( xForms.is() ) RemoveElement( xForms ); } @@ -261,7 +261,7 @@ void FmXUndoEnvironment::ModeChanged() FmFormPage* pPage = dynamic_cast<FmFormPage*>( rModel.GetPage(i) ); if ( pPage ) { - Reference< css::form::XForms > xForms = pPage->GetForms( false ).get(); + Reference< css::form::XForms > xForms = pPage->GetForms( false ); if ( xForms.is() ) TogglePropertyListening( xForms ); } @@ -273,7 +273,7 @@ void FmXUndoEnvironment::ModeChanged() FmFormPage* pPage = dynamic_cast<FmFormPage*>( rModel.GetMasterPage(i) ); if ( pPage ) { - Reference< css::form::XForms > xForms = pPage->GetForms( false ).get(); + Reference< css::form::XForms > xForms = pPage->GetForms( false ); if ( xForms.is() ) TogglePropertyListening( xForms ); } @@ -485,9 +485,8 @@ void FmXUndoEnvironment::Removed(FmFormObj* pObj) if (!xForm.is()) return; - Reference< XIndexAccess > xIndexAccess(xForm.get()); // determine which position the child was at - const sal_Int32 nPos = getElementPos(xIndexAccess, xContent); + const sal_Int32 nPos = getElementPos(xForm, xContent); if (nPos < 0) return; @@ -1094,7 +1093,7 @@ void FmUndoContainerAction::implReInsert( ) } m_xContainer->insertByIndex( m_nIndex, aVal ); - OSL_ENSURE( getElementPos( m_xContainer.get(), m_xElement ) == m_nIndex, "FmUndoContainerAction::implReInsert: insertion did not work!" ); + OSL_ENSURE( getElementPos( m_xContainer, m_xElement ) == m_nIndex, "FmUndoContainerAction::implReInsert: insertion did not work!" ); // register the events Reference< XEventAttacherManager > xManager( m_xContainer, UNO_QUERY ); @@ -1116,7 +1115,7 @@ void FmUndoContainerAction::implReRemove( ) { // the indexes in the container changed. Okay, so go the long way and // manually determine the index - m_nIndex = getElementPos( m_xContainer.get(), m_xElement ); + m_nIndex = getElementPos( m_xContainer, m_xElement ); if ( m_nIndex != -1 ) xElement = m_xElement; } diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index 34e3f228cbb4..b8a0ed479719 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -141,7 +141,7 @@ void FmFormView::MarkListHasChanged() pImpl->m_pMarkedGrid = nullptr; if ( pImpl->m_xWindow.is() ) { - pImpl->m_xWindow->removeFocusListener(pImpl.get()); + pImpl->m_xWindow->removeFocusListener(pImpl); pImpl->m_xWindow = nullptr; } SetMoveOutside(false); @@ -472,7 +472,7 @@ bool FmFormView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) pImpl->m_pMarkedGrid = pObj; pImpl->m_xWindow = xWindow; // add as listener to get notified when ESC will be pressed inside the grid - pImpl->m_xWindow->addFocusListener(pImpl.get()); + pImpl->m_xWindow->addFocusListener(pImpl); SetMoveOutside(true); //OLMRefreshAllIAOManagers(); xWindow->setFocus(); diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index f197548cad70..4bc1c96fb13c 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -356,7 +356,7 @@ void FormViewPageWindowAdapter::updateTabOrder( const Reference< XForm >& _rxFor try { - Reference< XTabController > xTabCtrl( getController( _rxForm ).get() ); + Reference< XTabController > xTabCtrl( getController( _rxForm ) ); if ( xTabCtrl.is() ) { // if there already is a TabController for this form, then delegate the "updateTabOrder" request xTabCtrl->activateTabOrder(); diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index c05b272b94e8..5e2d36c61fb2 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -1259,7 +1259,7 @@ void SAL_CALL FormController::propertyChange(const PropertyChangeEvent& evt) { m_aControlBorderManager.enableDynamicBorderColor(); if ( m_xActiveControl.is() ) - m_aControlBorderManager.focusGained( m_xActiveControl.get() ); + m_aControlBorderManager.focusGained( m_xActiveControl ); } else { @@ -1863,7 +1863,7 @@ void FormController::setModel(const Reference< XTabControllerModel > & Model) ) { bool bEnableDynamicControlBorder = lcl_shouldUseDynamicControlBorder( - xModelProps.get(), xModelProps->getPropertyValue( FM_PROP_DYNAMIC_CONTROL_BORDER ) ); + xModelProps, xModelProps->getPropertyValue( FM_PROP_DYNAMIC_CONTROL_BORDER ) ); if ( bEnableDynamicControlBorder ) m_aControlBorderManager.enableDynamicBorderColor(); else @@ -4110,7 +4110,7 @@ Reference< XDispatchProviderInterceptor > FormController::createInterceptor(con rtl::Reference<DispatchInterceptionMultiplexer> pInterceptor(new DispatchInterceptionMultiplexer( _xInterception, this )); m_aControlDispatchInterceptors.push_back( pInterceptor ); - return pInterceptor.get(); + return pInterceptor; } diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index bc9302f41cd5..5cde1645f4cf 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1510,7 +1510,7 @@ namespace svxform { const std::unique_ptr<weld::TreeIter>& rIter = *it; FmFormData* pFormData = reinterpret_cast<FmFormData*>(m_xTreeView->get_id(*rIter).toInt64()); - aSelection.insert( pFormData->GetPropertySet().get() ); + aSelection.insert( pFormData->GetPropertySet() ); ++it; } } @@ -1523,7 +1523,7 @@ namespace svxform { const std::unique_ptr<weld::TreeIter>& rIter = *it; FmEntryData* pEntryData = reinterpret_cast<FmEntryData*>(m_xTreeView->get_id(*rIter).toInt64()); - aSelection.insert( pEntryData->GetPropertySet().get() ); + aSelection.insert( pEntryData->GetPropertySet() ); ++it; } } diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx index 5b2a1ce3fd79..c8d5326cae1d 100644 --- a/svx/source/form/navigatortreemodel.cxx +++ b/svx/source/form/navigatortreemodel.cxx @@ -227,7 +227,7 @@ namespace svxform { Reference< css::form::XForms > xForms( GetForms()); if(xForms.is()) - xForms->removeContainerListener(m_pPropChangeList.get()); + xForms->removeContainerListener(m_pPropChangeList); // delete RootList @@ -320,7 +320,7 @@ namespace svxform // register as PropertyChangeListener Reference< XPropertySet > xSet(xElement, UNO_QUERY); if( xSet.is() ) - xSet->addPropertyChangeListener( FM_PROP_NAME, m_pPropChangeList.get() ); + xSet->addPropertyChangeListener( FM_PROP_NAME, m_pPropChangeList ); // Remove data from model @@ -328,7 +328,7 @@ namespace svxform { Reference< XContainer > xContainer(xElement, UNO_QUERY); if (xContainer.is()) - xContainer->addContainerListener(m_pPropChangeList.get()); + xContainer->addContainerListener(m_pPropChangeList); } if (pFolder) @@ -389,7 +389,7 @@ namespace svxform { Reference< XIndexContainer > xContainer(xElement->getParent(), UNO_QUERY); // remove from Container - sal_Int32 nContainerIndex = getElementPos(xContainer.get(), xElement); + sal_Int32 nContainerIndex = getElementPos(xContainer, xElement); // UndoAction if (nContainerIndex >= 0) { @@ -461,7 +461,7 @@ namespace svxform // unregister as PropertyChangeListener Reference< XPropertySet > xSet( pFormData->GetPropertySet() ); if ( xSet.is() ) - xSet->removePropertyChangeListener( FM_PROP_NAME, m_pPropChangeList.get() ); + xSet->removePropertyChangeListener( FM_PROP_NAME, m_pPropChangeList ); } @@ -476,7 +476,7 @@ namespace svxform // unregister as PropertyChangeListener Reference< XPropertySet > xSet( pControlData->GetPropertySet() ); if (xSet.is()) - xSet->removePropertyChangeListener( FM_PROP_NAME, m_pPropChangeList.get()); + xSet->removePropertyChangeListener( FM_PROP_NAME, m_pPropChangeList); } @@ -804,7 +804,7 @@ namespace svxform if (!xForms.is()) return; - xForms->addContainerListener(m_pPropChangeList.get()); + xForms->addContainerListener(m_pPropChangeList); FillBranch(nullptr); diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index c237410bdd1f..811fc8ea01a8 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -122,7 +122,7 @@ FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, weld::Win m_xHelper.set(new OColumnTransferable( ColumnTransferFormatFlags::FIELD_DESCRIPTOR | ColumnTransferFormatFlags::CONTROL_EXCHANGE | ColumnTransferFormatFlags::COLUMN_DESCRIPTOR )); - rtl::Reference<TransferDataContainer> xHelper(m_xHelper.get()); + rtl::Reference<TransferDataContainer> xHelper(m_xHelper); m_xListBox->enable_drag_source(xHelper, DND_ACTION_COPY); m_xListBox->connect_drag_begin(LINK(this, FmFieldWin, DragBeginHdl)); diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 53a80f81bc16..ff100ee2ef95 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -608,7 +608,7 @@ void GalleryBrowser2::SelectTheme( std::u16string_view rThemeName ) mpCurTheme = mpGallery->AcquireTheme( rThemeName, *this ); m_xHelper.set(new GalleryTransferable(mpCurTheme, 0, true)); - rtl::Reference<TransferDataContainer> xHelper(m_xHelper.get()); + rtl::Reference<TransferDataContainer> xHelper(m_xHelper); mxListView->enable_drag_source(xHelper, DND_ACTION_COPY | DND_ACTION_LINK); mxIconView->SetDragDataTransferrable(xHelper, DND_ACTION_COPY | DND_ACTION_LINK); mxPreview->SetDragDataTransferrable(xHelper, DND_ACTION_COPY | DND_ACTION_LINK); diff --git a/svx/source/items/drawitem.cxx b/svx/source/items/drawitem.cxx index da37496955b8..69482d56ff2d 100644 --- a/svx/source/items/drawitem.cxx +++ b/svx/source/items/drawitem.cxx @@ -76,7 +76,7 @@ SvxColorListItem* SvxColorListItem::Clone( SfxItemPool * ) const #define QUERY_PUT_IMPL(svtype, xtype) \ bool svtype::QueryValue( css::uno::Any& rVal, sal_uInt8 ) const \ { \ - rVal <<= uno::Reference< uno::XWeak >( p##xtype.get() ); \ + rVal <<= uno::Reference< uno::XWeak >( p##xtype ); \ return true; \ } \ \ diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index ad8814a974f0..e1bd4d2a026a 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -374,7 +374,7 @@ namespace drawinglayer::primitive2d if(0.0 != aAnimationList.getDuration()) { // create content sequence - const Primitive2DReference xRefA(pNew.get()); + const Primitive2DReference xRefA(pNew); const Primitive2DContainer aContent { xRefA }; // create and add animated switch primitive @@ -383,7 +383,7 @@ namespace drawinglayer::primitive2d else { // add to decomposition - return Primitive2DReference(pNew.get()); + return Primitive2DReference(pNew); } } @@ -482,7 +482,7 @@ namespace drawinglayer::primitive2d else { // add to decomposition - return Primitive2DReference(pNew.get()); + return Primitive2DReference(pNew); } } } @@ -492,7 +492,7 @@ namespace drawinglayer::primitive2d // #i97628# // encapsulate with TextHierarchyEditPrimitive2D to allow renderers // to suppress actively edited content if needed - const Primitive2DReference xRefA(pNew.get()); + const Primitive2DReference xRefA(pNew); const Primitive2DContainer aContent { xRefA }; // create and add TextHierarchyEditPrimitive2D primitive @@ -501,7 +501,7 @@ namespace drawinglayer::primitive2d else { // add to decomposition - return pNew.get(); + return pNew; } } diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index aa9ca030fe41..894b9a941ceb 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -418,7 +418,7 @@ namespace drawinglayer::primitive2d xBlockText.clear(); // add to local primitives - aRetval.push_back(pNewBlockText.get()); + aRetval.push_back(pNewBlockText); } // add shadow diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 78bb0c1ce250..3e11292b40f1 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1036,8 +1036,8 @@ void SdrOle2Obj::Connect_Impl() if ( !mpImpl->mxLightClient.is() ) mpImpl->mxLightClient = new SdrLightEmbeddedClient_Impl( this ); - mpImpl->mxObjRef->addStateChangeListener( mpImpl->mxLightClient.get() ); - mpImpl->mxObjRef->addEventListener( uno::Reference< document::XEventListener >( mpImpl->mxLightClient.get() ) ); + mpImpl->mxObjRef->addStateChangeListener( mpImpl->mxLightClient ); + mpImpl->mxObjRef->addEventListener( mpImpl->mxLightClient ); if ( mpImpl->mxObjRef->getCurrentState() != embed::EmbedStates::LOADED ) GetSdrGlobalData().GetOLEObjCache().InsertObj(this); @@ -1079,8 +1079,7 @@ void SdrOle2Obj::AddListeners_Impl() uno::Reference< util::XModifyBroadcaster > xBC( getXModel(), uno::UNO_QUERY ); if (xBC.is()) { - uno::Reference<util::XModifyListener> xListener(mpImpl->mxModifyListener.get()); - xBC->addModifyListener( xListener ); + xBC->addModifyListener( mpImpl->mxModifyListener ); } } @@ -1112,8 +1111,7 @@ void SdrOle2Obj::RemoveListeners_Impl() uno::Reference< util::XModifyBroadcaster > xBC( getXModel(), uno::UNO_QUERY ); if (xBC.is() && mpImpl->mxModifyListener.is()) { - uno::Reference<util::XModifyListener> xListener(mpImpl->mxModifyListener.get()); - xBC->removeModifyListener( xListener ); + xBC->removeModifyListener( mpImpl->mxModifyListener ); } } } @@ -1186,8 +1184,8 @@ void SdrOle2Obj::Disconnect_Impl() if ( mpImpl->mxObjRef.is() && mpImpl->mxLightClient.is() ) { - mpImpl->mxObjRef->removeStateChangeListener ( mpImpl->mxLightClient.get() ); - mpImpl->mxObjRef->removeEventListener( uno::Reference< document::XEventListener >( mpImpl->mxLightClient.get() ) ); + mpImpl->mxObjRef->removeStateChangeListener ( mpImpl->mxLightClient ); + mpImpl->mxObjRef->removeEventListener( mpImpl->mxLightClient ); mpImpl->mxObjRef->setClientSite( nullptr ); GetSdrGlobalData().GetOLEObjCache().RemoveObj(this); @@ -1442,7 +1440,7 @@ void SdrOle2Obj::ImpSetVisAreaSize() mpImpl->mxObjRef.GetObject())); const bool bHasOwnClient( mpImpl->mxLightClient.is() && - mpImpl->mxObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->mxLightClient.get() ) ); + mpImpl->mxObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->mxLightClient ) ); if ( pClient || bHasOwnClient ) { @@ -1886,7 +1884,7 @@ bool SdrOle2Obj::AddOwnLightClient() { // The Own Light Client must be registered in object only using this method! if ( !SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(getSdrModelFromSdrObject().GetPersist()), mpImpl->mxObjRef.GetObject() ) - && !( mpImpl->mxLightClient.is() && mpImpl->mxObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->mxLightClient.get() ) ) ) + && !( mpImpl->mxLightClient.is() && mpImpl->mxObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->mxLightClient ) ) ) { Connect(); @@ -1899,7 +1897,7 @@ bool SdrOle2Obj::AddOwnLightClient() { mpImpl->mxLightClient->SetSizeScale( aScaleWidth, aScaleHeight ); try { - mpImpl->mxObjRef->setClientSite( mpImpl->mxLightClient.get() ); + mpImpl->mxObjRef->setClientSite( mpImpl->mxLightClient ); return true; } catch( uno::Exception& ) {} diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx index 3b65874b7a73..248fbcdc534b 100644 --- a/svx/source/table/accessibletableshape.cxx +++ b/svx/source/table/accessibletableshape.cxx @@ -143,7 +143,7 @@ rtl::Reference< AccessibleCell > AccessibleTableShapeImpl::getAccessibleCell (co if( iter != maChildMap.end() ) { - rtl::Reference< AccessibleCell > xChild( (*iter).second.get() ); + rtl::Reference< AccessibleCell > xChild( (*iter).second ); return xChild; } return rtl::Reference< AccessibleCell >(); @@ -164,7 +164,7 @@ rtl::Reference< AccessibleCell > AccessibleTableShapeImpl::getAccessibleCell (sa xAccessibleCell->Init(); maChildMap[xCell] = xAccessibleCell; - xChild = rtl::Reference< AccessibleCell >( xAccessibleCell.get() ); + xChild = xAccessibleCell; } return xChild; } @@ -180,7 +180,7 @@ Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild(sal_Int32 if( iter != maChildMap.end() ) { - Reference< XAccessible > xChild( (*iter).second.get() ); + Reference< XAccessible > xChild( (*iter).second ); return xChild; } else @@ -192,8 +192,7 @@ Reference< XAccessible > AccessibleTableShapeImpl::getAccessibleChild(sal_Int32 xAccessibleCell->Init(); maChildMap[xCell] = xAccessibleCell; - Reference< XAccessible > xChild( xAccessibleCell.get() ); - return xChild; + return xAccessibleCell; } } diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index cc4e292ce60a..3bc253b48b71 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -389,8 +389,7 @@ rtl::Reference< Cell > Cell::create( SdrTableObj& rTableObj ) rtl::Reference< Cell > xCell( new Cell( rTableObj ) ); if( xCell->mxTable.is() ) { - Reference< XEventListener > xListener( xCell.get() ); - xCell->mxTable->addEventListener( xListener ); + xCell->mxTable->addEventListener( xCell ); } return xCell; } diff --git a/svx/source/table/cellrange.cxx b/svx/source/table/cellrange.cxx index c0a7eee72261..f9941fd242da 100644 --- a/svx/source/table/cellrange.cxx +++ b/svx/source/table/cellrange.cxx @@ -72,7 +72,7 @@ sal_Int32 CellRange::getBottom() Reference< XTable > CellRange::getTable() { - return mxTable.get(); + return mxTable; } diff --git a/svx/source/table/propertyset.cxx b/svx/source/table/propertyset.cxx index 300c877bf67e..0dc90358c229 100644 --- a/svx/source/table/propertyset.cxx +++ b/svx/source/table/propertyset.cxx @@ -105,7 +105,7 @@ FastPropertySet::~FastPropertySet() Reference< XPropertySetInfo > SAL_CALL FastPropertySet::getPropertySetInfo( ) { - return Reference< XPropertySetInfo >( mxInfo.get() ); + return mxInfo; } diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 2d70a85264d6..f3d4ae4d5728 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -931,7 +931,7 @@ SdrTableObj::~SdrTableObj() Reference< XTable > SdrTableObj::getTable() const { - return Reference< XTable >( mpImpl->mxTable.get() ); + return mpImpl->mxTable; } @@ -1026,7 +1026,7 @@ CellPos SdrTableObj::getPreviousCell( const CellPos& rPos, bool bEdgeTravel ) co if( xCell.is() && xCell->isMerged() ) { sal_Int32 nTemp = 0; - findMergeOrigin( mpImpl->mxTable.get(), aPos.mnCol, aPos.mnRow, aPos.mnCol, nTemp ); + findMergeOrigin( mpImpl->mxTable, aPos.mnCol, aPos.mnRow, aPos.mnCol, nTemp ); } if( aPos.mnCol > 0 ) @@ -1270,7 +1270,7 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_ CellRef xCell( mpImpl->getCell( CellPos( rnX, rnY ) ) ); if( xCell.is() && xCell->isMerged() ) - findMergeOrigin( mpImpl->mxTable.get(), rnX, rnY, rnX, rnY ); + findMergeOrigin( mpImpl->mxTable, rnX, rnY, rnX, rnY ); if( xCell.is() ) { @@ -1611,7 +1611,7 @@ void SdrTableObj::setActiveCell( const CellPos& rPos ) if( mpImpl->mxActiveCell.is() && mpImpl->mxActiveCell->isMerged() ) { CellPos aOrigin; - findMergeOrigin( mpImpl->mxTable.get(), rPos.mnCol, rPos.mnRow, aOrigin.mnCol, aOrigin.mnRow ); + findMergeOrigin( mpImpl->mxTable, rPos.mnCol, rPos.mnRow, aOrigin.mnCol, aOrigin.mnRow ); mpImpl->mxActiveCell.set( dynamic_cast< Cell* >( mpImpl->mxTable->getCellByPosition( aOrigin.mnCol, aOrigin.mnRow ).get() ) ); mpImpl->maEditPos = aOrigin; } diff --git a/svx/source/table/tablecolumns.cxx b/svx/source/table/tablecolumns.cxx index a9a37e5ef426..c202f3a52cea 100644 --- a/svx/source/table/tablecolumns.cxx +++ b/svx/source/table/tablecolumns.cxx @@ -93,7 +93,7 @@ Any SAL_CALL TableColumns::getByIndex( sal_Int32 Index ) if( ( Index < 0 ) || ( Index >= mxTableModel->getColumnCount() ) ) throw IndexOutOfBoundsException(); - return Any( Reference< XCellRange >( mxTableModel->getColumn( Index ).get() ) ); + return Any( Reference< XCellRange >( mxTableModel->getColumn( Index ) ) ); } diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx index d7d04191163c..6efcbd1280dc 100644 --- a/svx/source/table/tablemodel.cxx +++ b/svx/source/table/tablemodel.cxx @@ -373,7 +373,7 @@ Reference< XTableColumns > SAL_CALL TableModel::getColumns() if( !mxTableColumns.is() ) mxTableColumns.set( new TableColumns( this ) ); - return mxTableColumns.get(); + return mxTableColumns; } @@ -383,7 +383,7 @@ Reference< XTableRows > SAL_CALL TableModel::getRows() if( !mxTableRows.is() ) mxTableRows.set( new TableRows( this ) ); - return mxTableRows.get(); + return mxTableRows; } @@ -396,7 +396,7 @@ Reference< XCell > SAL_CALL TableModel::getCellByPosition( sal_Int32 nColumn, sa CellRef xCell( getCell( nColumn, nRow ) ); if( xCell.is() ) - return xCell.get(); + return xCell; throw IndexOutOfBoundsException(); } diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx index ae4153954130..68d7a36c59c7 100644 --- a/svx/source/tbxctrls/colrctrl.cxx +++ b/svx/source/tbxctrls/colrctrl.cxx @@ -93,7 +93,7 @@ void SvxColorValueSet_docking::SetDrawingArea(weld::DrawingArea* pDrawingArea) SetStyle(GetStyle() | WB_ITEMBORDER); m_xHelper.set(new SvxColorValueSetData); - rtl::Reference<TransferDataContainer> xHelper(m_xHelper.get()); + rtl::Reference<TransferDataContainer> xHelper(m_xHelper); SetDragDataTransferrable(xHelper, DND_ACTION_COPY); } diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 42e8eb4a12e0..3573a21349cf 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -1005,9 +1005,9 @@ void SAL_CALL SvXMLGraphicImportExportHelper::initialize( aArguments[0] >>= xStorage; rtl::Reference<SvXMLGraphicHelper> pHelper( SvXMLGraphicHelper::Create( xStorage, m_eGraphicHelperMode )); - m_xGraphicObjectResolver.set( pHelper.get() ); - m_xGraphicStorageHandler.set( pHelper.get() ); - m_xBinaryStreamResolver.set( pHelper.get() ); + m_xGraphicObjectResolver = pHelper; + m_xGraphicStorageHandler = pHelper; + m_xBinaryStreamResolver = pHelper; } // ____ XGraphicObjectResolver ____ diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index 9474a88860eb..c7160d414e40 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -151,22 +151,22 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > switch( meContext ) { case SvxXMLTableImportContextEnum::Color: - importColor( xFastList.get(), aAny, aName ); + importColor( xFastList, aAny, aName ); break; case SvxXMLTableImportContextEnum::Marker: - importMarker( xFastList.get(), aAny, aName ); + importMarker( xFastList, aAny, aName ); break; case SvxXMLTableImportContextEnum::Dash: - importDash( xFastList.get(), aAny, aName ); + importDash( xFastList, aAny, aName ); break; case SvxXMLTableImportContextEnum::Hatch: - importHatch( xFastList.get(), aAny, aName ); + importHatch( xFastList, aAny, aName ); break; case SvxXMLTableImportContextEnum::Gradient: - importGradient( xFastList.get(), aAny, aName ); + importGradient( xFastList, aAny, aName ); break; case SvxXMLTableImportContextEnum::Bitmap: - importBitmap( xFastList.get(), aAny, aName ); + importBitmap( xFastList, aAny, aName ); break; } |