summaryrefslogtreecommitdiff
path: root/svx/source/form
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-12 15:36:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-15 08:38:42 +0100
commit948c29710a0bb168ec07e3aca510fa6860f2da52 (patch)
tree6f65e78012a6a127c6efe2eaa9ba4ba57bc8302f /svx/source/form
parent881d8470eb9ede52690dbd75c02f72c6ee422261 (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/form')
-rw-r--r--svx/source/form/fmcontrollayout.cxx6
-rw-r--r--svx/source/form/fmdocumentclassification.cxx2
-rw-r--r--svx/source/form/fmobj.cxx2
-rw-r--r--svx/source/form/fmscriptingenv.cxx4
-rw-r--r--svx/source/form/fmshimp.cxx4
-rw-r--r--svx/source/form/fmsrcimp.cxx6
-rw-r--r--svx/source/form/fmundo.cxx15
-rw-r--r--svx/source/form/fmview.cxx4
-rw-r--r--svx/source/form/fmvwimp.cxx2
-rw-r--r--svx/source/form/formcontroller.cxx6
-rw-r--r--svx/source/form/navigatortree.cxx4
-rw-r--r--svx/source/form/navigatortreemodel.cxx14
-rw-r--r--svx/source/form/tabwin.cxx2
13 files changed, 35 insertions, 36 deletions
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));