From 9950aab9f02ab6aff71feca820575ed5a4e215d5 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Wed, 19 Jun 2019 23:37:31 +0300 Subject: tdf#39593 Remove xforms::Model::getModel Replace with comphelper::getUnoTunnelImplementation. Change-Id: I52f780059be7626a03bf79044cfc580bb33f3fd3 Reviewed-on: https://gerrit.libreoffice.org/74383 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- forms/source/xforms/binding.cxx | 2 +- forms/source/xforms/model.cxx | 18 ++---------------- forms/source/xforms/model.hxx | 5 +---- forms/source/xforms/submission.cxx | 8 ++++---- 4 files changed, 8 insertions(+), 25 deletions(-) (limited to 'forms') diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index 378cd39a71fd..0601babdf72e 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -462,7 +462,7 @@ Model* Binding::getModelImpl( const css::uno::Reference& xM Reference xTunnel( xModel, UNO_QUERY ); Model* pModel = xTunnel.is() ? reinterpret_cast( - xTunnel->getSomething( Model::getUnoTunnelID() ) ) + xTunnel->getSomething( Model::getUnoTunnelId() ) ) : nullptr; return pModel; } diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index 7fc703a74f1c..2bddfea5db30 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -108,20 +108,6 @@ Model::~Model() throw() { } -static Model* lcl_getModel( const Reference& xTunnel ) -{ - Model* pModel = nullptr; - if( xTunnel.is() ) - pModel = reinterpret_cast( - xTunnel->getSomething( Model::getUnoTunnelID() ) ); - return pModel; -} - -Model* Model::getModel( const Reference& xModel ) -{ - return lcl_getModel( Reference( xModel, UNO_QUERY ) ); -} - EvaluationContext Model::getEvaluationContext() { // the default context is the top-level element node. A default @@ -144,7 +130,7 @@ EvaluationContext Model::getEvaluationContext() } -css::uno::Sequence Model::getUnoTunnelID() +css::uno::Sequence Model::getUnoTunnelId() { static cppu::OImplementationId aImplementationId; return aImplementationId.getImplementationId(); @@ -604,7 +590,7 @@ void Model::update() sal_Int64 Model::getSomething( const css::uno::Sequence& xId ) { - return reinterpret_cast( ( xId == getUnoTunnelID() ) ? this : nullptr ); + return reinterpret_cast( ( xId == getUnoTunnelId() ) ? this : nullptr ); } Sequence Model::getImplementationId() diff --git a/forms/source/xforms/model.hxx b/forms/source/xforms/model.hxx index 6d956576778c..a56554c0888f 100644 --- a/forms/source/xforms/model.hxx +++ b/forms/source/xforms/model.hxx @@ -113,13 +113,10 @@ public: Model(); virtual ~Model() throw() override; - // get Model implementation from API object - static Model* getModel( const css::uno::Reference& ); - xforms::EvaluationContext getEvaluationContext(); - static css::uno::Sequence getUnoTunnelID(); + static css::uno::Sequence getUnoTunnelId(); // get/set that part of the schema, that we can't interpret as data types diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx index 32066cdf5507..c4d786877674 100644 --- a/forms/source/xforms/submission.cxx +++ b/forms/source/xforms/submission.cxx @@ -216,12 +216,12 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler ) else if( !maRef.getExpression().isEmpty() ) { aExpression.setExpression( maRef.getExpression() ); - aEvalContext = Model::getModel( mxModel )->getEvaluationContext(); + aEvalContext = comphelper::getUnoTunnelImplementation( mxModel )->getEvaluationContext(); } else { aExpression.setExpression( "/" ); - aEvalContext = Model::getModel( mxModel )->getEvaluationContext(); + aEvalContext = comphelper::getUnoTunnelImplementation( mxModel )->getEvaluationContext(); } aExpression.evaluate( aEvalContext ); Reference xResult = aExpression.getXPath(); @@ -283,7 +283,7 @@ Model* Submission::getModelImpl() const { Model* pModel = nullptr; if( mxModel.is() ) - pModel = Model::getModel( mxModel ); + pModel = comphelper::getUnoTunnelImplementation( mxModel ); return pModel; } @@ -401,7 +401,7 @@ void SAL_CALL Submission::submitWithInteraction( *this ); - Model* pModel = Model::getModel( xModel ); + Model* pModel = comphelper::getUnoTunnelImplementation( xModel ); OSL_ENSURE( pModel != nullptr, "illegal model?" ); // #i36765# #i47248# warning on submission of illegal data -- cgit