[Libreoffice-commits] core.git: forms/source
Arkadiy Illarionov (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 20 06:03:25 UTC 2019
forms/source/xforms/model.cxx | 2 +-
forms/source/xforms/model_helper.hxx | 13 ++++++++-----
forms/source/xforms/submission.cxx | 14 ++------------
forms/source/xforms/submission.hxx | 3 +--
4 files changed, 12 insertions(+), 20 deletions(-)
New commits:
commit d6a45af91bf1df9ab8aac3d8e83dba7474e15a95
Author: Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Thu Jun 20 00:29:40 2019 +0300
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jun 20 08:02:26 2019 +0200
tdf#39593 Remove xforms::Submission::getSubmission
Replace with comphelper::getUnoTunnelImplementation.
Change-Id: I8dcd0bf1cfbaa02fbb7c128421506f1c30d87773
Reviewed-on: https://gerrit.libreoffice.org/74387
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx
index f92e8392eb4e..c41358199ae8 100644
--- a/forms/source/xforms/model.cxx
+++ b/forms/source/xforms/model.cxx
@@ -449,7 +449,7 @@ void SAL_CALL Model::submitWithInteraction(
if( mxSubmissions->hasItem( sID ) )
{
Submission* pSubmission =
- Submission::getSubmission( mxSubmissions->getItem( sID ) );
+ comphelper::getUnoTunnelImplementation<Submission>( mxSubmissions->getItem( sID ) );
OSL_ENSURE( pSubmission != nullptr, "no submission?" );
OSL_ENSURE( pSubmission->getModel() == Reference<XModel>( this ),
"wrong model" );
diff --git a/forms/source/xforms/model_helper.hxx b/forms/source/xforms/model_helper.hxx
index b70bc23c9c1c..f0a6c46d58a4 100644
--- a/forms/source/xforms/model_helper.hxx
+++ b/forms/source/xforms/model_helper.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <comphelper/servicehelper.hxx>
namespace xforms
{
@@ -82,20 +83,22 @@ public:
virtual bool isValid( const T& t ) const override
{
- return Submission::getSubmission( t ) != nullptr;
+ return comphelper::getUnoTunnelImplementation<Submission>( t ) != nullptr;
}
protected:
virtual void _insert( const T& t ) override
{
- OSL_ENSURE( Submission::getSubmission( t ) != nullptr, "invalid item?" );
- Submission::getSubmission( t )->setModel( css::uno::Reference<css::xforms::XModel>( mpModel ) );
+ auto pSubmission = comphelper::getUnoTunnelImplementation<Submission>( t );
+ OSL_ENSURE( pSubmission != nullptr, "invalid item?" );
+ pSubmission->setModel( css::uno::Reference<css::xforms::XModel>( mpModel ) );
}
virtual void _remove( const T& t ) override
{
- OSL_ENSURE( Submission::getSubmission( t ) != nullptr, "invalid item?" );
- Submission::getSubmission( t )->setModel( css::uno::Reference<css::xforms::XModel>( ) );
+ auto pSubmission = comphelper::getUnoTunnelImplementation<Submission>( t );
+ OSL_ENSURE( pSubmission != nullptr, "invalid item?" );
+ pSubmission->setModel( css::uno::Reference<css::xforms::XModel>( ) );
}
};
diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx
index 3074619981c9..9c7a0fb72abe 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -263,22 +263,12 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler )
return ( aResult == CSubmission::SUCCESS );
}
-Sequence<sal_Int8> Submission::getUnoTunnelID()
+Sequence<sal_Int8> Submission::getUnoTunnelId()
{
static cppu::OImplementationId aImplementationId;
return aImplementationId.getImplementationId();
}
-Submission* Submission::getSubmission(
- const Reference<XPropertySet>& xPropertySet )
-{
- Reference<XUnoTunnel> xTunnel( xPropertySet, UNO_QUERY );
- return xTunnel.is()
- ? reinterpret_cast<Submission*>(
- xTunnel->getSomething( getUnoTunnelID() ) )
- : nullptr;
-}
-
void Submission::liveCheck()
{
@@ -386,7 +376,7 @@ void SAL_CALL Submission::setName( const OUString& sID )
sal_Int64 SAL_CALL Submission::getSomething(
const Sequence<sal_Int8>& aId )
{
- return ( aId == getUnoTunnelID() ) ? reinterpret_cast<sal_Int64>(this) : 0;
+ return ( aId == getUnoTunnelId() ) ? reinterpret_cast<sal_Int64>(this) : 0;
}
diff --git a/forms/source/xforms/submission.hxx b/forms/source/xforms/submission.hxx
index fc095d7c3965..3f3921f9aaa5 100644
--- a/forms/source/xforms/submission.hxx
+++ b/forms/source/xforms/submission.hxx
@@ -158,8 +158,7 @@ public:
bool doSubmit( const css::uno::Reference< css::task::XInteractionHandler >& aHandler );
// helpers for UNO tunnel
- static css::uno::Sequence<sal_Int8> getUnoTunnelID();
- static Submission* getSubmission( const css::uno::Reference<css::beans::XPropertySet>& );
+ static css::uno::Sequence<sal_Int8> getUnoTunnelId();
private:
More information about the Libreoffice-commits
mailing list