loplugin:referencecasting in reportdesign

Change-Id: I911bfc95f479d130052a51143dd3073287853a8f
Reviewed-on: https://gerrit.libreoffice.org/75975
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 600dd78..f4994d4 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1840,7 +1840,7 @@ uno::Reference< container::XIndexAccess > SAL_CALL OReportDefinition::getViewDat
    ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
    if ( !m_pImpl->m_xViewData.is() )
    {
        m_pImpl->m_xViewData.set( document::IndexedPropertyValues::create(m_aProps->m_xContext), uno::UNO_QUERY);
        m_pImpl->m_xViewData = document::IndexedPropertyValues::create(m_aProps->m_xContext);
        uno::Reference< container::XIndexContainer > xContainer(m_pImpl->m_xViewData,uno::UNO_QUERY);
        for (const auto& rxController : m_pImpl->m_aControllers)
        {
@@ -1907,7 +1907,7 @@ uno::Sequence< OUString > SAL_CALL OReportDefinition::getDocumentSubStoragesName
{
    ::osl::MutexGuard aGuard(m_aMutex);
    ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
    uno::Reference<container::XNameAccess> xNameAccess(m_pImpl->m_xStorage,uno::UNO_QUERY);
    uno::Reference<container::XNameAccess> xNameAccess = m_pImpl->m_xStorage;
    return xNameAccess.is() ? xNameAccess->getElementNames() : uno::Sequence< OUString >();
}

diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx
index 3c712d8..2945729 100644
--- a/reportdesign/source/core/api/ReportEngineJFree.cxx
+++ b/reportdesign/source/core/api/ReportEngineJFree.cxx
@@ -275,7 +275,7 @@ uno::Reference< frame::XModel > OReportEngineJFree::createDocumentAlive( const u
        if ( !xFrameLoad.is() )
        {
            // if there is no frame given, find the right
            xFrameLoad.set( frame::Desktop::create(m_xContext), uno::UNO_QUERY);
            xFrameLoad = frame::Desktop::create(m_xContext);
            sal_Int32 const nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
            uno::Reference< frame::XFrame> xFrame = uno::Reference< frame::XFrame>(xFrameLoad,uno::UNO_QUERY_THROW)->findFrame("_blank",nFrameSearchFlag);
            xFrameLoad.set( xFrame,uno::UNO_QUERY);
diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx
index 15910df..00027a5 100644
--- a/reportdesign/source/core/sdr/ReportDrawPage.cxx
+++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx
@@ -90,7 +90,7 @@ uno::Reference< drawing::XShape >  OReportDrawPage::CreateShape( SdrObject *pObj
            else
                bChangeOrientation = rUnoObj.GetObjIdentifier() == OBJ_DLG_HFIXEDLINE;
            SvxShapeControl* pShape = new SvxShapeControl( pObj );
            xShape.set(static_cast<cppu::OWeakObject*>(static_cast<SvxShape_UnoImplHelper *>(pShape)),uno::UNO_QUERY);
            xShape = static_cast<SvxShape_UnoImplHelper *>(pShape);
            pShape->setShapeKind(pObj->GetObjIdentifier());
        }
        else if (dynamic_cast< const OCustomShape* >(pObj) != nullptr)
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index bbfc0e4..7a77b21 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -568,7 +568,7 @@ bool OCustomShape::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)

uno::Reference< beans::XPropertySet> OCustomShape::getAwtComponent()
{
    return uno::Reference< beans::XPropertySet>(m_xReportComponent,uno::UNO_QUERY);
    return m_xReportComponent;
}


@@ -1072,7 +1072,7 @@ bool OOle2Obj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)

uno::Reference< beans::XPropertySet> OOle2Obj::getAwtComponent()
{
    return uno::Reference< beans::XPropertySet>(m_xReportComponent,uno::UNO_QUERY);
    return m_xReportComponent;
}


diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 5e97042e..0f5f539 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -425,7 +425,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor )

    if ( !sFileName.isEmpty() )
    {
        uno::Reference<XComponent> xCom(GetModel(),UNO_QUERY);
        uno::Reference<XComponent> xCom = GetModel();

        tools::SvRef<SfxMedium> pMedium = new SfxMedium(
                sFileName, ( StreamMode::READ | StreamMode::NOCREATE ) );
@@ -489,7 +489,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
        const OUString sHierarchicalDocumentName( aDescriptor.getUnpackedValueOrDefault("HierarchicalDocumentName",OUString()) );
        xProp->setPropertyValue("StreamRelPath", uno::makeAny(sHierarchicalDocumentName));

        uno::Reference<XComponent> xModel(GetModel(),UNO_QUERY);
        uno::Reference<XComponent> xModel = GetModel();
        static const char s_sMeta[] = "meta.xml";
        static const char s_sStreamName[] = "StreamName";
        xProp->setPropertyValue(s_sStreamName, uno::makeAny(OUString(s_sMeta)));
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 746c9de..6dc2125 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -1768,7 +1768,7 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(OUS
    const uno::Reference< report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
    if ( m_sScope.isEmpty() )
    {
        const uno::Reference< report::XGroup> xGroup(xSection->getGroup(),uno::UNO_QUERY);
        const uno::Reference< report::XGroup> xGroup = xSection->getGroup();
        if ( xGroup.is() )
        {
            OUString sGroupName = RptResId(RID_STR_SCOPE_GROUP);
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index b2083a9..47afcfe6 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1263,7 +1263,7 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe
                        if ( (pColIter+1) != pColEnd )
                        {
                            // bring aNewPos to the position of the next object
                            uno::Reference< report::XReportComponent> xRCNext(*(pColIter + 1),uno::UNO_QUERY);
                            uno::Reference< report::XReportComponent> xRCNext = *(pColIter + 1);
                            Point aNextPosition = VCLPoint(xRCNext->getPosition());
                            aNewPos += aNextPosition - aPrevious;
                        }