diff options
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/xforms/binding.cxx | 2 | ||||
-rw-r--r-- | forms/source/xforms/model.cxx | 18 | ||||
-rw-r--r-- | forms/source/xforms/model.hxx | 5 | ||||
-rw-r--r-- | forms/source/xforms/submission.cxx | 8 |
4 files changed, 8 insertions, 25 deletions
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<css::xforms::XModel>& xM Reference<XUnoTunnel> xTunnel( xModel, UNO_QUERY ); Model* pModel = xTunnel.is() ? reinterpret_cast<Model*>( - 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<XUnoTunnel>& xTunnel ) -{ - Model* pModel = nullptr; - if( xTunnel.is() ) - pModel = reinterpret_cast<Model*>( - xTunnel->getSomething( Model::getUnoTunnelID() ) ); - return pModel; -} - -Model* Model::getModel( const Reference<XModel>& xModel ) -{ - return lcl_getModel( Reference<XUnoTunnel>( 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<sal_Int8> Model::getUnoTunnelID() +css::uno::Sequence<sal_Int8> Model::getUnoTunnelId() { static cppu::OImplementationId aImplementationId; return aImplementationId.getImplementationId(); @@ -604,7 +590,7 @@ void Model::update() sal_Int64 Model::getSomething( const css::uno::Sequence<sal_Int8>& xId ) { - return reinterpret_cast<sal_Int64>( ( xId == getUnoTunnelID() ) ? this : nullptr ); + return reinterpret_cast<sal_Int64>( ( xId == getUnoTunnelId() ) ? this : nullptr ); } Sequence<sal_Int8> 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<css::xforms::XModel>& ); - xforms::EvaluationContext getEvaluationContext(); - static css::uno::Sequence<sal_Int8> getUnoTunnelID(); + static css::uno::Sequence<sal_Int8> 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<Model>( mxModel )->getEvaluationContext(); } else { aExpression.setExpression( "/" ); - aEvalContext = Model::getModel( mxModel )->getEvaluationContext(); + aEvalContext = comphelper::getUnoTunnelImplementation<Model>( mxModel )->getEvaluationContext(); } aExpression.evaluate( aEvalContext ); Reference<XXPathObject> xResult = aExpression.getXPath(); @@ -283,7 +283,7 @@ Model* Submission::getModelImpl() const { Model* pModel = nullptr; if( mxModel.is() ) - pModel = Model::getModel( mxModel ); + pModel = comphelper::getUnoTunnelImplementation<Model>( mxModel ); return pModel; } @@ -401,7 +401,7 @@ void SAL_CALL Submission::submitWithInteraction( *this ); - Model* pModel = Model::getModel( xModel ); + Model* pModel = comphelper::getUnoTunnelImplementation<Model>( xModel ); OSL_ENSURE( pModel != nullptr, "illegal model?" ); // #i36765# #i47248# warning on submission of illegal data |