summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-01-16 23:56:09 +0100
committerAndras Timar <andras.timar@collabora.com>2015-01-24 16:54:41 +0100
commitafb670be78890117dfc76d7f17880a3fd4317839 (patch)
tree0c04ba7768b95d79c352e1cfab35d94689d046fd /sc/source
parent43232c398e75df015f8c12687e780fd412370c0a (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 sd/source/ui/inc/DrawViewShell.hxx sd/source/ui/view/drviews2.cxx svx/source/core/extedit.cxx sw/source/core/uibase/shells/grfsh.cxx Converted to C++98. Change-Id: I35f187f0828097a05618dc1733dce819fc6bffc6 Reviewed-on: https://gerrit.libreoffice.org/13994 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx32
-rw-r--r--sc/source/ui/inc/graphsh.hxx4
2 files changed, 8 insertions, 28 deletions
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 67e3ca4f33e6..ae967cd28cd3 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 = (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))
@@ -187,9 +162,10 @@ void ScGraphicShell::ExecuteExternalEdit( SfxRequest& )
if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
{
- GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
- ScExternalToolEdit* aExternalToolEdit = new ScExternalToolEdit( pView, pObj );
- aExternalToolEdit->Edit( &aGraphicObject );
+ GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
+ m_ExternalEdits.push_back( boost::shared_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..677bd72fb08e 100644
--- a/sc/source/ui/inc/graphsh.hxx
+++ b/sc/source/ui/inc/graphsh.hxx
@@ -24,7 +24,9 @@
#include "shellids.hxx"
#include <sfx2/module.hxx>
#include <svx/svdmark.hxx>
+#include <boost/shared_ptr.hpp>
+class SdrExternalToolEdit;
class ScViewData;
#include "drawsh.hxx"
@@ -36,6 +38,8 @@ public:
SFX_DECL_INTERFACE(SCID_GRAPHIC_SHELL)
private:
+ std::vector<boost::shared_ptr<SdrExternalToolEdit> > m_ExternalEdits;
+
/// SfxInterface initializer.
static void InitInterface_Impl();