summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-01-16 23:56:09 +0100
committerMichael Stahl <mstahl@redhat.com>2015-01-17 01:03:30 +0100
commit5f6bdce0c0ac687f418821ce328f2987bf340cda (patch)
treee59f769e234d5feee4a54d60f8c2ac9e1a21f920 /sc
parent3b70717f02d5f2f255de078bd277e8662884bfb0 (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 'sc')
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx31
-rw-r--r--sc/source/ui/inc/graphsh.hxx3
2 files changed, 6 insertions, 28 deletions
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 5284efb5f59b..b98f92be1f57 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -38,32 +38,6 @@
#define ScGraphicShell
#include "scslots.hxx"
-class ScExternalToolEdit : public ExternalToolEdit
-{
- FmFormView* m_pView;
- SdrObject* m_pObj;
-
-public:
- ScExternalToolEdit ( 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() + " External Edit";
- m_pView->BegUndo( aStr );
- pNewObj->SetGraphicObject( aGraphic );
- m_pView->ReplaceObjectAtView( m_pObj, *pPageView, pNewObj );
- m_pView->EndUndo();
- }
- }
-};
-
SFX_IMPL_INTERFACE(ScGraphicShell, ScDrawShell)
void ScGraphicShell::InitInterface_Impl()
@@ -188,8 +162,9 @@ void ScGraphicShell::ExecuteExternalEdit( SfxRequest& )
if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
- ScExternalToolEdit* aExternalToolEdit = new ScExternalToolEdit( pView, pObj );
- aExternalToolEdit->Edit( &aGraphicObject );
+ m_ExternalEdits.push_back( std::unique_ptr<SdrExternalToolEdit>(
+ new SdrExternalToolEdit(pView, pObj)));
+ m_ExternalEdits.back()->Edit( &aGraphicObject );
}
}
diff --git a/sc/source/ui/inc/graphsh.hxx b/sc/source/ui/inc/graphsh.hxx
index 866d527f27e4..59bd4a4f4047 100644
--- a/sc/source/ui/inc/graphsh.hxx
+++ b/sc/source/ui/inc/graphsh.hxx
@@ -25,6 +25,7 @@
#include <sfx2/module.hxx>
#include <svx/svdmark.hxx>
+class SdrExternalToolEdit;
class ScViewData;
#include "drawsh.hxx"
@@ -36,6 +37,8 @@ public:
SFX_DECL_INTERFACE(SCID_GRAPHIC_SHELL)
private:
+ std::vector<std::unique_ptr<SdrExternalToolEdit>> m_ExternalEdits;
+
/// SfxInterface initializer.
static void InitInterface_Impl();