summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-15 19:58:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-16 07:52:37 +0100
commit7767ff7b521b7d43a1ea2a4fd19a64bd171da5e0 (patch)
tree55ffa9447129048f87a52d61bbad124051406794 /forms
parent51558d2215a4cf881e357eda7da20688ac61e780 (diff)
loplugin:referencecasting in editeng..framework
Change-Id: Ia3375011ecd0a65afed0f131f477fc1542603fde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/Button.cxx4
-rw-r--r--forms/source/component/FormattedFieldWrapper.cxx9
-rw-r--r--forms/source/component/clickableimage.hxx2
-rw-r--r--forms/source/richtext/richtextcontrol.cxx4
-rw-r--r--forms/source/solar/component/navbarcontrol.cxx4
-rw-r--r--forms/source/xforms/datatyperepository.cxx2
-rw-r--r--forms/source/xforms/model.cxx10
7 files changed, 17 insertions, 18 deletions
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx
index 42592fa1f76e..a52a423398cf 100644
--- a/forms/source/component/Button.cxx
+++ b/forms/source/component/Button.cxx
@@ -142,7 +142,7 @@ void OButtonModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
_rxOutStream->writeShort(0x0003); // Version
{
- OStreamSection aSection( _rxOutStream.get() );
+ OStreamSection aSection( _rxOutStream );
// this will allow readers to skip unknown bytes in their dtor
_rxOutStream->writeShort( static_cast<sal_uInt16>(m_eButtonType) );
@@ -184,7 +184,7 @@ void OButtonModel::read(const Reference<XObjectInputStream>& _rxInStream)
case 0x0003:
{
- OStreamSection aSection( _rxInStream.get() );
+ OStreamSection aSection( _rxInStream );
// this will skip any unknown bytes in its dtor
// button type
diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx
index 02aab9b1a245..d169ff4eaade 100644
--- a/forms/source/component/FormattedFieldWrapper.cxx
+++ b/forms/source/component/FormattedFieldWrapper.cxx
@@ -100,7 +100,7 @@ Reference< XCloneable > SAL_CALL OFormattedFieldWrapper::createClone()
OSL_ENSURE(xRef->m_xAggregate.is(), "invalid aggregate cloned !");
xRef->m_xFormattedPart.set(
- Reference< XInterface >(xClone.get()), css::uno::UNO_QUERY);
+ Reference< XInterface >(xClone), css::uno::UNO_QUERY);
if ( m_pEditPart.is() )
{
@@ -116,7 +116,7 @@ Reference< XCloneable > SAL_CALL OFormattedFieldWrapper::createClone()
xRef->m_xAggregate->setDelegator(static_cast< XWeak* >(xRef.get()));
}
- return xRef.get();
+ return xRef;
}
OFormattedFieldWrapper::~OFormattedFieldWrapper()
@@ -219,8 +219,7 @@ void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream>
// for this we transfer the current props of the formatted part to the edit part
Reference<XPropertySet> xFormatProps(m_xFormattedPart, UNO_QUERY);
- Reference<XPropertySet> xEditProps(
- static_cast<XWeak*>(m_pEditPart.get()), css::uno::UNO_QUERY);
+ Reference<XPropertySet> xEditProps = m_pEditPart;
Locale aAppLanguage = Application::GetSettings().GetUILanguageTag().getLocale();
dbtools::TransferFormComponentProperties(xFormatProps, xEditProps, aAppLanguage);
@@ -285,7 +284,7 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>&
if (!pBasicReader->lastReadWasFormattedFake())
{
// yes -> all fine
- m_xAggregate.set( pBasicReader.get() );
+ m_xAggregate = pBasicReader;
}
else
{ // no -> substitute it with a formatted model
diff --git a/forms/source/component/clickableimage.hxx b/forms/source/component/clickableimage.hxx
index 329f2d5ab430..eea5ed827e7d 100644
--- a/forms/source/component/clickableimage.hxx
+++ b/forms/source/component/clickableimage.hxx
@@ -103,7 +103,7 @@ namespace frm
virtual void SAL_CALL disposing() override;
// css::form::XImageProducerSupplier
- virtual css::uno::Reference< css::awt::XImageProducer> SAL_CALL getImageProducer() override { return m_xProducer.get(); }
+ virtual css::uno::Reference< css::awt::XImageProducer> SAL_CALL getImageProducer() override { return m_xProducer; }
// OPropertySetHelper
virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle ) const override;
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index 88f62848063a..ad857d328685 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -190,7 +190,7 @@ namespace frm
if ( pPeer )
{
// announce the peer to the base class
- setPeer( pPeer.get() );
+ setPeer( pPeer );
// initialize ourself (and thus the peer) with the model properties
updateFromModel();
@@ -272,7 +272,7 @@ namespace frm
VclPtrInstance<RichTextControl> pRichTextControl( pEngine, _pParentWindow, _nStyle, nullptr, pPeer.get() );
// some knittings
- pRichTextControl->SetComponentInterface( pPeer.get() );
+ pRichTextControl->SetComponentInterface( pPeer );
// outta here
return pPeer;
diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx
index 1f27aebe2564..14e9c27ce74f 100644
--- a/forms/source/solar/component/navbarcontrol.cxx
+++ b/forms/source/solar/component/navbarcontrol.cxx
@@ -134,7 +134,7 @@ namespace frm
assert(pPeer && "ONavigationBarControl::createPeer: invalid peer returned!");
// announce the peer to the base class
- setPeer( pPeer.get() );
+ setPeer( pPeer );
// initialize ourself (and thus the peer) with the model properties
updateFromModel();
@@ -216,7 +216,7 @@ namespace frm
// some knittings
pNavBar->setDispatcher( pPeer.get() );
- pNavBar->SetComponentInterface( pPeer.get() );
+ pNavBar->SetComponentInterface( pPeer );
// we want a faster repeating rate for the slots in this
// toolbox
diff --git a/forms/source/xforms/datatyperepository.cxx b/forms/source/xforms/datatyperepository.cxx
index fdfbd138871a..bb0bf4a34135 100644
--- a/forms/source/xforms/datatyperepository.cxx
+++ b/forms/source/xforms/datatyperepository.cxx
@@ -154,7 +154,7 @@ namespace xforms
Reference< XDataType > SAL_CALL ODataTypeRepository::getDataType( const OUString& typeName )
{
::osl::MutexGuard aGuard( m_aMutex );
- return implLocate( typeName )->second.get();
+ return implLocate( typeName )->second;
}
diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx
index 6eed4d7d06ed..994a415bb8f4 100644
--- a/forms/source/xforms/model.cxx
+++ b/forms/source/xforms/model.cxx
@@ -464,7 +464,7 @@ css::uno::Reference<css::xforms::XDataTypeRepository> SAL_CALL Model::getDataTyp
css::uno::Reference<css::container::XSet> Model::getInstances()
{
- return mxInstances.get();
+ return mxInstances;
}
css::uno::Reference<css::xml::dom::XDocument> Model::getInstanceDocument( const OUString& rName )
@@ -514,7 +514,7 @@ css::uno::Reference<css::beans::XPropertySet> Model::getBinding( const OUString&
css::uno::Reference<css::container::XSet> Model::getBindings()
{
DBG_INVARIANT();
- return mxBindings.get();
+ return mxBindings;
}
@@ -531,8 +531,8 @@ css::uno::Reference<css::xforms::XSubmission> Model::cloneSubmission(const css::
{
DBG_INVARIANT();
css::uno::Reference<css::xforms::XSubmission> xNewSubmission = createSubmission();
- XPropertySet_t xAsPropertySet( xNewSubmission.get() );
- copy( xSubmission.get(), xAsPropertySet );
+ XPropertySet_t xAsPropertySet( xNewSubmission );
+ copy( xSubmission, xAsPropertySet );
return xNewSubmission;
}
@@ -548,7 +548,7 @@ css::uno::Reference<css::xforms::XSubmission> Model::getSubmission( const OUStri
css::uno::Reference<css::container::XSet> Model::getSubmissions()
{
DBG_INVARIANT();
- return mxSubmissions.get();
+ return mxSubmissions;
}