summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-08-23 10:15:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-23 15:25:26 +0200
commit8a54339fc83fe9abaaace6f9f374697e6923d684 (patch)
tree516e82bb9eca2d586aa7acebbe369f67ff707a7f /sdext
parentd34f1df73806e9ca05fa0d07da619e2c0f01b6f7 (diff)
loplugin:referencecasting look through more clang Types
Note that because of where the fix resides, loplugin:redundantcast also notices a few more things. Change-Id: I0b66047fadfff2c5ceafcbd3eab085de00d861a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120865 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/presenter/PresenterAccessibility.cxx2
-rw-r--r--sdext/source/presenter/PresenterController.cxx6
-rw-r--r--sdext/source/presenter/PresenterHelpView.cxx3
-rw-r--r--sdext/source/presenter/PresenterNotesView.cxx4
-rw-r--r--sdext/source/presenter/PresenterPaneFactory.cxx6
-rw-r--r--sdext/source/presenter/PresenterScreen.cxx6
-rw-r--r--sdext/source/presenter/PresenterSlideSorter.cxx6
-rw-r--r--sdext/source/presenter/PresenterToolBar.cxx7
-rw-r--r--sdext/source/presenter/PresenterViewFactory.cxx3
9 files changed, 16 insertions, 27 deletions
diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx
index c57cf61c946c..677cdfdc4037 100644
--- a/sdext/source/presenter/PresenterAccessibility.cxx
+++ b/sdext/source/presenter/PresenterAccessibility.cxx
@@ -1727,7 +1727,7 @@ void AccessibleNotes::SetTextView (
// manager).
for (const auto& rxChild : aChildren)
{
- Reference<lang::XComponent> xComponent (static_cast<XWeak*>(rxChild.get()), UNO_QUERY);
+ Reference<lang::XComponent> xComponent = rxChild;
if (xComponent.is())
xComponent->dispose();
}
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index 86b57ca73794..9aa5af7b2201 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -212,8 +212,7 @@ void PresenterController::disposing()
mxController = nullptr;
}
- Reference<XComponent> xWindowManagerComponent (
- static_cast<XWeak*>(mpWindowManager.get()), UNO_QUERY);
+ Reference<XComponent> xWindowManagerComponent = mpWindowManager;
mpWindowManager = nullptr;
if (xWindowManagerComponent.is())
xWindowManagerComponent->dispose();
@@ -228,8 +227,7 @@ void PresenterController::disposing()
mxNextSlide = nullptr;
mpTheme.reset();
{
- Reference<lang::XComponent> xComponent (
- static_cast<XWeak*>(mpPaneBorderPainter.get()), UNO_QUERY);
+ Reference<lang::XComponent> xComponent = mpPaneBorderPainter;
mpPaneBorderPainter = nullptr;
if (xComponent.is())
xComponent->dispose();
diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx
index d6b625e53183..e5bec81efc92 100644
--- a/sdext/source/presenter/PresenterHelpView.cxx
+++ b/sdext/source/presenter/PresenterHelpView.cxx
@@ -192,8 +192,7 @@ void SAL_CALL PresenterHelpView::disposing()
if (mpCloseButton.is())
{
- Reference<lang::XComponent> xComponent (
- static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY);
+ Reference<lang::XComponent> xComponent = mpCloseButton;
mpCloseButton = nullptr;
if (xComponent.is())
xComponent->dispose();
diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx
index ad43f035b041..787f6624eb60 100644
--- a/sdext/source/presenter/PresenterNotesView.cxx
+++ b/sdext/source/presenter/PresenterNotesView.cxx
@@ -145,7 +145,7 @@ void SAL_CALL PresenterNotesView::disposing()
// Dispose tool bar.
{
- Reference<XComponent> xComponent (static_cast<XWeak*>(mpToolBar.get()), UNO_QUERY);
+ Reference<XComponent> xComponent = mpToolBar;
mpToolBar = nullptr;
if (xComponent.is())
xComponent->dispose();
@@ -165,7 +165,7 @@ void SAL_CALL PresenterNotesView::disposing()
// Dispose close button
{
- Reference<XComponent> xComponent (static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY);
+ Reference<XComponent> xComponent = mpCloseButton;
mpCloseButton = nullptr;
if (xComponent.is())
xComponent->dispose();
diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx
index a9c5bb907f25..dd4eb2fa9b8e 100644
--- a/sdext/source/presenter/PresenterPaneFactory.cxx
+++ b/sdext/source/presenter/PresenterPaneFactory.cxx
@@ -43,8 +43,7 @@ Reference<drawing::framework::XResourceFactory> PresenterPaneFactory::Create (
rtl::Reference<PresenterPaneFactory> pFactory (
new PresenterPaneFactory(rxContext,rpPresenterController));
pFactory->Register(rxController);
- return Reference<drawing::framework::XResourceFactory>(
- static_cast<XWeak*>(pFactory.get()), UNO_QUERY);
+ return Reference<drawing::framework::XResourceFactory>(pFactory);
}
PresenterPaneFactory::PresenterPaneFactory (
@@ -250,8 +249,7 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
aArguments[2] <<= rxParentPane->getCanvas();
aArguments[3] <<= OUString();
aArguments[4] <<= Reference<drawing::framework::XPaneBorderPainter>(
- static_cast<XWeak*>(mpPresenterController->GetPaneBorderPainter().get()),
- UNO_QUERY);
+ mpPresenterController->GetPaneBorderPainter());
aArguments[5] <<= !bIsSpritePane;
xPane->initialize(aArguments);
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index c624adcdf614..594e6ce17287 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -175,8 +175,7 @@ PresenterScreenListener::PresenterScreenListener (
void PresenterScreenListener::Initialize()
{
- Reference< document::XEventListener > xDocListener(
- static_cast< document::XEventListener* >(this), UNO_QUERY);
+ Reference< document::XEventListener > xDocListener(this);
Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
if( xDocBroadcaster.is() )
xDocBroadcaster->addEventListener(xDocListener);
@@ -187,8 +186,7 @@ void SAL_CALL PresenterScreenListener::disposing()
Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
if( xDocBroadcaster.is() )
xDocBroadcaster->removeEventListener(
- Reference<document::XEventListener>(
- static_cast<document::XEventListener*>(this), UNO_QUERY));
+ Reference<document::XEventListener>(this) );
if (mpPresenterScreen.is())
{
diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx
index c06c0dfd79ec..dcb00b60bdda 100644
--- a/sdext/source/presenter/PresenterSlideSorter.cxx
+++ b/sdext/source/presenter/PresenterSlideSorter.cxx
@@ -362,16 +362,14 @@ void SAL_CALL PresenterSlideSorter::disposing()
if (mpVerticalScrollBar.is())
{
- Reference<lang::XComponent> xComponent (
- static_cast<XWeak*>(mpVerticalScrollBar.get()), UNO_QUERY);
+ Reference<lang::XComponent> xComponent = mpVerticalScrollBar;
mpVerticalScrollBar = nullptr;
if (xComponent.is())
xComponent->dispose();
}
if (mpCloseButton.is())
{
- Reference<lang::XComponent> xComponent (
- static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY);
+ Reference<lang::XComponent> xComponent = mpCloseButton;
mpCloseButton = nullptr;
if (xComponent.is())
xComponent->dispose();
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index c3236235c5b0..1a06c70db16c 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -424,8 +424,7 @@ void SAL_CALL PresenterToolBar::disposing()
{
if (pElement)
{
- Reference<lang::XComponent> xComponent (
- static_cast<XWeak*>(pElement.get()), UNO_QUERY);
+ Reference<lang::XComponent> xComponent = pElement;
if (xComponent.is())
xComponent->dispose();
}
@@ -1063,7 +1062,7 @@ PresenterToolBarView::~PresenterToolBarView()
void SAL_CALL PresenterToolBarView::disposing()
{
- Reference<lang::XComponent> xComponent (static_cast<XWeak*>(mpToolBar.get()), UNO_QUERY);
+ Reference<lang::XComponent> xComponent = mpToolBar;
mpToolBar = nullptr;
if (xComponent.is())
xComponent->dispose();
@@ -1121,7 +1120,7 @@ sal_Bool SAL_CALL PresenterToolBarView::isAnchorOnly()
void SAL_CALL PresenterToolBarView::setCurrentPage (const Reference<drawing::XDrawPage>& rxSlide)
{
- Reference<drawing::XDrawView> xToolBar (static_cast<XWeak*>(mpToolBar.get()), UNO_QUERY);
+ Reference<drawing::XDrawView> xToolBar = mpToolBar;
if (xToolBar.is())
xToolBar->setCurrentPage(rxSlide);
}
diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx
index 01b40d6e2ab8..87759f7fe9b3 100644
--- a/sdext/source/presenter/PresenterViewFactory.cxx
+++ b/sdext/source/presenter/PresenterViewFactory.cxx
@@ -112,8 +112,7 @@ Reference<drawing::framework::XResourceFactory> PresenterViewFactory::Create (
rtl::Reference<PresenterViewFactory> pFactory (
new PresenterViewFactory(rxContext,rxController,rpPresenterController));
pFactory->Register(rxController);
- return Reference<drawing::framework::XResourceFactory>(
- static_cast<XWeak*>(pFactory.get()), UNO_QUERY);
+ return Reference<drawing::framework::XResourceFactory>(pFactory);
}
void PresenterViewFactory::Register (const Reference<frame::XController>& rxController)