summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/app/popup2_tmpl.src1
-rw-r--r--sd/source/ui/view/drviews2.cxx34
-rw-r--r--sd/source/ui/view/drviewsj.cxx6
3 files changed, 39 insertions, 2 deletions
diff --git a/sd/source/ui/app/popup2_tmpl.src b/sd/source/ui/app/popup2_tmpl.src
index abf411542ee3..67628796964c 100644
--- a/sd/source/ui/app/popup2_tmpl.src
+++ b/sd/source/ui/app/popup2_tmpl.src
@@ -659,6 +659,7 @@
MN_STYLEDT
SEPARATOR
MenuItem { ITEM_SAVE_GRAPHIC };
+ MenuItem { ITEM_COMPRESS_GRAPHIC };
};
};
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index c4630c2831f2..75ff0f135d49 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -48,6 +48,7 @@
#include <editeng/flditem.hxx>
#include <svx/xlineit0.hxx>
#include <svx/graphichelper.hxx>
+#include <svx/compressgraphicdialog.hxx>
#include <svx/svdoutl.hxx>
#include <svx/xlnwtit.hxx>
#include <svx/svdoattr.hxx>
@@ -949,6 +950,39 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
break;
+ case SID_COMPRESS_GRAPHIC:
+ {
+ 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() );
+ {
+ CompressGraphicsDialog dialog( GetParentWindow(), aGraphicObject.GetGraphic(), pObj->GetLogicRect().GetSize(), GetViewFrame()->GetBindings() );
+ if ( dialog.Execute() == RET_OK )
+ {
+ SdrGrafObj* pNewObject = (SdrGrafObj*) pObj->Clone();
+ const Graphic aNewGraphic = dialog.GetCompressedGraphic();
+ SdrPageView* pPageView = mpDrawView->GetSdrPageView();
+ pNewObject->SetEmptyPresObj( sal_False );
+ pNewObject->SetGraphic( aNewGraphic );
+ String aUndoString( mpDrawView->GetDescriptionOfMarkedObjects() );
+ aUndoString += (sal_Unicode) ( ' ' );
+ aUndoString += String( "Compress" );
+ mpDrawView->BegUndo( aUndoString );
+ mpDrawView->ReplaceObjectAtView( pObj, *pPageView, pNewObject );
+ mpDrawView->EndUndo();
+ }
+ }
+ }
+ }
+ Cancel();
+ rReq.Ignore();
+ }
+ break;
+
default:
{
// switch Anweisung wegen CLOOKS aufgeteilt. Alle case-Anweisungen die
diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index d6f2055e4ac5..0706bcdd4e58 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -71,9 +71,9 @@ namespace sd {
void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
{
- // Status der Menueintraege, bzw. Buttons
- // Einfachselektion
+ // Status of menu entries (Buttons,...)
+ // Single selection
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
sal_uLong nMarkCount = rMarkList.GetMarkCount();
@@ -119,6 +119,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_REVERSE_ORDER ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ORIGINAL_SIZE ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_SAVE_GRAPHIC ) ||
+ SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_COMPRESS_GRAPHIC ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_TEXTATTR_DLG ) )
{
const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
@@ -140,6 +141,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
if ( !( pObj->ISA( SdrGrafObj ) ) )
{
rSet.DisableItem(SID_SAVE_GRAPHIC);
+ rSet.DisableItem(SID_COMPRESS_GRAPHIC);
}
// Wenn es sich um kein Gruppenobjekt oder 3D-Objekt handelt