25 #include <document.hxx>
28 #include <com/sun/star/sheet/XVolatileResult.hpp>
37 const uno::Reference<sheet::XVolatileResult>& xVR,
ScDocument* pDoc )
41 aAllListeners.push_back( xNew );
44 xVR->addResultListener( xNew );
53 pDocs->insert( pDoc );
63 sheet::XVolatileResult* pComp = xVR.get();
67 if ( pComp == listener->xVolRes.get() )
69 pLst = listener.get();
83 ScAddInDocs::iterator iter2 = p->find( pDocumentP );
84 if( iter2 != p->end() )
89 if ( (*iter)->xVolRes.is() )
90 (*iter)->xVolRes->removeResultListener( *iter );
112 for (
auto const& pDoc : *
pDocs)
124 uno::Reference<sheet::XResultListener> xKeepAlive(
this );
128 xVolRes->removeResultListener(
this );
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
std::set< ScDocument * > ScAddInDocs
ScAddInListener(css::uno::Reference< css::sheet::XVolatileResult > const &xVR, ScDocument *pD)
void Broadcast(const SfxHint &rHint)
virtual ~ScAddInListener() override
void TrackFormulas(SfxHintId nHintId=SfxHintId::ScDataChanged)
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
static::std::vector< rtl::Reference< ScAddInListener > > aAllListeners
virtual void SAL_CALL modified(const css::sheet::ResultEvent &aEvent) override
static void RemoveDocument(ScDocument *pDocument)
std::unique_ptr< ScAddInDocs > pDocs
SfxObjectShell * GetDocumentShell() const
static ScAddInListener * CreateListener(const css::uno::Reference< css::sheet::XVolatileResult > &xVR, ScDocument *pDoc)
static ScAddInListener * Get(const css::uno::Reference< css::sheet::XVolatileResult > &xVR)
css::uno::Reference< css::sheet::XVolatileResult > xVolRes