Resolves: tdf#55566 opening two docs with open document macro events can crash
OfficeDocumentsManager::buildDocumentsList was set up to ignore disposed documents, but didn't ignore documents which were still uninitialized (i.e. waiting for the macro warning dialog of the other in-construction document to return a decision) Change-Id: I936e29ab6fad14a33609e8d57d11d7d0178075e4
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
#include "com/sun/star/frame/XStorable.hpp"
|
#include "com/sun/star/frame/XStorable.hpp"
|
||||||
#include "com/sun/star/frame/ModuleManager.hpp"
|
#include "com/sun/star/frame/ModuleManager.hpp"
|
||||||
#include "com/sun/star/lang/DisposedException.hpp"
|
#include "com/sun/star/lang/DisposedException.hpp"
|
||||||
|
#include "com/sun/star/lang/NotInitializedException.hpp"
|
||||||
#include "com/sun/star/util/XCloseBroadcaster.hpp"
|
#include "com/sun/star/util/XCloseBroadcaster.hpp"
|
||||||
|
|
||||||
#include "tdoc_docmgr.hxx"
|
#include "tdoc_docmgr.hxx"
|
||||||
@@ -411,10 +412,8 @@ void SAL_CALL OfficeDocumentsManager::documentEventOccured(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// lang::XDocumentEventListener (base of document::XDocumentEventListener)
|
// lang::XDocumentEventListener (base of document::XDocumentEventListener)
|
||||||
|
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
void SAL_CALL OfficeDocumentsManager::disposing(
|
void SAL_CALL OfficeDocumentsManager::disposing(
|
||||||
const lang::EventObject& /*Source*/ )
|
const lang::EventObject& /*Source*/ )
|
||||||
@@ -422,10 +421,8 @@ void SAL_CALL OfficeDocumentsManager::disposing(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Non-interface.
|
// Non-interface.
|
||||||
|
|
||||||
|
|
||||||
void OfficeDocumentsManager::buildDocumentsList()
|
void OfficeDocumentsManager::buildDocumentsList()
|
||||||
{
|
{
|
||||||
uno::Reference< container::XEnumeration > xEnum
|
uno::Reference< container::XEnumeration > xEnum
|
||||||
@@ -491,12 +488,16 @@ void OfficeDocumentsManager::buildDocumentsList()
|
|||||||
catch ( lang::DisposedException const & )
|
catch ( lang::DisposedException const & )
|
||||||
{
|
{
|
||||||
// Note: Due to race conditions the XEnumeration can
|
// Note: Due to race conditions the XEnumeration can
|
||||||
// contains docs that already have been closed
|
// contain docs that have already been closed
|
||||||
|
}
|
||||||
|
catch ( lang::NotInitializedException const & )
|
||||||
|
{
|
||||||
|
// Note: Due to race conditions the XEnumeration can
|
||||||
|
// contain docs that are still uninitialized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uno::Reference< embed::XStorage >
|
uno::Reference< embed::XStorage >
|
||||||
OfficeDocumentsManager::queryStorage( const OUString & rDocId )
|
OfficeDocumentsManager::queryStorage( const OUString & rDocId )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user