diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-01-19 14:47:03 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-01-19 16:07:12 +0000 |
commit | 41f659b49250dd62abc141afaa3c73cc63a425e3 (patch) | |
tree | 6904d55087ab863a427a02d9db12a4f4e4ce7266 /basic/source/uno/namecont.cxx | |
parent | 52b465e271961a65f356c9a5b354acead3c0a849 (diff) |
Base SfxLibrary on WeakComponentImplHelper
...rather than on the deprecated OComponentHelper.
The two classes SfxDialogLibrary and SfxScriptLibrary, both deriving from
SfxLibrary, had been found to implement their respective queryInterface in a way
that is incompatible with the XAggregation protocol inherited via
OComponentHelper. It looks like no code actually made use of the XAggregation
offered by these Sfx*Library classes, so the easiest fix for those
queryInterface implementations appears to switch from OComponentHelper to
WeakComponentImplHelper (thereby dropping XAggregation, and thus rendering the
existing queryInterface implementations OK).
Ideally, SfxLibrary would derive from WeakComponentImplHelper<XInitialization,
XStorageBasedLibraryContainer, XLibraryContainerPassword, ...> covering all the
UNO interface classes from which it currently derives manually. But changing
that manual implementation across SfxLibrary and its SfxDialogLibrary and
SfxScriptLibrary derived classes looks tricky, so merely introduce an "empty"
WeakComponentImplHelper<> for now and keep all the manual stuff, and leave
proper clean up for later.
Change-Id: I12dc5bad2c017b8d76ce28ac189e95cf2e3810e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145792
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic/source/uno/namecont.cxx')
-rw-r--r-- | basic/source/uno/namecont.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 431f55b2a4d2..24bcddbded53 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -2930,7 +2930,7 @@ sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const OUString& _rServic // Ctor SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType, const Reference< XSimpleFileAccess3 >& xSFI ) - : OComponentHelper( m_aMutex ) + : WeakComponentImplHelper( m_aMutex ) , mxSFI( xSFI ) , mrModifiable( _rModifiable ) , maNameContainer( new NameContainer(aType) ) @@ -2952,7 +2952,7 @@ SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType, SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType, const Reference< XSimpleFileAccess3 >& xSFI, OUString aLibInfoFileURL, OUString aStorageURL, bool ReadOnly ) - : OComponentHelper( m_aMutex ) + : WeakComponentImplHelper( m_aMutex ) , mxSFI( xSFI ) , mrModifiable( _rModifiable ) , maNameContainer( new NameContainer(aType) ) @@ -3004,7 +3004,7 @@ Any SAL_CALL SfxLibrary::queryInterface( const Type& rType ) static_cast< XChangesNotifier * >( this ) ); if( !aRet.hasValue() ) { - aRet = OComponentHelper::queryInterface( rType ); + aRet = WeakComponentImplHelper::queryInterface( rType ); } return aRet; } @@ -3140,7 +3140,7 @@ Sequence< Type > SfxLibrary::getTypes() cppu::UnoType<XNameContainer>::get(), cppu::UnoType<XContainer>::get(), cppu::UnoType<XChangesNotifier>::get(), - OComponentHelper::getTypes() ); + WeakComponentImplHelper::getTypes() ); return ourTypes_NameContainer.getTypes(); } |