Kaydet (Commit) 7895ebda authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Add "External Edit" menu function for bitmaps to Impress and Draw

Change-Id: I77f2c03d9e4aadebe2468c13f0a703eb389155d7
üst bd24ac7c
......@@ -80,6 +80,11 @@ interface DrawView
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
SID_EXTERNAL_EDIT
[
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
SID_CUT // ole : no, status : ?
[
ExecMethod = FuSupport ;
......
......@@ -660,6 +660,7 @@
SEPARATOR
MenuItem { ITEM_SAVE_GRAPHIC };
MenuItem { ITEM_COMPRESS_GRAPHIC };
MenuItem { ITEM_EXTERNAL_EDIT };
};
};
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment