diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-08 13:09:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-09 09:10:20 +0100 |
commit | a85c7cf02603408b09c15344803e293bb4b5bb81 (patch) | |
tree | b485ab7907ce75df6a256f3a9247f2b56b283e46 /sc/source/ui | |
parent | 33729810b5f8ff5232195a5390c58e6e50900253 (diff) |
loplugin:fieldcast in ScVbaAxis
Change-Id: Ie8ad7f6ff7e0fa52e7c7075520e5bf51ab8af7a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159180
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/vba/vbaaxes.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaaxis.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaaxis.hxx | 9 |
3 files changed, 10 insertions, 8 deletions
diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx index 5dc3fb7a07e9..0a377750aa59 100644 --- a/sc/source/ui/vba/vbaaxes.cxx +++ b/sc/source/ui/vba/vbaaxes.cxx @@ -79,8 +79,7 @@ ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno: } else DebugHelper::runtimeexception(ERRCODE_BASIC_METHOD_FAILED); - uno::Reference< XHelperInterface > xParent( xChart, uno::UNO_QUERY_THROW ); - return new ScVbaAxis( xParent, xContext, xAxisPropertySet, nType, nAxisGroup); + return new ScVbaAxis( pChart, xContext, xAxisPropertySet, nType, nAxisGroup); } namespace { diff --git a/sc/source/ui/vba/vbaaxis.cxx b/sc/source/ui/vba/vbaaxis.cxx index aa461abee0da..76cf9fe066e3 100644 --- a/sc/source/ui/vba/vbaaxis.cxx +++ b/sc/source/ui/vba/vbaaxis.cxx @@ -37,7 +37,7 @@ constexpr OUStringLiteral VBA_MAX(u"Min"); ScVbaChart* ScVbaAxis::getChartPtr() { - ScVbaChart* pChart = static_cast< ScVbaChart* >( moChartParent.get() ); + ScVbaChart* pChart = moChartParent.get(); if ( !pChart ) throw uno::RuntimeException("Can't access parent chart impl" ); return pChart; @@ -53,17 +53,17 @@ ScVbaAxis::isValueAxis() return true; } -ScVbaAxis::ScVbaAxis( const uno::Reference< XHelperInterface >& xParent, +ScVbaAxis::ScVbaAxis( const rtl::Reference< ScVbaChart >& xParent, const uno::Reference< uno::XComponentContext > & xContext, uno::Reference< beans::XPropertySet > _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ) : ScVbaAxis_BASE( xParent, xContext ), + moChartParent(xParent), mxPropertySet(std::move( _xPropertySet )), mnType( _nType ), mnGroup( _nGroup ), maShapeHelper( uno::Reference< drawing::XShape >( mxPropertySet, uno::UNO_QUERY ) ), bCrossesAreCustomized( false ) { - moChartParent.set( xParent, uno::UNO_QUERY_THROW ); setType(_nType); setCrosses(xlAxisCrossesAutomatic); } diff --git a/sc/source/ui/vba/vbaaxis.hxx b/sc/source/ui/vba/vbaaxis.hxx index 787d2e03763a..8fcb9a399092 100644 --- a/sc/source/ui/vba/vbaaxis.hxx +++ b/sc/source/ui/vba/vbaaxis.hxx @@ -21,12 +21,15 @@ #include <ooo/vba/excel/XAxis.hpp> #include <ooo/vba/excel/XChart.hpp> #include <vbahelper/vbahelperinterface.hxx> +#include <rtl/ref.hxx> #include <memory> -typedef InheritedHelperInterfaceWeakImpl< ov::excel::XAxis > ScVbaAxis_BASE; + class ScVbaChart; + +typedef InheritedHelperInterfaceWeakImpl< ov::excel::XAxis > ScVbaAxis_BASE; class ScVbaAxis : public ScVbaAxis_BASE { - css::uno::Reference< ov::excel::XChart > moChartParent; + rtl::Reference< ScVbaChart > moChartParent; css::uno::Reference< css::beans::XPropertySet > mxPropertySet; sal_Int32 mnType; sal_Int32 mnGroup; @@ -39,7 +42,7 @@ class ScVbaAxis : public ScVbaAxis_BASE bool isValueAxis(); public: - ScVbaAxis( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, css::uno::Reference< css::beans::XPropertySet > _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ); + ScVbaAxis( const rtl::Reference< ScVbaChart >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, css::uno::Reference< css::beans::XPropertySet > _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ); // Methods virtual void SAL_CALL Delete( ) override; virtual css::uno::Reference< ::ooo::vba::excel::XAxisTitle > SAL_CALL getAxisTitle( ) override; |