From 5f6bdce0c0ac687f418821ce328f2987bf340cda Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 16 Jan 2015 23:56:09 +0100 Subject: rhbz#1136013: svx: try to make the ExternalToolEdit not crash all the time This thing was starting a timer that re-starts itself forever, and when the file it was watching changed, it would just assume the drawing objects were still there (and the document, for that matter...) Change-Id: I35f187f0828097a05618dc1733dce819fc6bffc6 --- include/svx/extedit.hxx | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'include/svx') diff --git a/include/svx/extedit.hxx b/include/svx/extedit.hxx index dc0c48917d06..65e178d74762 100644 --- a/include/svx/extedit.hxx +++ b/include/svx/extedit.hxx @@ -10,30 +10,51 @@ #ifndef INCLUDED_SVX_EXTEDIT_HXX #define INCLUDED_SVX_EXTEDIT_HXX -#include -#include -#include -#include -#include #include +#include +#include +#include + +class Graphic; +class GraphicObject; +class FileChangedChecker; class SVX_DLLPUBLIC ExternalToolEdit { -public: - GraphicObject* m_pGraphicObject; +protected: OUString m_aFileName; + ::std::unique_ptr m_pChecker; + +public: + ExternalToolEdit(); virtual ~ExternalToolEdit(); virtual void Update( Graphic& aGraphic ) = 0; - void Edit( GraphicObject *pGraphic ); + void Edit(GraphicObject const*const pGraphic); - DECL_LINK( StartListeningEvent, void *pEvent ); + void StartListeningEvent(); - static void threadWorker( void *pThreadData ); static void HandleCloseEvent( ExternalToolEdit* pData ); }; +class FmFormView; +class SdrObject; + +class SVX_DLLPUBLIC SdrExternalToolEdit + : public ExternalToolEdit + , public SfxListener +{ +private: + FmFormView * m_pView; + SdrObject * m_pObj; + + SAL_DLLPRIVATE virtual void Update(Graphic&) SAL_OVERRIDE; + SAL_DLLPRIVATE virtual void Notify(SfxBroadcaster&, const SfxHint&) SAL_OVERRIDE; + +public: + SdrExternalToolEdit(FmFormView * pView, SdrObject * pObj); +}; #endif -- cgit