From 1356892777b89b09ad7695e53d9e5ef1fca4f934 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 7 Nov 2023 12:59:44 +0200 Subject: [PATCH] loplugin:fieldcast in xmlscript Change-Id: Iecf8519ae43015a3ad850251a7027e22ce5bf836 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159082 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmlscript/source/xmldlg_imexp/imp_share.hxx | 4 ++-- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index c05460ddf274..9eec588c48f3 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -586,7 +586,7 @@ public: class ComboBoxElement : public ControlElement { - css::uno::Reference< css::xml::input::XElement > _popup; + rtl::Reference< MenuPopupElement > _popup; public: virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startChildElement( @@ -605,7 +605,7 @@ public: class MenuListElement : public ControlElement { - css::uno::Reference< css::xml::input::XElement > _popup; + rtl::Reference< MenuPopupElement > _popup; public: virtual css::uno::Reference< css::xml::input::XElement > SAL_CALL startChildElement( diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index 03344a5b7c4a..e64e60eabb3d 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -1371,11 +1371,10 @@ void MenuListElement::endElement() bool bHasSrcRange = ctx.importDataAwareProperty( "source-cell-range" , _xAttributes ); if (_popup.is()) { - MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); if ( !bHasSrcRange ) - xControlModel->setPropertyValue( "StringItemList", Any( p->getItemValues() ) ); + xControlModel->setPropertyValue( "StringItemList", Any( _popup->getItemValues() ) ); if ( !bHasLinkedCell ) - xControlModel->setPropertyValue( "SelectedItems", Any( p->getSelectedItems() ) ); + xControlModel->setPropertyValue( "SelectedItems", Any( _popup->getSelectedItems() ) ); } ctx.importEvents( _events ); @@ -1441,8 +1440,7 @@ void ComboBoxElement::endElement() bool bHasSrcRange = ctx.importDataAwareProperty( "source-cell-range" , _xAttributes ); if (_popup.is() && !bHasSrcRange ) { - MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); - xControlModel->setPropertyValue( "StringItemList", Any( p->getItemValues() ) ); + xControlModel->setPropertyValue( "StringItemList", Any( _popup->getItemValues() ) ); } ctx.importEvents( _events );