summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/sdi/_drvwsh.sdi5
-rw-r--r--sd/source/ui/app/popup2_tmpl.src1
-rw-r--r--sd/source/ui/view/drviews2.cxx47
3 files changed, 53 insertions, 0 deletions
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 4b09d0c9d29a..cc811d591d0a 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -80,6 +80,11 @@ interface DrawView
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
+ SID_EXTERNAL_EDIT
+ [
+ ExecMethod = FuTemporary ;
+ StateMethod = GetMenuState ;
+ ]
SID_CUT // ole : no, status : ?
[
ExecMethod = FuSupport ;
diff --git a/sd/source/ui/app/popup2_tmpl.src b/sd/source/ui/app/popup2_tmpl.src
index 67628796964c..4520e602ff4d 100644
--- a/sd/source/ui/app/popup2_tmpl.src
+++ b/sd/source/ui/app/popup2_tmpl.src
@@ -660,6 +660,7 @@
SEPARATOR
MenuItem { ITEM_SAVE_GRAPHIC };
MenuItem { ITEM_COMPRESS_GRAPHIC };
+ MenuItem { ITEM_EXTERNAL_EDIT };
};
};
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 75ff0f135d49..53e3a760036c 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -49,6 +49,7 @@
#include <svx/xlineit0.hxx>
#include <svx/graphichelper.hxx>
#include <svx/compressgraphicdialog.hxx>
+#include <svx/extedit.hxx>
#include <svx/svdoutl.hxx>
#include <svx/xlnwtit.hxx>
#include <svx/svdoattr.hxx>
@@ -93,6 +94,34 @@ 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 )
+ {
+ SdrPageView* pPageView = m_pView->GetSdrPageView();
+ if( pPageView )
+ {
+ SdrGrafObj* pNewObj = (SdrGrafObj*) m_pObj->Clone();
+ String aStr( m_pView->GetDescriptionOfMarkedObjects() );
+ aStr.Append( sal_Unicode(' ') );
+ aStr.Append( String( "External Edit" ) );
+ m_pView->BegUndo( aStr );
+ pNewObj->SetGraphicObject( aGraphic );
+ m_pView->ReplaceObjectAtView( m_pObj, *pPageView, pNewObj );
+ m_pView->EndUndo();
+ }
+ }
+};
+
/*************************************************************************
|*
|* SfxRequests fuer temporaere Funktionen
@@ -950,6 +979,24 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
break;
+ case SID_EXTERNAL_EDIT:
+ {
+ const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
+ if( rMarkList.GetMarkCount() == 1 )
+ {
+ 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 );
+ }
+ }
+ Cancel();
+ rReq.Ignore();
+ }
+ break;
+
case SID_COMPRESS_GRAPHIC:
{
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();