sd/source/console/PresenterAccessibility.cxx | 5 +-- sd/source/console/PresenterController.cxx | 6 +--- sd/source/console/PresenterHelpView.cxx | 3 -- sd/source/console/PresenterNotesView.cxx | 5 +-- sd/source/console/PresenterSlideSorter.cxx | 6 +--- sd/source/console/PresenterToolBar.cxx | 14 ++-------- sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 5 +-- sd/source/ui/unoidl/unolayer.cxx | 4 +- sd/source/ui/unoidl/unoobj.cxx | 2 - 9 files changed, 18 insertions(+), 32 deletions(-)
New commits: commit 30306fd300c876e46cf41509656187624c50222e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Feb 25 13:10:40 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Feb 25 15:17:41 2025 +0100 use more concrete UNO types in some local vars found by a little plugin I created. Change-Id: Ib048d80abed89da2ff3876c526c1fb48aded1546 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182160 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/console/PresenterAccessibility.cxx b/sd/source/console/PresenterAccessibility.cxx index 91c5f950bb31..346aa882b25e 100644 --- a/sd/source/console/PresenterAccessibility.cxx +++ b/sd/source/console/PresenterAccessibility.cxx @@ -1630,9 +1630,8 @@ void AccessibleNotes::SetTextView ( // manager). for (const auto& rxChild : aChildren) { - Reference<lang::XComponent> xComponent = rxChild; - if (xComponent.is()) - xComponent->dispose(); + if (rxChild.is()) + rxChild->dispose(); } // This class acts as a controller of who broadcasts caret motion diff --git a/sd/source/console/PresenterController.cxx b/sd/source/console/PresenterController.cxx index 0fb92196c760..53729505e5ad 100644 --- a/sd/source/console/PresenterController.cxx +++ b/sd/source/console/PresenterController.cxx @@ -201,8 +201,7 @@ void PresenterController::disposing() mxController = nullptr; } - Reference<XComponent> xWindowManagerComponent = mpWindowManager; - mpWindowManager = nullptr; + rtl::Reference<PresenterWindowManager> xWindowManagerComponent = std::move(mpWindowManager); if (xWindowManagerComponent.is()) xWindowManagerComponent->dispose(); @@ -216,8 +215,7 @@ void PresenterController::disposing() mxNextSlide = nullptr; mpTheme.reset(); { - Reference<lang::XComponent> xComponent = mpPaneBorderPainter; - mpPaneBorderPainter = nullptr; + rtl::Reference<PresenterPaneBorderPainter> xComponent = std::move(mpPaneBorderPainter); if (xComponent.is()) xComponent->dispose(); } diff --git a/sd/source/console/PresenterHelpView.cxx b/sd/source/console/PresenterHelpView.cxx index 5cebec372926..1ad579007552 100644 --- a/sd/source/console/PresenterHelpView.cxx +++ b/sd/source/console/PresenterHelpView.cxx @@ -186,8 +186,7 @@ void SAL_CALL PresenterHelpView::disposing() if (mpCloseButton.is()) { - Reference<lang::XComponent> xComponent = mpCloseButton; - mpCloseButton = nullptr; + rtl::Reference<PresenterButton> xComponent = std::move(mpCloseButton); if (xComponent.is()) xComponent->dispose(); } diff --git a/sd/source/console/PresenterNotesView.cxx b/sd/source/console/PresenterNotesView.cxx index 6fcbc29c7190..f82fd1106564 100644 --- a/sd/source/console/PresenterNotesView.cxx +++ b/sd/source/console/PresenterNotesView.cxx @@ -133,8 +133,7 @@ void SAL_CALL PresenterNotesView::disposing() // Dispose tool bar. { - Reference<XComponent> xComponent = mpToolBar; - mpToolBar = nullptr; + rtl::Reference<PresenterToolBar> xComponent = std::move(mpToolBar); if (xComponent.is()) xComponent->dispose(); } @@ -153,7 +152,7 @@ void SAL_CALL PresenterNotesView::disposing() // Dispose close button { - Reference<XComponent> xComponent = mpCloseButton; + rtl::Reference<XComponent> xComponent = mpCloseButton; mpCloseButton = nullptr; if (xComponent.is()) xComponent->dispose(); diff --git a/sd/source/console/PresenterSlideSorter.cxx b/sd/source/console/PresenterSlideSorter.cxx index f2d921e03df8..aa81f3ff1377 100644 --- a/sd/source/console/PresenterSlideSorter.cxx +++ b/sd/source/console/PresenterSlideSorter.cxx @@ -350,15 +350,13 @@ void SAL_CALL PresenterSlideSorter::disposing() if (mpVerticalScrollBar.is()) { - Reference<lang::XComponent> xComponent = mpVerticalScrollBar; - mpVerticalScrollBar = nullptr; + rtl::Reference<PresenterScrollBar> xComponent = std::move(mpVerticalScrollBar); if (xComponent.is()) xComponent->dispose(); } if (mpCloseButton.is()) { - Reference<lang::XComponent> xComponent = mpCloseButton; - mpCloseButton = nullptr; + rtl::Reference<PresenterButton> xComponent = std::move(mpCloseButton); if (xComponent.is()) xComponent->dispose(); } diff --git a/sd/source/console/PresenterToolBar.cxx b/sd/source/console/PresenterToolBar.cxx index 825bfbe31224..7d64f74155a2 100644 --- a/sd/source/console/PresenterToolBar.cxx +++ b/sd/source/console/PresenterToolBar.cxx @@ -419,11 +419,7 @@ void SAL_CALL PresenterToolBar::disposing() for (const rtl::Reference<Element>& pElement : *rxPart) { if (pElement) - { - Reference<lang::XComponent> xComponent = pElement; - if (xComponent.is()) - xComponent->dispose(); - } + pElement->dispose(); } } @@ -1053,8 +1049,7 @@ PresenterToolBarView::~PresenterToolBarView() void SAL_CALL PresenterToolBarView::disposing() { - Reference<lang::XComponent> xComponent = mpToolBar; - mpToolBar = nullptr; + rtl::Reference<PresenterToolBar> xComponent = std::move(mpToolBar); if (xComponent.is()) xComponent->dispose(); @@ -1111,9 +1106,8 @@ sal_Bool SAL_CALL PresenterToolBarView::isAnchorOnly() void SAL_CALL PresenterToolBarView::setCurrentPage (const Reference<drawing::XDrawPage>& rxSlide) { - Reference<drawing::XDrawView> xToolBar = mpToolBar; - if (xToolBar.is()) - xToolBar->setCurrentPage(rxSlide); + if (mpToolBar.is()) + mpToolBar->setCurrentPage(rxSlide); } Reference<drawing::XDrawPage> SAL_CALL PresenterToolBarView::getCurrentPage() diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index ff048fa0bc1f..602e20f052a5 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -140,9 +140,8 @@ SlideSorterController::~SlideSorterController() { try { - uno::Reference<lang::XComponent> xComponent = mpListener; - if (xComponent.is()) - xComponent->dispose(); + if (mpListener.is()) + mpListener->dispose(); } catch( uno::Exception& ) { diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index abc5bf309052..5638f973b74a 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -542,8 +542,8 @@ uno::Any SAL_CALL SdLayerManager::getByIndex( sal_Int32 nLayer ) if( mpModel->mpDoc ) { SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin(); - uno::Reference<drawing::XLayer> xLayer (GetLayer (rLayerAdmin.GetLayer(static_cast<sal_uInt16>(nLayer)))); - aAny <<= xLayer; + rtl::Reference<SdLayer> xLayer (GetLayer (rLayerAdmin.GetLayer(static_cast<sal_uInt16>(nLayer)))); + aAny <<= uno::Reference<drawing::XLayer>(xLayer); } return aAny; } diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 49633f61bc30..48c0b10b28af 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -387,7 +387,7 @@ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL SdXShape::getProper SdExtPropertySetInfoCache::iterator aIter( rCache.find( nObjId ) ); if( aIter == rCache.end() ) { - uno::Reference< beans::XPropertySetInfo > xInfo( mpShape->_getPropertySetInfo() ); + rtl::Reference< SfxItemPropertySetInfo > xInfo( mpShape->_getPropertySetInfo() ); pInfo = new SfxExtItemPropertySetInfo( mpMap, xInfo->getProperties() ); rCache.insert(std::make_pair(nObjId, pInfo));