diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-03-23 20:14:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-27 09:43:58 +0000 |
commit | d615af618cc6a7152c76a49b3cd09db38eaa9e07 (patch) | |
tree | bc0d69070444dc687708de9a4a146c5c2d3b6852 /sfx2/source/view/frmload.cxx | |
parent | 6f968f00b1534406a2943be374fab924c3396482 (diff) |
create SfxInterfaceId o3tl::strong_int
Change-Id: Ie52f63382a9fb36f9a472801be012b140bfb51f6
Reviewed-on: https://gerrit.libreoffice.org/35722
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/view/frmload.cxx')
-rw-r--r-- | sfx2/source/view/frmload.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 5efadcfd2b35..90c01dba7dc1 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -165,7 +165,7 @@ private: ::comphelper::NamedValueCollection& io_rDescriptor ); - static sal_Int16 impl_determineEffectiveViewId_nothrow( + static SfxInterfaceId impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ); @@ -536,12 +536,13 @@ void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCo } -sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) +SfxInterfaceId SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) { - sal_Int16 nViewId = i_rDescriptor.getOrDefault( "ViewId", sal_Int16( 0 ) ); + SfxInterfaceId nViewId(i_rDescriptor.getOrDefault( "ViewId", sal_Int16( 0 ) )); try { - if ( nViewId == 0 ) do + if ( nViewId == SfxInterfaceId(0) ) + do { Reference< XViewDataSupplier > xViewDataSupplier( i_rDocument.GetModel(), UNO_QUERY ); Reference< XIndexAccess > xViewData; @@ -567,7 +568,7 @@ sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxO SfxViewFactory* pViewFactory = i_rDocument.GetFactory().GetViewFactoryByViewName( sViewId ); if ( pViewFactory ) - nViewId = sal_Int16( pViewFactory->GetOrdinal() ); + nViewId = pViewFactory->GetOrdinal(); } while ( false ); } @@ -576,7 +577,7 @@ sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxO DBG_UNHANDLED_EXCEPTION(); } - if ( nViewId == 0 ) + if ( nViewId == SfxInterfaceId(0) ) nViewId = i_rDocument.GetFactory().GetViewFactory().GetOrdinal(); return nViewId; } @@ -708,7 +709,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA ENSURE_OR_THROW( xDoc.is(), "no SfxObjectShell for the given model" ); // ensure the ID of the to-be-created view is in the descriptor, if possible - const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); + const SfxInterfaceId nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 ); const OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() ); |