diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-11-25 00:17:50 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-11-25 10:12:38 +0100 |
commit | a534361141d69096d896e6e0552d19f3138eeeb3 (patch) | |
tree | cb483086666cc65b9a902c81967fc6f49d22676f /basic | |
parent | da4a0d1520c501b5f8a4c3385cdc5f76653213f4 (diff) |
Fold OldBasicPassword into basic::SfxScriptLibraryContainer
Change-Id: Iaeaf30f63760185a2b1dd72feb980b94d9931d55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143253
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basicmanagerrepository.cxx | 4 | ||||
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 4 | ||||
-rw-r--r-- | basic/source/inc/scriptcont.hxx | 8 | ||||
-rw-r--r-- | basic/source/uno/scriptcont.cxx | 3 |
4 files changed, 10 insertions, 9 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index 5d04fc3f78ab..7a2ed5efd20a 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -300,7 +300,7 @@ namespace basic // Dialog container rtl::Reference<SfxDialogLibraryContainer> pDialogCont = new SfxDialogLibraryContainer( Reference< XStorage >() ); - LibraryContainerInfo aInfo( pBasicCont, pDialogCont, static_cast< OldBasicPassword* >( pBasicCont.get() ) ); + LibraryContainerInfo aInfo( pBasicCont, pDialogCont, pBasicCont.get() ); pBasicManager->SetLibraryContainerInfo( aInfo ); // global constants @@ -462,7 +462,7 @@ namespace basic } // knit the containers with the BasicManager - LibraryContainerInfo aInfo( xBasicLibs, xDialogLibs, dynamic_cast< OldBasicPassword* >( xBasicLibs.get() ) ); + LibraryContainerInfo aInfo( xBasicLibs, xDialogLibs, dynamic_cast< SfxScriptLibraryContainer* >( xBasicLibs.get() ) ); OSL_ENSURE( aInfo.mpOldBasicPassword, "ImplRepository::impl_createManagerForModel: wrong BasicLibraries implementation!" ); _out_rpBasicManager->SetLibraryContainerInfo( aInfo ); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index d3a711f4a677..72776dd08153 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -41,6 +41,8 @@ #include <com/sun/star/script/XLibraryContainer.hpp> #include <com/sun/star/script/XPersistentLibraryContainer.hpp> +#include <scriptcont.hxx> + #include <memory> #include <vector> @@ -567,7 +569,7 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo ) copyToLibraryContainer( pLib, maContainerInfo ); if (rpBasLibInfo->HasPassword()) { - OldBasicPassword* pOldBasicPassword = + basic::SfxScriptLibraryContainer* pOldBasicPassword = maContainerInfo.mpOldBasicPassword; if( pOldBasicPassword ) { diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx index f80fd81791b0..2d0e8bcf3232 100644 --- a/basic/source/inc/scriptcont.hxx +++ b/basic/source/inc/scriptcont.hxx @@ -29,7 +29,7 @@ namespace basic { -class SfxScriptLibraryContainer final : public SfxLibraryContainer, public OldBasicPassword +class SfxScriptLibraryContainer final : public SfxLibraryContainer { css::uno::Reference< css::container::XNameAccess > mxCodeNameAccess; @@ -75,9 +75,6 @@ class SfxScriptLibraryContainer final : public SfxLibraryContainer, public OldBa virtual void onNewRootStorage() override; - // OldBasicPassword interface - virtual void setLibraryPassword( const OUString& rLibraryName, const OUString& rPassword ) override; - virtual OUString getInfoFileName() const override; virtual OUString getOldInfoFileName() const override; virtual OUString getLibElementFileExtension() const override; @@ -99,6 +96,9 @@ public: // Methods XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; + + // Library password handling for 5.0 documents + void setLibraryPassword( const OUString& rLibraryName, const OUString& rPassword ); }; diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 52413b759d15..eea449ac47fc 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -87,7 +87,6 @@ OUString SfxScriptLibraryContainer::getLibrariesDir() const return sBasic; } -// OldBasicPassword interface void SfxScriptLibraryContainer::setLibraryPassword( const OUString& rLibraryName, const OUString& rPassword ) { try @@ -341,7 +340,7 @@ void SfxScriptLibraryContainer::importFromOldStorage( const OUString& aFile ) auto pBasicManager = std::make_unique<BasicManager> ( *xStorage, aFile ); // Set info - LibraryContainerInfo aInfo( this, nullptr, static_cast< OldBasicPassword* >( this ) ); + LibraryContainerInfo aInfo( this, nullptr, this ); pBasicManager->SetLibraryContainerInfo( aInfo ); } } |