summaryrefslogtreecommitdiff
path: root/toolkit/source/controls
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-09-14 08:19:47 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-09-15 06:07:36 +0200
commit05bc93db2de56000f65764d7e394d03747cac23d (patch)
tree975de9ae83572aac8a5c3ea8db281e1017ee5be0 /toolkit/source/controls
parent8cbb414ed737f9ffc76e1258e6671769bf63fc6c (diff)
Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1
The header got some changes: 1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace 2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace of uses of OImplementationId with it, including in XTypeProvider 3. Introduce convenience functions 'getSomething_cast' to cast between sal_Int64 and object pointers uniformly. 4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make it a bit shorter, and to reflect its function better. Templatize it to take also css::uno::Any for convenience. 5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it handle cases both with and without fallback to parent. 6. Adjust UNO3_GETIMPLEMENTATION_* macros TODO (in separate commits): - Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation - Replace all uses of OImplementationId in core with UnoIdInit - Deprecate OImplementationId in <cppuhelper/typeprovider.hxx> - Change implementations of getSomething to use getSomethingImpl - Revise uses of getSomething to use getFromUnoTunnel Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'toolkit/source/controls')
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.cxx6
-rw-r--r--toolkit/source/controls/grid/gridcolumn.cxx2
-rw-r--r--toolkit/source/controls/stdtabcontroller.cxx2
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx4
4 files changed, 7 insertions, 7 deletions
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
index 5815810cebca..d93d10c5b2c9 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -115,7 +115,7 @@ private:
Reference< css::util::XCloneable > const xCloneable( *col, UNO_QUERY_THROW );
Reference< XGridColumn > const xClone( xCloneable->createClone(), UNO_QUERY_THROW );
- GridColumn* const pGridColumn = comphelper::getUnoTunnelImplementation<GridColumn>( xClone );
+ GridColumn* const pGridColumn = comphelper::getFromUnoTunnel<GridColumn>( xClone );
if ( pGridColumn == nullptr )
throw RuntimeException( "invalid clone source implementation", *this );
// that's indeed a RuntimeException, not an IllegalArgumentException or some such:
@@ -151,7 +151,7 @@ private:
{
::comphelper::ComponentGuard aGuard( *this, rBHelper );
- GridColumn* const pGridColumn = comphelper::getUnoTunnelImplementation<GridColumn>( i_column );
+ GridColumn* const pGridColumn = comphelper::getFromUnoTunnel<GridColumn>( i_column );
if ( pGridColumn == nullptr )
throw css::lang::IllegalArgumentException( "invalid column implementation", *this, 1 );
@@ -190,7 +190,7 @@ private:
++updatePos, ++columnIndex
)
{
- GridColumn* pColumnImpl = comphelper::getUnoTunnelImplementation<GridColumn>( *updatePos );
+ GridColumn* pColumnImpl = comphelper::getFromUnoTunnel<GridColumn>( *updatePos );
if ( !pColumnImpl )
{
SAL_WARN( "toolkit.controls", "DefaultGridColumnModel::removeColumn: invalid column implementation!" );
diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx
index 1952c1faa31d..af61a578d135 100644
--- a/toolkit/source/controls/grid/gridcolumn.cxx
+++ b/toolkit/source/controls/grid/gridcolumn.cxx
@@ -285,7 +285,7 @@ namespace toolkit
sal_Int64 SAL_CALL GridColumn::getSomething( const Sequence< sal_Int8 >& i_identifier )
{
- if ( isUnoTunnelId<GridColumn>(i_identifier) )
+ if ( comphelper::isUnoTunnelId<GridColumn>(i_identifier) )
return ::sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
return 0;
}
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx
index f762ff805c0d..d4f5d64b04ef 100644
--- a/toolkit/source/controls/stdtabcontroller.cxx
+++ b/toolkit/source/controls/stdtabcontroller.cxx
@@ -142,7 +142,7 @@ void StdTabController::ImplActivateControl( bool bFirst ) const
Reference< XWindowPeer > xCP = pControls[nCtrl]->getPeer();
if ( xCP.is() )
{
- VCLXWindow* pC = comphelper::getUnoTunnelImplementation<VCLXWindow>( xCP );
+ VCLXWindow* pC = comphelper::getFromUnoTunnel<VCLXWindow>( xCP );
if ( pC && pC->GetWindow() && ( pC->GetWindow()->GetStyle() & WB_TABSTOP ) )
{
pC->GetWindow()->GrabFocus();
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 44ff22c53efe..c30c5c6b3788 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -423,13 +423,13 @@ css::uno::Any UnoControlModel::queryAggregation( const css::uno::Type & rType )
const css::uno::Sequence< sal_Int8 >& UnoControlModel::getUnoTunnelId() noexcept
{
- static const UnoTunnelIdInit theUnoControlModelUnoTunnelId;
+ static const comphelper::UnoIdInit theUnoControlModelUnoTunnelId;
return theUnoControlModelUnoTunnelId.getSeq();
}
sal_Int64 UnoControlModel::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier )
{
- if( isUnoTunnelId<UnoControlModel>(rIdentifier) )
+ if( comphelper::isUnoTunnelId<UnoControlModel>(rIdentifier) )
return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this));
return 0;