summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-12 15:35:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-15 08:37:47 +0100
commit0ae0b7ff575b4148f9c06abd3bac78d0881ec817 (patch)
tree5ded0fa7b49654d478423cbb21390c4cc88112c7 /sd/source
parent8ec3222d47ef5a13921576569a700785378916a8 (diff)
loplugin:referencecasting in sd
Change-Id: I3d5e0fd3f9d8ea61aad5846a0ee19568a5d365a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110817 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/core/annotations/Annotation.cxx12
-rw-r--r--sd/source/core/stlfamily.cxx2
-rw-r--r--sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx6
-rw-r--r--sd/source/ui/accessibility/AccessibleSlideSorterView.cxx6
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx4
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx2
-rw-r--r--sd/source/ui/framework/configuration/ResourceId.cxx2
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.cxx2
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx2
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx5
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx4
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx2
12 files changed, 23 insertions, 26 deletions
diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx
index 8831b3f337a8..7e9d4aff275a 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -298,7 +298,7 @@ uno::Reference<text::XText> SAL_CALL Annotation::getTextRange()
{
m_TextRange = TextApiObject::create( static_cast< SdDrawDocument* >( &mpPage->getSdrModelFromSdrPage() ) );
}
- return uno::Reference<text::XText>( m_TextRange.get() );
+ return m_TextRange;
}
std::unique_ptr<SdrUndoAction> CreateUndoInsertOrRemoveAnnotation( const uno::Reference<office::XAnnotation>& xAnnotation, bool bInsert )
@@ -423,7 +423,7 @@ void UndoInsertOrRemoveAnnotation::Undo()
if( !(pPage && pModel) )
return;
- uno::Reference<office::XAnnotation> xAnnotation( mxAnnotation.get() );
+ uno::Reference<office::XAnnotation> xAnnotation( mxAnnotation );
if( mbInsert )
{
pPage->removeAnnotation( xAnnotation );
@@ -442,7 +442,7 @@ void UndoInsertOrRemoveAnnotation::Redo()
if( !(pPage && pModel) )
return;
- uno::Reference<office::XAnnotation> xAnnotation( mxAnnotation.get() );
+ uno::Reference<office::XAnnotation> xAnnotation( mxAnnotation );
if( mbInsert )
{
@@ -466,16 +466,14 @@ void UndoAnnotation::Undo()
{
maRedoData.get( mxAnnotation );
maUndoData.set( mxAnnotation );
- uno::Reference<office::XAnnotation> xAnnotation( mxAnnotation.get() );
- LOKCommentNotifyAll( CommentNotificationType::Modify, xAnnotation );
+ LOKCommentNotifyAll( CommentNotificationType::Modify, mxAnnotation );
}
void UndoAnnotation::Redo()
{
maUndoData.get( mxAnnotation );
maRedoData.set( mxAnnotation );
- uno::Reference<office::XAnnotation> xAnnotation( mxAnnotation.get() );
- LOKCommentNotifyAll( CommentNotificationType::Modify, xAnnotation );
+ LOKCommentNotifyAll( CommentNotificationType::Modify, mxAnnotation );
}
} // namespace sd
diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx
index 0f03615c88f3..8e9150a292ef 100644
--- a/sd/source/core/stlfamily.cxx
+++ b/sd/source/core/stlfamily.cxx
@@ -350,7 +350,7 @@ Any SAL_CALL SdStyleFamily::getByIndex( sal_Int32 Index )
{
PresStyleMap::iterator iter( rStyleSheets.begin() );
std::advance(iter, Index);
- return Any( Reference< XStyle >( (*iter).second.get() ) );
+ return Any( Reference< XStyle >( (*iter).second ) );
}
}
else
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index ba7a546045d2..15f5c24dc963 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -114,7 +114,7 @@ void AccessibleDrawDocumentView::Init()
if (xPage.is())
{
xPage->Init();
- mpChildrenManager->AddAccessibleShape (xPage.get());
+ mpChildrenManager->AddAccessibleShape (xPage);
mpChildrenManager->Update ();
}
@@ -309,7 +309,7 @@ void SAL_CALL
if (xPage.is())
{
xPage->Init();
- mpChildrenManager->AddAccessibleShape (xPage.get());
+ mpChildrenManager->AddAccessibleShape (xPage);
mpChildrenManager->Update (false);
}
}
@@ -358,7 +358,7 @@ void SAL_CALL
if (xPage.is())
{
xPage->Init();
- mpChildrenManager->AddAccessibleShape (xPage.get());
+ mpChildrenManager->AddAccessibleShape (xPage);
mpChildrenManager->Update (false);
}
}
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index b35c1a57e6f0..ee663f2fbb1a 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -699,10 +699,10 @@ void AccessibleSlideSorterView::Implementation::Clear()
{
mrAccessibleSlideSorter.FireAccessibleEvent(
AccessibleEventId::CHILD,
- Any(Reference<XAccessible>(rxPageObject.get())),
+ Any(Reference<XAccessible>(rxPageObject)),
Any());
- Reference<XComponent> xComponent (Reference<XWeak>(rxPageObject.get()), UNO_QUERY);
+ Reference<XComponent> xComponent (Reference<XWeak>(rxPageObject), UNO_QUERY);
if (xComponent.is())
xComponent->dispose();
rxPageObject = nullptr;
@@ -747,7 +747,7 @@ AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAcces
mrAccessibleSlideSorter.FireAccessibleEvent(
AccessibleEventId::CHILD,
Any(),
- Any(Reference<XAccessible>(maPageObjects[nIndex].get())));
+ Any(Reference<XAccessible>(maPageObjects[nIndex])));
}
}
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 7bb4a0857968..ce004490037a 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -867,7 +867,7 @@ void AnnotationManagerImpl::SelectAnnotation( const css::uno::Reference< css::of
[&xAnnotation](const rtl::Reference<AnnotationTag>& rxTag) { return rxTag->GetAnnotation() == xAnnotation; });
if (iter != maTagVector.end())
{
- SmartTagReference xTag( (*iter).get() );
+ SmartTagReference xTag( *iter );
mrBase.GetMainViewShell()->GetView()->getSmartTags().select( xTag );
(*iter)->OpenPopup( bEdit );
}
@@ -974,7 +974,7 @@ void AnnotationManagerImpl::CreateTags()
if( xSelectedTag.is() )
{
- SmartTagReference xTag( xSelectedTag.get() );
+ SmartTagReference xTag( xSelectedTag );
mrBase.GetMainViewShell()->GetView()->getSmartTags().select( xTag );
}
else
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 98542f75cdfa..992fb8e29cf2 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -747,7 +747,7 @@ void SdPageObjsTLV::Select()
// object is destroyed by internal reference mechanism
m_xHelper.set(new SdPageObjsTLV::SdPageObjsTransferable(aBookmark, *pDocShell, eDragType));
- rtl::Reference<TransferDataContainer> xHelper(m_xHelper.get());
+ rtl::Reference<TransferDataContainer> xHelper(m_xHelper);
m_xTreeView->enable_drag_source(xHelper, nDNDActions);
}
diff --git a/sd/source/ui/framework/configuration/ResourceId.cxx b/sd/source/ui/framework/configuration/ResourceId.cxx
index e851e2a260dc..981e4105a607 100644
--- a/sd/source/ui/framework/configuration/ResourceId.cxx
+++ b/sd/source/ui/framework/configuration/ResourceId.cxx
@@ -152,7 +152,7 @@ Reference<XResourceId> SAL_CALL
for (sal_Int32 nIndex=0; nIndex<nAnchorCount; ++nIndex)
rResourceId->maResourceURLs[nIndex] = maResourceURLs[nIndex+1];
}
- return Reference<XResourceId>(rResourceId.get());
+ return rResourceId;
}
Sequence<OUString> SAL_CALL
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 7cf3a0d94059..52505b8fab0b 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -298,7 +298,7 @@ std::shared_ptr<BasicViewFactory::ViewDescriptor> BasicViewFactory::CreateView (
// register ViewShellWrapper on pane window
if (xWindow.is())
{
- xWindow->addWindowListener(wrapper.get());
+ xWindow->addWindowListener(wrapper);
if (pDescriptor->mpViewShell != nullptr)
{
pDescriptor->mpViewShell->Resize();
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 8c6f702d6f3c..362e80795e5f 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -381,7 +381,7 @@ bool FrameworkHelper::IsValid() const
::std::shared_ptr<ViewShell> FrameworkHelper::GetViewShell (const Reference<XView>& rxView)
{
- return lcl_getViewShell( rxView.get() );
+ return lcl_getViewShell( rxView );
}
Reference<XView> FrameworkHelper::GetView (const Reference<XResourceId>& rxPaneOrViewId)
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index cd10ad249eed..8873162436be 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -882,8 +882,7 @@ Reference< XSlideShowController > SAL_CALL SlideShow::getController( )
{
ThrowIfDisposed();
- Reference< XSlideShowController > xController( mxController.get() );
- return xController;
+ return mxController;
}
// XComponent
@@ -1195,7 +1194,7 @@ bool SlideShow::dependsOn( ViewShellBase const * pViewShellBase )
Reference< presentation::XPresentation2 > CreatePresentation( const SdDrawDocument& rDocument )
{
- return Reference< presentation::XPresentation2 >( SlideShow::Create( const_cast< SdDrawDocument* >( &rDocument ) ).get() );
+ return Reference< presentation::XPresentation2 >( SlideShow::Create( const_cast< SdDrawDocument* >( &rDocument ) ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 41c331644ac2..df7f530f4fea 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -604,7 +604,7 @@ void SAL_CALL SlideshowImpl::disposing()
try
{
if( mxView.is() )
- mxShow->removeView( mxView.get() );
+ mxShow->removeView( mxView );
Reference< XComponent > xComponent( mxShow, UNO_QUERY );
if( xComponent.is() )
@@ -1078,7 +1078,7 @@ bool SlideshowImpl::startShowImpl( const Sequence< beans::PropertyValue >& aProp
for( const auto& rProp : aProperties )
mxShow->setProperty( rProp );
- mxShow->addView( mxView.get() );
+ mxShow->addView( mxView );
mxListenerProxy.set( new SlideShowListenerProxy( this, mxShow ) );
mxListenerProxy->addAsSlideShowListener();
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 35b1c376940c..f3e965c0d91f 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -763,7 +763,7 @@ uno::Reference< presentation::XPresentation > SAL_CALL SdXImpressDocument::getPr
if( nullptr == mpDoc )
throw lang::DisposedException();
- return uno::Reference< presentation::XPresentation >( mpDoc->getPresentation().get() );
+ return mpDoc->getPresentation();
}
// XHandoutMasterSupplier