예제 #1
0
/*!
 * This virtual method is called if the attached document is deleted with an attached
 * AbiCollab_Export connected to the document.
 */
void ABI_Collab_Export::removeDocument(void)
{
	UT_DEBUGMSG(("ABI_Collab_Export::removeDocument()\n"));

	// inform the session manager that this session is being (forcefully) closed
	AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
	UT_return_if_fail(pManager);
	
	// WARNING: Don't do anything after this line, as the disconnectSession() call will
	// have destroyed ourselves (yes, that is ugly).
	pManager->disconnectSession(m_pAbiCollab);
}
예제 #2
0
/*!
 * This virtual method is called from the AbiWord main tree upon doing a replace document with an attached
 * AbiCollab_Export connected to the document.
 *
 * Note: this is a really weird signal, coming from a PD_Document
 * Note: If anything, a Frame should emit this signal to its listeners
 */
void ABI_Collab_Export::setNewDocument(PD_Document * /*pDoc*/)
{
	UT_DEBUGMSG(("ABI_Collab_Export::setNewDocument()\n"));
	
	// inform the session manager to kill off this session, as that is the only
	// thing we can do if the document is replaced
	AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
	UT_return_if_fail(pManager);

	// WARNING: Don't do anything after this line, as the disconnectSession() call will
	// have destroyed ourselves (yes, that is ugly).
	pManager->disconnectSession(m_pAbiCollab);

	// FIXME: The AbiCollab destructor will unregister this object as a PD_Document listener,
	// while the PD_Document will also unregister us as soon as this function returns.
	// Unregistering the same object twice works, but it is ugly as hell. Fix this someday.
}