summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-02-23 21:06:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-25 08:37:17 +0100
commitb7a1e92a27bc26f222526eb50ab80c0e6966be7a (patch)
tree4f3825cc2f483e4576d1e3849a759b73fdc969f9 /chart2/source
parente6b9bc3f2ecf0fb7fde5b02f9d750ccbe022f4c1 (diff)
loplugin:referencecasting
getting --enable-pch=normal working with clang means that the plugins now have a better view on some stuff, so trigger more warnings Change-Id: I83ca010c0ef07c8106068362bb50a354e3cf7dae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89312 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/chartapiwrapper/TitleWrapper.cxx3
-rw-r--r--chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx9
-rw-r--r--chart2/source/controller/main/ObjectHierarchy.cxx9
-rw-r--r--chart2/source/tools/ChartViewHelper.cxx2
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx3
5 files changed, 15 insertions, 11 deletions
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index cffd22e4d56b..c74045752aa2 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <CharacterProperties.hxx>
@@ -195,7 +196,7 @@ TitleWrapper::TitleWrapper( ::chart::TitleHelper::eTitleType eTitleType,
m_aEventListenerContainer( m_aMutex ),
m_eTitleType(eTitleType)
{
- ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChart2Document() );
if( !getTitleObject().is() ) //#i83831# create an empty title at the model, thus references to properties can be mapped correctly
TitleHelper::createTitle( m_eTitleType, OUString(), m_spChart2ModelContact->getChartModel(), m_spChart2ModelContact->m_xContext );
}
diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
index b2042a6468b9..b191f2a42468 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
@@ -24,6 +24,7 @@
#include <AxisHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
namespace chart
{
@@ -39,7 +40,7 @@ TitlesAndObjectsTabPage::TitlesAndObjectsTabPage(weld::Container* pPage, weld::D
, m_xChartModel(xChartModel)
, m_xCC(xContext)
, m_bCommitToModel(true)
- , m_aTimerTriggeredControllerLock( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY ) )
+ , m_aTimerTriggeredControllerLock( m_xChartModel )
, m_xCB_Grid_X(m_xBuilder->weld_check_button("x"))
, m_xCB_Grid_Y(m_xBuilder->weld_check_button("y"))
, m_xCB_Grid_Z(m_xBuilder->weld_check_button("z"))
@@ -63,13 +64,13 @@ void TitlesAndObjectsTabPage::initializePage()
//init titles
{
TitleDialogData aTitleInput;
- aTitleInput.readFromModel( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY) );
+ aTitleInput.readFromModel( m_xChartModel );
m_xTitleResources->writeToResources( aTitleInput );
}
//init legend
{
- m_xLegendPositionResources->writeToResources( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY) );
+ m_xLegendPositionResources->writeToResources( m_xChartModel );
}
//init grid checkboxes
@@ -100,7 +101,7 @@ bool TitlesAndObjectsTabPage::commitPage( ::vcl::WizardTypes::CommitPageReason /
void TitlesAndObjectsTabPage::commitToModel()
{
m_aTimerTriggeredControllerLock.startTimer();
- uno::Reference< frame::XModel > xModel( m_xChartModel, uno::UNO_QUERY);
+ uno::Reference< frame::XModel > xModel = m_xChartModel;
ControllerLockGuardUNO aLockedControllers( xModel );
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 2096ab4d6cce..27b8fb0fe985 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
@@ -61,7 +62,7 @@ namespace
struct lcl_ObjectToOID
{
explicit lcl_ObjectToOID( const Reference< chart2::XChartDocument > & xChartDoc ) :
- m_xModel( xChartDoc, uno::UNO_QUERY )
+ m_xModel( xChartDoc )
{}
::chart::ObjectIdentifier operator() ( const Reference< uno::XInterface > & xObj )
@@ -192,7 +193,7 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument >& xChartD
return;
//@todo: change ObjectIdentifier to take an XChartDocument rather than XModel
- Reference< frame::XModel > xModel( xChartDocument, uno::UNO_QUERY );
+ Reference< frame::XModel > xModel = xChartDocument;
Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartDocument ) );
ObjectIdentifier aDiaOID;
if( xDiagram.is() )
@@ -279,7 +280,7 @@ void ImplObjectHierarchy::createLegendTree(
{
if( xDiagram.is() && LegendHelper::hasLegend( xDiagram ) )
{
- ObjectIdentifier aLegendOID( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram->getLegend(), Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ) ) ) );
+ ObjectIdentifier aLegendOID( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram->getLegend(), xChartDoc ) ) );
rContainer.push_back( aLegendOID );
// iterate over child shapes of legend and search for matching CIDs
@@ -315,7 +316,7 @@ void ImplObjectHierarchy::createAxesTree(
// get all axes, also invisible ones
aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
// Grids
- Reference< frame::XModel > xChartModel( xChartDoc, uno::UNO_QUERY );
+ Reference< frame::XModel > xChartModel = xChartDoc;
for( sal_Int32 nA=0; nA<aAxes.getLength(); ++nA )
{
Reference< XAxis > xAxis( aAxes[nA] );
diff --git a/chart2/source/tools/ChartViewHelper.cxx b/chart2/source/tools/ChartViewHelper.cxx
index 0e8332b71750..872960f17e41 100644
--- a/chart2/source/tools/ChartViewHelper.cxx
+++ b/chart2/source/tools/ChartViewHelper.cxx
@@ -41,7 +41,7 @@ void ChartViewHelper::setViewToDirtyState( const uno::Reference< frame::XModel >
xFact->createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
if( xModifyListener.is() )
{
- lang::EventObject aEvent( Reference< lang::XComponent >( xChartModel, uno::UNO_QUERY ) );
+ lang::EventObject aEvent( xChartModel );
xModifyListener->modified( aEvent );
}
}
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index f6219c650151..1ec43352b8b6 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XShapes2.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
@@ -2524,7 +2525,7 @@ uno::Reference< drawing::XShapes > ShapeFactory::getChartRootShape(
const uno::Reference< drawing::XDrawPage>& xDrawPage )
{
uno::Reference< drawing::XShapes > xRet;
- uno::Reference< drawing::XShapes > xShapes( xDrawPage, uno::UNO_QUERY );
+ const uno::Reference< drawing::XShapes > xShapes = xDrawPage;
if( xShapes.is() )
{
sal_Int32 nCount = xShapes->getCount();