don't create the document BasicManager on save to check module sizes
Creating it loads every Basic library of the document. Only an existing BasicManager can have loaded the password protected modules that the size check looks at. Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I1a66c4738d9a91cda785f0603c6f4fd6e6549802 Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13628 Reviewed-by: Noel Grandin <noel.grandin@collabora.com> (cherry picked from commit 35fb01a50f47698e9b059b75c2a3b88699579fac) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211524 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
committed by
Xisco Fauli
parent
371bfd404f
commit
a1fa358d47
@@ -79,6 +79,7 @@ namespace basic
|
||||
static ImplRepository& Instance();
|
||||
|
||||
BasicManager* getDocumentBasicManager( const Reference< XModel >& _rxDocumentModel );
|
||||
BasicManager* getExistingDocumentBasicManager( const Reference< XModel >& _rxDocumentModel ) const;
|
||||
BasicManager* getOrCreateApplicationBasicManager();
|
||||
static BasicManager* getApplicationBasicManager();
|
||||
static void setApplicationBasicManager( std::unique_ptr<BasicManager> _pBasicManager );
|
||||
@@ -236,6 +237,15 @@ namespace basic
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BasicManager* ImplRepository::getExistingDocumentBasicManager( const Reference< XModel >& _rxDocumentModel ) const
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
Reference< XInterface > xNormalized( _rxDocumentModel, UNO_QUERY );
|
||||
auto const loc = m_aStore.find( xNormalized );
|
||||
return loc != m_aStore.end() ? loc->second.get() : nullptr;
|
||||
}
|
||||
|
||||
BasicManager* ImplRepository::getOrCreateApplicationBasicManager()
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
@@ -600,6 +610,11 @@ namespace basic
|
||||
return ImplRepository::Instance().getDocumentBasicManager( _rxDocumentModel );
|
||||
}
|
||||
|
||||
BasicManager* BasicManagerRepository::getExistingDocumentBasicManager( const Reference< XModel >& _rxDocumentModel )
|
||||
{
|
||||
return ImplRepository::Instance().getExistingDocumentBasicManager( _rxDocumentModel );
|
||||
}
|
||||
|
||||
BasicManager* BasicManagerRepository::getApplicationBasicManager()
|
||||
{
|
||||
return ImplRepository::Instance().getOrCreateApplicationBasicManager();
|
||||
|
||||
Reference in New Issue
Block a user