diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2012-10-03 21:37:14 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2012-10-04 07:45:39 +0200 |
commit | 7895ebdab0b0ed7d2a9b361d6d5ab02b0e9361d6 (patch) | |
tree | 8c642583c0da5267f774d408a9fefbbcc42f31c1 /sd | |
parent | bd24ac7cb585392d42c113e3547c3074ca3f745c (diff) |
Add "External Edit" menu function for bitmaps to Impress and Draw
Change-Id: I77f2c03d9e4aadebe2468c13f0a703eb389155d7
Diffstat (limited to 'sd')
-rw-r--r-- | sd/sdi/_drvwsh.sdi | 5 | ||||
-rw-r--r-- | sd/source/ui/app/popup2_tmpl.src | 1 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 47 |
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(); |