diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-01-16 23:56:09 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-01-17 01:03:30 +0100 |
commit | 5f6bdce0c0ac687f418821ce328f2987bf340cda (patch) | |
tree | e59f769e234d5feee4a54d60f8c2ac9e1a21f920 /sd | |
parent | 3b70717f02d5f2f255de078bd277e8662884bfb0 (diff) |
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
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/DrawViewShell.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 33 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsa.cxx | 1 |
3 files changed, 8 insertions, 29 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 411090716875..8a92f42828ce 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -33,6 +33,7 @@ class Outliner; class SdPage; +class SdrExternalToolEdit; class DrawDocShell; class TabBar; class SdrObject; @@ -507,6 +508,8 @@ private: ::std::unique_ptr< AnnotationManager > mpAnnotationManager; ::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager; + + std::vector<std::unique_ptr<SdrExternalToolEdit>> m_ExternalEdits; }; } // end of namespace sd diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 5b4517ee2657..f30b974c8f65 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -185,33 +185,6 @@ using namespace ::com::sun::star::uno; namespace sd { -class SdExternalToolEdit : public ExternalToolEdit -{ - FmFormView* m_pView; - SdrObject* m_pObj; - -public: - SdExternalToolEdit ( FmFormView* pView, SdrObject* pObj ) : - m_pView (pView), - m_pObj (pObj) - {} - - virtual void Update( Graphic& aGraphic ) SAL_OVERRIDE - { - SdrPageView* pPageView = m_pView->GetSdrPageView(); - if( pPageView ) - { - SdrGrafObj* pNewObj = static_cast<SdrGrafObj*>( m_pObj->Clone() ); - OUString aStr = m_pView->GetDescriptionOfMarkedObjects(); - aStr += " External Edit"; - m_pView->BegUndo( aStr ); - pNewObj->SetGraphicObject( aGraphic ); - m_pView->ReplaceObjectAtView( m_pObj, *pPageView, pNewObj ); - m_pView->EndUndo(); - } - } -}; - /** * SfxRequests for temporary actions */ @@ -999,8 +972,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); - SdExternalToolEdit* aExternalToolEdit = new SdExternalToolEdit( mpDrawView, pObj ); - aExternalToolEdit->Edit( &aGraphicObject ); + m_ExternalEdits.push_back( + std::unique_ptr<SdrExternalToolEdit>( + new SdrExternalToolEdit(mpDrawView, pObj))); + m_ExternalEdits.back()->Edit( &aGraphicObject ); } } Cancel(); diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index eb4a084fd886..0ab56de37e68 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -43,6 +43,7 @@ #include <svx/fmshell.hxx> #include <svtools/cliplistener.hxx> #include <svx/float3d.hxx> +#include <svx/extedit.hxx> #include <svx/sidebar/SelectionAnalyzer.hxx> #include "helpids.h" |