summaryrefslogtreecommitdiff
path: root/chart2/source/controller/chartapiwrapper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-19 09:50:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-19 11:31:51 +0200
commit836c40904f4424a5b7ae708171a7aab53141761a (patch)
tree5f84c7b9d57aface755ef6f4b11ccc1deb1da9c6 /chart2/source/controller/chartapiwrapper
parent4959b71cbc91dbe2c454d1d7bf2092c01c4f0cae (diff)
loplugin:referencecasting in canvas..chart2
Change-Id: I3a3671b5c44d1a7e5ca320d3d76dd5d902382cbc Reviewed-on: https://gerrit.libreoffice.org/75935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller/chartapiwrapper')
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx24
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx4
-rw-r--r--chart2/source/controller/chartapiwrapper/LegendWrapper.cxx4
-rw-r--r--chart2/source/controller/chartapiwrapper/TitleWrapper.cxx6
5 files changed, 21 insertions, 23 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index 67492264b60f..80b9ed8a77dd 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -504,7 +504,7 @@ void SAL_CALL ChartDataWrapper::setAnyColumnDescriptions( const Sequence< Sequen
void SAL_CALL ChartDataWrapper::setDateCategories( const Sequence< double >& rDates )
{
Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
- ControllerLockGuardUNO aCtrlLockGuard( uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
lcl_DateCategoriesOperator aOperator( rDates );
applyData( aOperator );
DiagramHelper::switchToDateCategories( xChartDoc );
@@ -625,7 +625,7 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
uno::Sequence< sal_Int32 > aSequenceMapping;
DataSourceHelper::detectRangeSegmentation(
- uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ),
+ xChartDoc,
aRangeString, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories );
if( !bHasCategories && rDataOperator.setsCategories( bUseColumns ) )
@@ -636,7 +636,7 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
aRangeString, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories ) );
// -- locked controllers
- ControllerLockGuardUNO aCtrlLockGuard( uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
// create and attach new data source
switchToInternalDataProvider();
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index c413fd514daa..c0d3f469cad0 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -646,7 +646,7 @@ Reference< drawing::XShape > SAL_CALL ChartDocumentWrapper::getTitle()
{
if( !m_xTitle.is() )
{
- ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChart2Document() );
m_xTitle = new TitleWrapper( TitleHelper::MAIN_TITLE, m_spChart2ModelContact );
}
return m_xTitle;
@@ -656,7 +656,7 @@ Reference< drawing::XShape > SAL_CALL ChartDocumentWrapper::getSubTitle()
{
if( !m_xSubTitle.is() )
{
- ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChart2Document() );
m_xSubTitle = new TitleWrapper( TitleHelper::SUB_TITLE, m_spChart2ModelContact );
}
return m_xSubTitle;
@@ -747,7 +747,7 @@ void SAL_CALL ChartDocumentWrapper::attachData( const Reference< XChartData >& x
if( !xNewData.is() )
return;
- ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChart2Document() );
m_xChartData.set( new ChartDataWrapper( m_spChart2ModelContact, xNewData ) );
}
@@ -961,8 +961,7 @@ Reference< drawing::XShapes > ChartDocumentWrapper::getAdditionalShapes() const
uno::Reference< drawing::XShapes > xFoundShapes;
uno::Reference< drawing::XDrawPage > xDrawPage( impl_getDrawPage() );
- uno::Reference< drawing::XShapes > xDrawPageShapes( xDrawPage, uno::UNO_QUERY );
- if( !xDrawPageShapes.is() )
+ if( !xDrawPage.is() )
return xFoundShapes;
uno::Reference<drawing::XShapes> xChartRoot( DrawModelWrapper::getChartRootShape( xDrawPage ) );
@@ -970,11 +969,11 @@ Reference< drawing::XShapes > ChartDocumentWrapper::getAdditionalShapes() const
// iterate 'flat' over all top-level objects
// and determine all that are no chart objects
std::vector< uno::Reference< drawing::XShape > > aShapeVector;
- sal_Int32 nSubCount = xDrawPageShapes->getCount();
+ sal_Int32 nSubCount = xDrawPage->getCount();
uno::Reference< drawing::XShape > xShape;
for( sal_Int32 nS = 0; nS < nSubCount; nS++ )
{
- if( xDrawPageShapes->getByIndex( nS ) >>= xShape )
+ if( xDrawPage->getByIndex( nS ) >>= xShape )
{
if( xShape.is() && xChartRoot!=xShape )
aShapeVector.push_back( xShape );
@@ -984,8 +983,8 @@ Reference< drawing::XShapes > ChartDocumentWrapper::getAdditionalShapes() const
if( !aShapeVector.empty() )
{
// create a shape collection
- xFoundShapes.set( drawing::ShapeCollection::create(
- comphelper::getProcessComponentContext()), uno::UNO_QUERY );
+ xFoundShapes = drawing::ShapeCollection::create(
+ comphelper::getProcessComponentContext());
OSL_ENSURE( xFoundShapes.is(), "Couldn't create a shape collection!" );
if( xFoundShapes.is())
@@ -1188,9 +1187,8 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
if( xDia.is())
{
// locked controllers
- Reference< frame::XModel > xModel( xChartDoc, uno::UNO_QUERY );
- ControllerLockGuardUNO aCtrlLockGuard( xModel );
- Reference< chart2::XDiagram > xDiagram = ChartModelHelper::findDiagram( xModel );
+ ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
+ Reference< chart2::XDiagram > xDiagram = ChartModelHelper::findDiagram( xChartDoc );
ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram );
Reference< lang::XMultiServiceFactory > xTemplateManager( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
DiagramHelper::tTemplateWithServiceName aTemplateWithService(
@@ -1205,7 +1203,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
else
{
// locked controllers
- ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
xDia.set( xTemplate->createDiagramByDataSource(
uno::Reference< chart2::data::XDataSource >(),
uno::Sequence< beans::PropertyValue >()));
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index 5702165bc763..813a51196def 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -543,7 +543,7 @@ Reference< beans::XPropertySet > DataSeriesPointWrapper::getDataPointProperties(
//ReferenceSizePropertyProvider
void DataSeriesPointWrapper::updateReferenceSize()
{
- Reference< beans::XPropertySet > xProp( getInnerPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp = getInnerPropertySet();
if( xProp.is() )
{
if( xProp->getPropertyValue("ReferencePageSize").hasValue() )
@@ -554,7 +554,7 @@ void DataSeriesPointWrapper::updateReferenceSize()
Any DataSeriesPointWrapper::getReferenceSize()
{
Any aRet;
- Reference< beans::XPropertySet > xProp( getInnerPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp = getInnerPropertySet();
if( xProp.is() )
aRet = xProp->getPropertyValue("ReferencePageSize");
return aRet;
diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
index 631c21744c99..038015c12257 100644
--- a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
@@ -342,7 +342,7 @@ void SAL_CALL LegendWrapper::removeEventListener(
//ReferenceSizePropertyProvider
void LegendWrapper::updateReferenceSize()
{
- Reference< beans::XPropertySet > xProp( getInnerPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp = getInnerPropertySet();
if( xProp.is() )
{
if( xProp->getPropertyValue( "ReferencePageSize" ).hasValue() )
@@ -353,7 +353,7 @@ void LegendWrapper::updateReferenceSize()
Any LegendWrapper::getReferenceSize()
{
Any aRet;
- Reference< beans::XPropertySet > xProp( getInnerPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp = getInnerPropertySet();
if( xProp.is() )
aRet = xProp->getPropertyValue( "ReferencePageSize" );
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index f2086558180b..d46cc6c9ce01 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -277,7 +277,7 @@ void TitleWrapper::getFastCharacterPropertyValue( sal_Int32 nHandle, Any& rValue
OSL_ASSERT( FAST_PROPERTY_ID_START_CHAR_PROP <= nHandle &&
nHandle < CharacterProperties::FAST_PROPERTY_ID_END_CHAR_PROP );
- Reference< beans::XPropertySet > xProp( getFirstCharacterPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp = getFirstCharacterPropertySet();
Reference< beans::XFastPropertySet > xFastProp( xProp, uno::UNO_QUERY );
if(xProp.is())
{
@@ -404,7 +404,7 @@ void SAL_CALL TitleWrapper::addPropertyChangeListener( const OUString& rProperty
sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
{
- Reference< beans::XPropertySet > xPropSet( getFirstCharacterPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xPropSet = getFirstCharacterPropertySet();
if( xPropSet.is() )
xPropSet->addPropertyChangeListener( rPropertyName, xListener );
}
@@ -416,7 +416,7 @@ void SAL_CALL TitleWrapper::removePropertyChangeListener( const OUString& rPrope
sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
if( CharacterProperties::IsCharacterPropertyHandle( nHandle ) )
{
- Reference< beans::XPropertySet > xPropSet( getFirstCharacterPropertySet(), uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xPropSet = getFirstCharacterPropertySet();
if( xPropSet.is() )
xPropSet->removePropertyChangeListener( rPropertyName, xListener );
}