2000-09-18 11:07:07 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 17:12:34 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 17:12:34 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 17:12:34 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 17:12:34 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 17:12:34 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 17:12:34 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 13:38:42 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
#include "DrawViewShell.hxx"
|
2008-01-28 07:57:15 -06:00
|
|
|
#include "ViewShellImplementation.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include <vcl/waitobj.hxx>
|
|
|
|
|
|
|
|
#ifndef _SVXIDS_HRC
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#endif
|
2006-12-12 12:15:11 -06:00
|
|
|
#include <svx/dialogs.hrc>
|
2000-09-18 11:07:07 -05:00
|
|
|
#ifndef _IMAPDLG_HXX
|
|
|
|
#include <svx/imapdlg.hxx>
|
|
|
|
#endif
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
#include <svx/svdogrp.hxx>
|
2001-09-10 05:38:27 -05:00
|
|
|
#include <svx/svdoole2.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
#include <svx/svdograf.hxx>
|
2006-12-12 12:15:11 -06:00
|
|
|
#include <svx/svxdlg.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
#ifndef _BINDING_HXX //autogen
|
2004-10-04 12:45:05 -05:00
|
|
|
#include <sfx2/bindings.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
#endif
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <svx/svdoole2.hxx>
|
2009-10-15 17:05:16 -05:00
|
|
|
#include <svl/style.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
#include <svx/svdpagv.hxx>
|
2000-11-24 11:54:34 -06:00
|
|
|
#include <svx/grafctrl.hxx>
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "stlsheet.hxx"
|
|
|
|
|
2004-10-04 12:45:05 -05:00
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "app.hrc"
|
|
|
|
#include "strings.hrc"
|
2002-10-17 10:31:49 -05:00
|
|
|
#include "helpids.h"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "misc.hxx"
|
2004-01-20 05:47:22 -06:00
|
|
|
#include "Window.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "imapinfo.hxx"
|
|
|
|
#include "futempl.hxx"
|
|
|
|
#include "fusel.hxx"
|
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include "drawdoc.hxx"
|
2004-01-20 05:47:22 -06:00
|
|
|
#include "DrawDocShell.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "drawview.hxx"
|
2006-12-12 12:15:11 -06:00
|
|
|
#include "sdabstdlg.hxx"
|
|
|
|
#include "brkdlg.hrc"
|
2004-01-20 05:47:22 -06:00
|
|
|
namespace sd {
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
#define MIN_ACTIONS_FOR_DIALOG 5000 // bei mehr als 1600 Metaobjekten
|
|
|
|
// wird beim Aufbrechen ein Dialog
|
|
|
|
// angezeigt.
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SfxRequests fuer temporaere Funktionen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
void DrawViewShell::FuTemp03(SfxRequest& rReq)
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
USHORT nSId = rReq.GetSlot();
|
|
|
|
switch( nSId )
|
|
|
|
{
|
|
|
|
case SID_GROUP: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsPresObjSelected( TRUE, TRUE, TRUE ) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-07-13 08:57:13 -05:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 11:07:07 -05:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->GroupMarked();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_UNGROUP: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->UnGroupMarked();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_NAME_GROUP:
|
|
|
|
{
|
2006-12-19 10:50:45 -06:00
|
|
|
// only allow for single object selection since the name of an object needs
|
|
|
|
// to be unique
|
|
|
|
if(1L == mpDrawView->GetMarkedObjectCount())
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-19 10:50:45 -06:00
|
|
|
// #i68101#
|
|
|
|
SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L);
|
|
|
|
OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
|
|
|
|
String aName(pSelected->GetName());
|
2002-03-13 09:44:45 -06:00
|
|
|
|
2006-12-19 10:50:45 -06:00
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
OSL_ENSURE(pFact, "Dialogdiet fail!");
|
2009-11-02 13:49:14 -06:00
|
|
|
AbstractSvxObjectNameDialog* pDlg = pFact->CreateSvxObjectNameDialog(NULL, aName);
|
2006-12-19 10:50:45 -06:00
|
|
|
OSL_ENSURE(pDlg, "Dialogdiet fail!");
|
2002-03-13 09:44:45 -06:00
|
|
|
|
2006-12-19 10:50:45 -06:00
|
|
|
pDlg->SetCheckNameHdl(LINK(this, DrawViewShell, NameObjectHdl));
|
2002-03-13 09:44:45 -06:00
|
|
|
|
2006-12-19 10:50:45 -06:00
|
|
|
if(RET_OK == pDlg->Execute())
|
2006-12-12 12:15:11 -06:00
|
|
|
{
|
2006-12-19 10:50:45 -06:00
|
|
|
pDlg->GetName(aName);
|
|
|
|
pSelected->SetName(aName);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete pDlg;
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
rBindings.Invalidate( SID_NAVIGATOR_STATE, TRUE, FALSE );
|
|
|
|
rBindings.Invalidate( SID_CONTEXT );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-12-19 10:50:45 -06:00
|
|
|
Cancel();
|
|
|
|
rReq.Ignore();
|
|
|
|
break;
|
|
|
|
}
|
2002-03-13 09:44:45 -06:00
|
|
|
|
2006-12-19 10:50:45 -06:00
|
|
|
// #i68101#
|
|
|
|
case SID_OBJECT_TITLE_DESCRIPTION:
|
|
|
|
{
|
|
|
|
if(1L == mpDrawView->GetMarkedObjectCount())
|
|
|
|
{
|
|
|
|
SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L);
|
|
|
|
OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
|
|
|
|
String aTitle(pSelected->GetTitle());
|
|
|
|
String aDescription(pSelected->GetDescription());
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-12-19 10:50:45 -06:00
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
OSL_ENSURE(pFact, "Dialogdiet fail!");
|
2009-11-02 13:49:14 -06:00
|
|
|
AbstractSvxObjectTitleDescDialog* pDlg = pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription);
|
2006-12-19 10:50:45 -06:00
|
|
|
OSL_ENSURE(pDlg, "Dialogdiet fail!");
|
2002-03-13 09:44:45 -06:00
|
|
|
|
2006-12-19 10:50:45 -06:00
|
|
|
if(RET_OK == pDlg->Execute())
|
|
|
|
{
|
|
|
|
pDlg->GetTitle(aTitle);
|
|
|
|
pDlg->GetDescription(aDescription);
|
|
|
|
pSelected->SetTitle(aTitle);
|
|
|
|
pSelected->SetDescription(aDescription);
|
2006-12-12 12:15:11 -06:00
|
|
|
}
|
2006-12-19 10:50:45 -06:00
|
|
|
|
|
|
|
delete pDlg;
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
2000-09-21 10:12:50 -05:00
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
rBindings.Invalidate( SID_NAVIGATOR_STATE, TRUE, FALSE );
|
|
|
|
rBindings.Invalidate( SID_CONTEXT );
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
2006-12-19 10:50:45 -06:00
|
|
|
rReq.Ignore();
|
|
|
|
break;
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
case SID_ENTER_GROUP: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->EnterMarkedGroup();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_LEAVE_GROUP: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->LeaveOneGroup();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_LEAVE_ALL_GROUPS: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->LeaveAllGroup();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_COMBINE: // BASIC
|
|
|
|
{
|
2001-06-14 05:23:28 -05:00
|
|
|
// #88224# End text edit to avoid conflicts
|
2006-12-12 12:15:11 -06:00
|
|
|
if(mpDrawView->IsTextEdit())
|
|
|
|
mpDrawView->SdrEndTextEdit();
|
2001-06-14 05:23:28 -05:00
|
|
|
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsPresObjSelected() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-07-13 08:57:13 -05:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 11:07:07 -05:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->CombineMarkedObjects(sal_False);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DISTRIBUTE_DLG:
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsPresObjSelected() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-07-13 08:57:13 -05:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 11:07:07 -05:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->DistributeMarkedObjects();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_POLY_MERGE:
|
|
|
|
{
|
2001-06-14 05:23:28 -05:00
|
|
|
// #88224# End text edit to avoid conflicts
|
2006-12-12 12:15:11 -06:00
|
|
|
if(mpDrawView->IsTextEdit())
|
|
|
|
mpDrawView->SdrEndTextEdit();
|
2001-06-14 05:23:28 -05:00
|
|
|
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsPresObjSelected() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-07-13 08:57:13 -05:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 11:07:07 -05:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->MergeMarkedObjects(SDR_MERGE_MERGE);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_POLY_SUBSTRACT:
|
|
|
|
{
|
2001-06-14 05:23:28 -05:00
|
|
|
// #88224# End text edit to avoid conflicts
|
2006-12-12 12:15:11 -06:00
|
|
|
if(mpDrawView->IsTextEdit())
|
|
|
|
mpDrawView->SdrEndTextEdit();
|
2001-06-14 05:23:28 -05:00
|
|
|
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsPresObjSelected() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-07-13 08:57:13 -05:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 11:07:07 -05:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->MergeMarkedObjects(SDR_MERGE_SUBSTRACT);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_POLY_INTERSECT:
|
|
|
|
{
|
2001-06-14 05:23:28 -05:00
|
|
|
// #88224# End text edit to avoid conflicts
|
2006-12-12 12:15:11 -06:00
|
|
|
if(mpDrawView->IsTextEdit())
|
|
|
|
mpDrawView->SdrEndTextEdit();
|
2001-06-14 05:23:28 -05:00
|
|
|
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsPresObjSelected() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-07-13 08:57:13 -05:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 11:07:07 -05:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->MergeMarkedObjects(SDR_MERGE_INTERSECT);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DISMANTLE: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsDismantlePossible(FALSE) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->DismantleMarkedObjects(FALSE);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONNECT: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsPresObjSelected() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-07-13 08:57:13 -05:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 11:07:07 -05:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->CombineMarkedObjects(sal_True);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_BREAK: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsTextEdit() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->SdrEndTextEdit();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsBreak3DObjPossible() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->Break3DObj();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2006-12-12 12:15:11 -06:00
|
|
|
else if ( mpDrawView->IsDismantlePossible(TRUE) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->DismantleMarkedObjects(TRUE);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
2006-12-12 12:15:11 -06:00
|
|
|
else if ( mpDrawView->IsImportMtfPossible() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
|
2000-09-18 11:07:07 -05:00
|
|
|
ULONG nAnz=rMarkList.GetMarkCount();
|
|
|
|
|
|
|
|
// Summe der Metaobjekte aller sel. Metafiles erm.
|
|
|
|
ULONG nCount = 0;
|
|
|
|
for(ULONG nm=0; nm<nAnz; nm++)
|
|
|
|
{
|
|
|
|
SdrMark* pM=rMarkList.GetMark(nm);
|
2006-07-25 05:50:11 -05:00
|
|
|
SdrObject* pObj=pM->GetMarkedSdrObj();
|
2000-09-18 11:07:07 -05:00
|
|
|
SdrGrafObj* pGraf=PTR_CAST(SdrGrafObj,pObj);
|
|
|
|
SdrOle2Obj* pOle2=PTR_CAST(SdrOle2Obj,pObj);
|
|
|
|
if (pGraf!=NULL && pGraf->HasGDIMetaFile())
|
|
|
|
nCount += pGraf->GetGraphic().GetGDIMetaFile().GetActionCount();
|
2004-10-04 12:45:05 -05:00
|
|
|
if(pOle2!=NULL && pOle2->GetGraphic())
|
|
|
|
nCount += pOle2->GetGraphic()->GetGDIMetaFile().GetActionCount();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// anhand der erm. Summe entscheiden ob mit
|
|
|
|
// oder ohne Dialog aufgebrochen wird.
|
|
|
|
if(nCount < MIN_ACTIONS_FOR_DIALOG)
|
|
|
|
{
|
|
|
|
// ohne Dialog aufbrechen
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->DoImportMarkedMtf();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
|
|
|
|
if( pFact )
|
|
|
|
{
|
|
|
|
VclAbstractDialog* pDlg = pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, nAnz );
|
|
|
|
if( pDlg )
|
|
|
|
{
|
|
|
|
pDlg->Execute();
|
|
|
|
delete pDlg;
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONVERT_TO_3D:
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( mpDrawView->IsPresObjSelected() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2004-07-13 08:57:13 -05:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 11:07:07 -05:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if (mpDrawView->IsConvertTo3DObjPossible())
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if (mpDrawView->IsTextEdit())
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->SdrEndTextEdit();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->ConvertMarkedObjTo3D(TRUE);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Cancel();
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_FRAME_TO_TOP: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->PutMarkedToTop();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
Invalidate( SID_POSITION );
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_MOREFRONT: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->MovMarkedToTop();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
Invalidate( SID_POSITION );
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_MOREBACK: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->MovMarkedToBtm();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
Invalidate( SID_POSITION );
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_FRAME_TO_BOTTOM: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->PutMarkedToBtm();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
Invalidate( SID_POSITION );
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_HORIZONTAL: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->MirrorAllMarkedHorizontal();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_VERTICAL: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->MirrorAllMarkedVertical();
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_OBJECT_ALIGN_LEFT: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->AlignMarkedObjects(SDRHALIGN_LEFT, SDRVALIGN_NONE);
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_OBJECT_ALIGN_CENTER: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->AlignMarkedObjects(SDRHALIGN_CENTER, SDRVALIGN_NONE);
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_OBJECT_ALIGN_RIGHT: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->AlignMarkedObjects(SDRHALIGN_RIGHT, SDRVALIGN_NONE);
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_OBJECT_ALIGN_UP: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_TOP);
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_OBJECT_ALIGN_MIDDLE: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_CENTER);
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_OBJECT_ALIGN_DOWN: // BASIC
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_BOTTOM);
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_SELECTALL: // BASIC
|
|
|
|
{
|
2005-12-14 10:28:57 -06:00
|
|
|
if( (dynamic_cast<FuSelection*>( GetOldFunction().get() ) != 0) &&
|
2004-07-13 08:57:13 -05:00
|
|
|
!GetView()->IsFrameDragSingles() && GetView()->HasMarkablePoints())
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if ( !mpDrawView->IsAction() )
|
|
|
|
mpDrawView->MarkAllPoints();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
else
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->SelectAll();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_STYLE_NEW: // BASIC ???
|
|
|
|
case SID_STYLE_APPLY:
|
|
|
|
case SID_STYLE_EDIT:
|
|
|
|
case SID_STYLE_DELETE:
|
|
|
|
case SID_STYLE_FAMILY:
|
|
|
|
case SID_STYLE_WATERCAN:
|
|
|
|
case SID_STYLE_UPDATE_BY_EXAMPLE:
|
|
|
|
case SID_STYLE_NEW_BY_EXAMPLE:
|
|
|
|
{
|
|
|
|
if( rReq.GetSlot() == SID_STYLE_EDIT && !rReq.GetArgs() )
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet();
|
2008-03-12 05:57:13 -05:00
|
|
|
if( pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE)
|
2000-09-18 11:07:07 -05:00
|
|
|
pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet();
|
|
|
|
|
2004-07-13 08:57:13 -05:00
|
|
|
if( (pStyleSheet == NULL) && GetView()->IsTextEdit() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-11-14 07:44:07 -06:00
|
|
|
GetView()->SdrEndTextEdit();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-12-12 12:15:11 -06:00
|
|
|
pStyleSheet = mpDrawView->GetStyleSheet();
|
2008-03-12 05:57:13 -05:00
|
|
|
if(pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE)
|
2000-09-18 11:07:07 -05:00
|
|
|
pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( pStyleSheet == NULL )
|
|
|
|
{
|
|
|
|
rReq.Ignore();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
SfxAllItemSet aSet(GetDoc()->GetPool());
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
SfxStringItem aStyleNameItem( SID_STYLE_EDIT, pStyleSheet->GetName() );
|
|
|
|
aSet.Put(aStyleNameItem);
|
|
|
|
|
2006-12-12 12:15:11 -06:00
|
|
|
SfxUInt16Item aStyleFamilyItem( SID_STYLE_FAMILY, (UINT16)pStyleSheet->GetFamily() );
|
2000-09-18 11:07:07 -05:00
|
|
|
aSet.Put(aStyleFamilyItem);
|
|
|
|
|
|
|
|
rReq.SetArgs(aSet);
|
|
|
|
}
|
|
|
|
|
|
|
|
if( rReq.GetArgs() )
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
SetCurrentFunction( FuTemplate::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
if( rReq.GetSlot() == SID_STYLE_APPLY )
|
2000-09-21 10:12:50 -05:00
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_STYLE_APPLY );
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
}
|
|
|
|
else if( rReq.GetSlot() == SID_STYLE_APPLY )
|
|
|
|
GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_DESIGNER, SFX_CALLMODE_ASYNCHRON );
|
|
|
|
rReq.Ignore ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_IMAP:
|
|
|
|
{
|
|
|
|
SvxIMapDlg* pDlg;
|
|
|
|
USHORT nId = SvxIMapDlgChildWindow::GetChildWindowId();
|
|
|
|
|
|
|
|
GetViewFrame()->ToggleChildWindow( nId );
|
2000-09-21 10:12:50 -05:00
|
|
|
GetViewFrame()->GetBindings().Invalidate( SID_IMAP );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2008-01-28 07:57:15 -06:00
|
|
|
if ( GetViewFrame()->HasChildWindow( nId )
|
|
|
|
&& ( ( pDlg = ViewShell::Implementation::GetImageMapDialog() ) != NULL ) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
if ( rMarkList.GetMarkCount() == 1 )
|
2006-07-25 05:50:11 -05:00
|
|
|
UpdateIMapDlg( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
Cancel();
|
|
|
|
rReq.Ignore ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_GRID_FRONT:
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->SetGridFront( !mpDrawView->IsGridFront() );
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_HELPLINES_FRONT:
|
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
mpDrawView->SetHlplFront( !mpDrawView->IsHlplFront() );
|
2000-09-18 11:07:07 -05:00
|
|
|
Cancel();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
FuTemp04(rReq);
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Liefert die globale/Haupt-ID zurueck, also die ID, ueber die die
|
|
|
|
|* Toolbox ausgeloest wird
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
USHORT DrawViewShell::GetIdBySubId( USHORT nSId )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
USHORT nMappedSId = 0;
|
|
|
|
switch( nSId )
|
|
|
|
{
|
|
|
|
case SID_OBJECT_ROTATE:
|
|
|
|
case SID_OBJECT_MIRROR:
|
|
|
|
case SID_OBJECT_TRANSPARENCE:
|
|
|
|
case SID_OBJECT_GRADIENT:
|
|
|
|
case SID_OBJECT_SHEAR:
|
|
|
|
case SID_OBJECT_CROOK_ROTATE:
|
|
|
|
case SID_OBJECT_CROOK_SLANT:
|
|
|
|
case SID_OBJECT_CROOK_STRETCH:
|
|
|
|
case SID_CONVERT_TO_3D_LATHE:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_OBJECT_CHOOSE_MODE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_OBJECT_ALIGN_LEFT:
|
|
|
|
case SID_OBJECT_ALIGN_CENTER:
|
|
|
|
case SID_OBJECT_ALIGN_RIGHT:
|
|
|
|
case SID_OBJECT_ALIGN_UP:
|
|
|
|
case SID_OBJECT_ALIGN_MIDDLE:
|
|
|
|
case SID_OBJECT_ALIGN_DOWN:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_OBJECT_ALIGN;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_FRAME_TO_TOP:
|
|
|
|
case SID_MOREFRONT:
|
|
|
|
case SID_MOREBACK:
|
|
|
|
case SID_FRAME_TO_BOTTOM:
|
|
|
|
case SID_BEFORE_OBJ:
|
|
|
|
case SID_BEHIND_OBJ:
|
|
|
|
case SID_REVERSE_ORDER:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_POSITION;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ZOOM_OUT:
|
|
|
|
case SID_ZOOM_IN:
|
|
|
|
case SID_SIZE_REAL:
|
|
|
|
case SID_ZOOM_PANNING:
|
|
|
|
case SID_SIZE_PAGE:
|
|
|
|
case SID_SIZE_PAGE_WIDTH:
|
|
|
|
case SID_SIZE_ALL:
|
|
|
|
case SID_SIZE_OPTIMAL:
|
|
|
|
case SID_ZOOM_NEXT:
|
|
|
|
case SID_ZOOM_PREV:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_ZOOM_TOOLBOX;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ATTR_CHAR:
|
|
|
|
case SID_TEXT_FITTOSIZE:
|
|
|
|
case SID_DRAW_CAPTION:
|
2004-04-02 06:25:41 -06:00
|
|
|
case SID_DRAW_FONTWORK:
|
|
|
|
case SID_DRAW_FONTWORK_VERTICAL:
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
nMappedSId = SID_DRAWTBX_TEXT;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DRAW_RECT:
|
|
|
|
case SID_DRAW_SQUARE:
|
|
|
|
case SID_DRAW_RECT_ROUND:
|
|
|
|
case SID_DRAW_SQUARE_ROUND:
|
|
|
|
case SID_DRAW_RECT_NOFILL:
|
|
|
|
case SID_DRAW_SQUARE_NOFILL:
|
|
|
|
case SID_DRAW_RECT_ROUND_NOFILL:
|
|
|
|
case SID_DRAW_SQUARE_ROUND_NOFILL:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_DRAWTBX_RECTANGLES;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DRAW_ELLIPSE:
|
|
|
|
case SID_DRAW_CIRCLE:
|
|
|
|
case SID_DRAW_PIE:
|
|
|
|
case SID_DRAW_CIRCLEPIE:
|
|
|
|
case SID_DRAW_ELLIPSECUT:
|
|
|
|
case SID_DRAW_CIRCLECUT:
|
|
|
|
case SID_DRAW_ARC:
|
|
|
|
case SID_DRAW_CIRCLEARC:
|
|
|
|
case SID_DRAW_ELLIPSE_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLE_NOFILL:
|
|
|
|
case SID_DRAW_PIE_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLEPIE_NOFILL:
|
|
|
|
case SID_DRAW_ELLIPSECUT_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLECUT_NOFILL:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_DRAWTBX_ELLIPSES;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DRAW_BEZIER_NOFILL:
|
|
|
|
case SID_DRAW_POLYGON_NOFILL:
|
|
|
|
case SID_DRAW_XPOLYGON_NOFILL:
|
|
|
|
case SID_DRAW_FREELINE_NOFILL:
|
|
|
|
case SID_DRAW_BEZIER_FILL:
|
|
|
|
case SID_DRAW_POLYGON:
|
|
|
|
case SID_DRAW_XPOLYGON:
|
|
|
|
case SID_DRAW_FREELINE:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_DRAWTBX_LINES;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DRAW_LINE:
|
|
|
|
case SID_DRAW_XLINE:
|
|
|
|
case SID_DRAW_MEASURELINE:
|
|
|
|
case SID_LINE_ARROW_START:
|
|
|
|
case SID_LINE_ARROW_END:
|
|
|
|
case SID_LINE_ARROWS:
|
|
|
|
case SID_LINE_ARROW_CIRCLE:
|
|
|
|
case SID_LINE_CIRCLE_ARROW:
|
|
|
|
case SID_LINE_ARROW_SQUARE:
|
|
|
|
case SID_LINE_SQUARE_ARROW:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_DRAWTBX_ARROWS;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_3D_CUBE:
|
|
|
|
case SID_3D_TORUS:
|
|
|
|
case SID_3D_SPHERE:
|
|
|
|
case SID_3D_SHELL:
|
|
|
|
case SID_3D_HALF_SPHERE:
|
|
|
|
case SID_3D_CYLINDER:
|
|
|
|
case SID_3D_CONE:
|
|
|
|
case SID_3D_PYRAMID:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_DRAWTBX_3D_OBJECTS;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_INSERT_DIAGRAM:
|
|
|
|
#ifdef STARIMAGE_AVAILABLE
|
|
|
|
case SID_INSERT_IMAGE:
|
|
|
|
#endif
|
|
|
|
case SID_ATTR_TABLE:
|
|
|
|
case SID_INSERTFILE:
|
|
|
|
case SID_INSERT_GRAPHIC:
|
2004-08-12 03:19:29 -05:00
|
|
|
case SID_INSERT_AVMEDIA:
|
2000-09-18 11:07:07 -05:00
|
|
|
case SID_INSERTPAGE:
|
|
|
|
case SID_INSERT_MATH:
|
|
|
|
case SID_INSERT_FLOATINGFRAME:
|
|
|
|
case SID_INSERT_OBJECT:
|
|
|
|
case SID_INSERT_PLUGIN:
|
|
|
|
case SID_INSERT_SOUND:
|
|
|
|
case SID_INSERT_VIDEO:
|
|
|
|
case SID_INSERT_APPLET:
|
2008-03-12 05:57:13 -05:00
|
|
|
case SID_INSERT_TABLE:
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
nMappedSId = SID_DRAWTBX_INSERT;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_TOOL_CONNECTOR:
|
|
|
|
case SID_CONNECTOR_ARROW_START:
|
|
|
|
case SID_CONNECTOR_ARROW_END:
|
|
|
|
case SID_CONNECTOR_ARROWS:
|
|
|
|
case SID_CONNECTOR_CIRCLE_START:
|
|
|
|
case SID_CONNECTOR_CIRCLE_END:
|
|
|
|
case SID_CONNECTOR_CIRCLES:
|
|
|
|
case SID_CONNECTOR_LINE:
|
|
|
|
case SID_CONNECTOR_LINE_ARROW_START:
|
|
|
|
case SID_CONNECTOR_LINE_ARROW_END:
|
|
|
|
case SID_CONNECTOR_LINE_ARROWS:
|
|
|
|
case SID_CONNECTOR_LINE_CIRCLE_START:
|
|
|
|
case SID_CONNECTOR_LINE_CIRCLE_END:
|
|
|
|
case SID_CONNECTOR_LINE_CIRCLES:
|
|
|
|
case SID_CONNECTOR_CURVE:
|
|
|
|
case SID_CONNECTOR_CURVE_ARROW_START:
|
|
|
|
case SID_CONNECTOR_CURVE_ARROW_END:
|
|
|
|
case SID_CONNECTOR_CURVE_ARROWS:
|
|
|
|
case SID_CONNECTOR_CURVE_CIRCLE_START:
|
|
|
|
case SID_CONNECTOR_CURVE_CIRCLE_END:
|
|
|
|
case SID_CONNECTOR_CURVE_CIRCLES:
|
|
|
|
case SID_CONNECTOR_LINES:
|
|
|
|
case SID_CONNECTOR_LINES_ARROW_START:
|
|
|
|
case SID_CONNECTOR_LINES_ARROW_END:
|
|
|
|
case SID_CONNECTOR_LINES_ARROWS:
|
|
|
|
case SID_CONNECTOR_LINES_CIRCLE_START:
|
|
|
|
case SID_CONNECTOR_LINES_CIRCLE_END:
|
|
|
|
case SID_CONNECTOR_LINES_CIRCLES:
|
|
|
|
{
|
|
|
|
nMappedSId = SID_DRAWTBX_CONNECTORS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return( nMappedSId );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Fuellt das SlotArray, um das aktuelle Mapping des ToolboxSlots zu
|
|
|
|
|* bekommen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
void DrawViewShell::MapSlot( USHORT nSId )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
USHORT nMappedSId = GetIdBySubId( nSId );
|
|
|
|
|
|
|
|
if( nMappedSId > 0 )
|
|
|
|
{
|
|
|
|
USHORT nID = GetArrayId( nMappedSId ) + 1;
|
2006-12-12 12:15:11 -06:00
|
|
|
mpSlotArray[ nID ] = nSId;
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Ermoeglicht ueber das SlotArray ein ImageMapping
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
void DrawViewShell::UpdateToolboxImages( SfxItemSet &rSet, BOOL bPermanent )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
if( !bPermanent )
|
|
|
|
{
|
|
|
|
USHORT nId = GetArrayId( SID_ZOOM_TOOLBOX ) + 1;
|
2006-12-12 12:15:11 -06:00
|
|
|
rSet.Put( TbxImageItem( SID_ZOOM_TOOLBOX, mpSlotArray[nId] ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
nId = GetArrayId( SID_DRAWTBX_INSERT ) + 1;
|
2006-12-12 12:15:11 -06:00
|
|
|
rSet.Put( TbxImageItem( SID_DRAWTBX_INSERT, mpSlotArray[nId] ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
nId = GetArrayId( SID_POSITION ) + 1;
|
2006-12-12 12:15:11 -06:00
|
|
|
rSet.Put( TbxImageItem( SID_POSITION, mpSlotArray[nId] ) );
|
2001-06-07 02:53:13 -05:00
|
|
|
|
|
|
|
nId = GetArrayId( SID_OBJECT_ALIGN ) + 1;
|
2006-12-12 12:15:11 -06:00
|
|
|
rSet.Put( TbxImageItem( SID_OBJECT_ALIGN, mpSlotArray[nId] ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-02-13 05:43:44 -06:00
|
|
|
for( USHORT nId = 0; nId < SLOTARRAY_COUNT; nId += 2 )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
rSet.Put( TbxImageItem( mpSlotArray[nId], mpSlotArray[nId+1] ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Gibt den gemappten Slot zurueck
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
USHORT DrawViewShell::GetMappedSlot( USHORT nSId )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
USHORT nSlot = 0;
|
|
|
|
USHORT nId = GetArrayId( nSId );
|
|
|
|
if( nId != USHRT_MAX )
|
2006-12-12 12:15:11 -06:00
|
|
|
nSlot = mpSlotArray[ nId+1 ];
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
// Wenn der Slot noch auf sich selbst gemapped ist, muss 0 zurueck-
|
|
|
|
// gegeben werden, da sonst der Slot immer wieder selbst executet
|
|
|
|
// wird. Im Array ist der Slot selbst initial vorhanden, damit das
|
|
|
|
// Image richtig angezeigt wird.
|
|
|
|
if( nSId == nSlot )
|
|
|
|
return( 0 );
|
|
|
|
|
|
|
|
return( nSlot );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Gibt die Nummer des HauptSlots im SlotArray zurueck
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
USHORT DrawViewShell::GetArrayId( USHORT nSId )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
for( USHORT i = 0; i < SLOTARRAY_COUNT; i += 2 )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if( mpSlotArray[ i ] == nSId )
|
2000-09-18 11:07:07 -05:00
|
|
|
return( i );
|
|
|
|
}
|
|
|
|
DBG_ERROR( "Slot im Array nicht gefunden!" );
|
|
|
|
return( USHRT_MAX );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* IMap-Dlg updaten
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 12:15:11 -06:00
|
|
|
if( ( pObj->ISA( SdrGrafObj ) || pObj->ISA( SdrOle2Obj ) ) && !mpDrawView->IsTextEdit() &&
|
2000-09-18 11:07:07 -05:00
|
|
|
GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) )
|
|
|
|
{
|
|
|
|
Graphic aGraphic;
|
|
|
|
ImageMap* pIMap = NULL;
|
|
|
|
TargetList* pTargetList = NULL;
|
2004-01-20 05:47:22 -06:00
|
|
|
SdIMapInfo* pIMapInfo = GetDoc()->GetIMapInfo( pObj );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-12-12 12:15:11 -06:00
|
|
|
// get graphic from shape
|
|
|
|
SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( pObj );
|
|
|
|
if( pGrafObj )
|
|
|
|
aGraphic = pGrafObj->GetGraphic();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
if ( pIMapInfo )
|
|
|
|
{
|
|
|
|
pIMap = (ImageMap*) &pIMapInfo->GetImageMap();
|
|
|
|
pTargetList = new TargetList;
|
|
|
|
GetViewFrame()->GetTargetList( *pTargetList );
|
|
|
|
}
|
|
|
|
|
|
|
|
SvxIMapDlgChildWindow::UpdateIMapDlg( aGraphic, pIMap, pTargetList, pObj );
|
|
|
|
|
|
|
|
// TargetListe kann von uns wieder geloescht werden
|
|
|
|
if ( pTargetList )
|
|
|
|
{
|
|
|
|
String* pEntry = pTargetList->First();
|
|
|
|
while( pEntry )
|
|
|
|
{
|
|
|
|
delete pEntry;
|
|
|
|
pEntry = pTargetList->Next();
|
|
|
|
}
|
|
|
|
|
|
|
|
delete pTargetList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-03-13 09:44:45 -06:00
|
|
|
// -----------------------------------------------------------------------------
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-02-04 03:22:43 -06:00
|
|
|
IMPL_LINK( DrawViewShell, NameObjectHdl, AbstractSvxNameDialog*, pDialog )
|
2002-03-13 09:44:45 -06:00
|
|
|
{
|
|
|
|
String aName;
|
|
|
|
|
|
|
|
if( pDialog )
|
|
|
|
pDialog->GetName( aName );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-01-20 05:47:22 -06:00
|
|
|
return( ( !aName.Len() || ( GetDoc() && !GetDoc()->GetObj( aName ) ) ) ? 1 : 0 );
|
2002-03-13 09:44:45 -06:00
|
|
|
}
|
2004-01-20 05:47:22 -06:00
|
|
|
|
|
|
|
} // end of namespace sd
|