summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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 'sd')
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx4
-rw-r--r--sd/source/ui/view/drviews2.cxx35
-rw-r--r--sd/source/ui/view/drviewsa.cxx1
3 files changed, 10 insertions, 30 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 96c5c9c94de6..a7b33d1ceb83 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -30,8 +30,10 @@
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/scanner/XScannerManager2.hpp>
#include <unotools/caserotate.hxx>
+#include <boost/shared_ptr.hpp>
class SdPage;
+class SdrExternalToolEdit;
class DrawDocShell;
class TabBar;
class SdrObject;
@@ -501,6 +503,8 @@ private:
::std::auto_ptr< AnnotationManager > mpAnnotationManager;
::std::auto_ptr< ViewOverlayManager > mpViewOverlayManager;
+
+ std::vector<boost::shared_ptr<SdrExternalToolEdit> > m_ExternalEdits;
};
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 384a6c7da817..688432e88a86 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -186,33 +186,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 = (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
*/
@@ -1001,9 +974,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
{
- GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
- SdExternalToolEdit* aExternalToolEdit = new SdExternalToolEdit( mpDrawView, pObj );
- aExternalToolEdit->Edit( &aGraphicObject );
+ GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
+ m_ExternalEdits.push_back(
+ boost::shared_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 8e1e09dd35cb..e26759e7da1f 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -45,6 +45,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"