summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-01-16 23:56:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-01-19 12:28:41 +0000
commit0e0595c59ba399b265146c256bf0e0631623e898 (patch)
treef8d21e69e1f2e40ff40c615b05e2b69f0a179a95 /sc
parente02c897a4bbb33d8b506077048557d9c37bd8852 (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...) (cherry picked from commit 5f6bdce0c0ac687f418821ce328f2987bf340cda) Conflicts: sc/source/ui/drawfunc/graphsh.cxx Change-Id: I35f187f0828097a05618dc1733dce819fc6bffc6 Reviewed-on: https://gerrit.libreoffice.org/13995 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx30
-rw-r--r--sc/source/ui/inc/graphsh.hxx3
2 files changed, 6 insertions, 27 deletions
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index c74431a7619d..7017ee99aa01 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -38,31 +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, ScResId(SCSTR_GRAPHICSHELL))
@@ -188,8 +163,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();