2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-09 06:12:08 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:12:08 +00:00
|
|
|
* $RCSfile: drviewse.cxx,v $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2006-03-21 16:45:15 +00:00
|
|
|
* $Revision: 1.58 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2006-03-21 16:45:15 +00:00
|
|
|
* last change: $Author: obo $ $Date: 2006-03-21 17:45:15 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:12:08 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-09 06:12:08 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:12:08 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:12:08 +00:00
|
|
|
* This library 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 for more details.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 06:12:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
#include "DrawViewShell.hxx"
|
2004-11-27 13:41:03 +00:00
|
|
|
#include "slideshow.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
|
2004-10-28 12:34:57 +00:00
|
|
|
#include "ViewShellHint.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _COM_SUN_STAR_FORM_FORMBUTTONTYPE_HPP_
|
|
|
|
#include <com/sun/star/form/FormButtonType.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#endif
|
2001-03-12 06:54:26 +00:00
|
|
|
#ifndef _COM_SUN_STAR_I18N_TRANSLITERATIONMODULES_HDL_
|
|
|
|
#include <com/sun/star/i18n/TransliterationModules.hdl>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#ifndef _SV_WAITOBJ_HXX
|
|
|
|
#include <vcl/waitobj.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _AEITEM_HXX //autogen
|
|
|
|
#include <svtools/aeitem.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _EDITSTAT_HXX //autogen
|
|
|
|
#include <svx/editstat.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_MSGBOX_HXX //autogen
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#endif
|
2001-08-15 09:54:50 +00:00
|
|
|
#ifndef _URLBMK_HXX //autogen
|
|
|
|
#include <svtools/urlbmk.hxx>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _SVDPAGV_HXX //autogen
|
|
|
|
#include <svx/svdpagv.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVX_FMSHELL_HXX
|
|
|
|
#include <svx/fmshell.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SCRBAR_HXX //autogen
|
|
|
|
#include <vcl/scrbar.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVDOPATH_HXX //autogen
|
|
|
|
#include <svx/svdopath.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVDUNDO_HXX //autogen
|
|
|
|
#include <svx/svdundo.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVDORECT_HXX //autogen
|
|
|
|
#include <svx/svdorect.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVDOGRAF_HXX //autogen
|
|
|
|
#include <svx/svdograf.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXENUMITEM_HXX //autogen
|
|
|
|
#include <svtools/eitem.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _EEITEM_HXX //autogen
|
|
|
|
#include <svx/eeitem.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXDISPATCH_HXX //autogen
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXVIEWFRM_HXX //autogen
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SFXREQUEST_HXX //autogen
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVXIDS_HRC
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#endif
|
|
|
|
#define ITEMID_FIELD EE_FEATURE_FIELD
|
|
|
|
#ifndef _FLDITEM_HXX
|
|
|
|
#include <svx/flditem.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _RULER_HXX
|
|
|
|
#include <svx/ruler.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _OBJ3D_HXX
|
|
|
|
#include <svx/obj3d.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVX_FMGLOB_HXX
|
|
|
|
#include <svx/fmglob.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SVDOUNO_HXX //autogen
|
|
|
|
#include <svx/svdouno.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _URLOBJ_HXX //autogen
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
#endif
|
2003-03-27 09:58:12 +00:00
|
|
|
#ifndef _SV_SOUND_HXX
|
|
|
|
#include <vcl/sound.hxx>
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-04-27 10:37:50 +00:00
|
|
|
// #UndoRedo#
|
|
|
|
#ifndef _SFXSLSTITM_HXX
|
|
|
|
#include <svtools/slstitm.hxx>
|
|
|
|
#endif
|
|
|
|
|
2004-10-04 17:45:29 +00:00
|
|
|
#include <sfx2/ipclient.hxx>
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#pragma hdrstop
|
|
|
|
|
|
|
|
#include <svtools/urihelper.hxx>
|
2001-06-29 13:08:08 +00:00
|
|
|
#include <sfx2/topfrm.hxx>
|
2005-01-11 11:13:05 +00:00
|
|
|
#include <sfx2/docfile.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include "app.hrc"
|
|
|
|
#include "glob.hrc"
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "res_bmp.hrc"
|
|
|
|
#include "drawdoc.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#ifndef SD_FU_SELECTION_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fusel.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_FU_TEXT_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "futext.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_FU_CONSTRUCT_RECTANGLE_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fuconrec.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
2004-10-12 12:13:41 +00:00
|
|
|
#ifndef SD_FU_CONSTRUCT_CUSTOMSHAPE_HXX
|
|
|
|
#include "fuconcs.hxx"
|
|
|
|
#endif
|
2004-01-20 11:47:57 +00:00
|
|
|
#ifndef SD_FU_CONSTRUCT_UNO_CONTROL_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fuconuno.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_FU_CONSTRUCT_BEZIER_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fuconbez.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_FU_EDIT_GLUE_POINTS_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fuediglu.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_FU_CONSTRUCT_ARC_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fuconarc.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_FU_CONSTRUCT_3D_OBJECT_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "fucon3d.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "sdresid.hxx"
|
2004-11-27 13:41:03 +00:00
|
|
|
#ifndef _SD_SLIDESHOW_HXX
|
|
|
|
#include "slideshow.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
|
|
|
#ifndef SD_OUTLINER_HXX
|
|
|
|
#include "Outliner.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef SD_PRESENTATION_VIEW_SHELL_HXX
|
|
|
|
#include "PresentationViewShell.hxx"
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "sdpage.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#ifndef SD_FRAME_VIEW
|
|
|
|
#include "FrameView.hxx"
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "zoomlist.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#ifndef SD_DRAW_VIEW_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "drawview.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
|
|
|
#include "DrawDocShell.hxx"
|
2001-06-29 13:08:08 +00:00
|
|
|
#include "sdattr.hxx"
|
2004-07-13 14:15:18 +00:00
|
|
|
#include "PaneManager.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#ifndef SD_VIEW_SHELL_BASE_HXX
|
|
|
|
#include "ViewShellBase.hxx"
|
|
|
|
#endif
|
2006-03-21 16:45:15 +00:00
|
|
|
#ifndef SD_TOOL_BAR_MANAGER_HXX
|
|
|
|
#include "ToolBarManager.hxx"
|
2004-01-20 11:47:57 +00:00
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-02-15 16:09:27 +00:00
|
|
|
// #97016#
|
|
|
|
#ifndef _SD_OPTSITEM_HXX
|
|
|
|
#include "optsitem.hxx"
|
|
|
|
#endif
|
|
|
|
|
2002-05-06 12:43:29 +00:00
|
|
|
// #98721#
|
|
|
|
#ifndef _SVX_DATACCESSDESCRIPTOR_HXX_
|
|
|
|
#include <svx/dataaccessdescriptor.hxx>
|
|
|
|
#endif
|
|
|
|
|
2004-11-27 13:41:03 +00:00
|
|
|
// #110496#
|
|
|
|
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
|
|
|
|
#include <toolkit/helper/vclunohelper.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
|
|
|
|
#include <comphelper/processfactory.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Window.hxx"
|
|
|
|
|
2005-01-21 15:38:04 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
using namespace ::rtl;
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
namespace sd {
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifdef WNT
|
|
|
|
#pragma optimize ( "", off )
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Permanente Funktionen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
void ImpAddPrintableCharactersToTextEdit(SfxRequest& rReq, ::sd::View* pView)
|
2002-05-17 13:05:39 +00:00
|
|
|
{
|
|
|
|
// #98198# evtl. feed characters to activated textedit
|
|
|
|
const SfxItemSet* pSet = rReq.GetArgs();
|
|
|
|
|
|
|
|
if(pSet)
|
|
|
|
{
|
|
|
|
String aInputString;
|
|
|
|
|
|
|
|
if(SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR))
|
|
|
|
aInputString = ((SfxStringItem&)pSet->Get(SID_ATTR_CHAR)).GetValue();
|
|
|
|
|
|
|
|
if(aInputString.Len())
|
|
|
|
{
|
|
|
|
OutlinerView* pOLV = pView->GetTextEditOutlinerView();
|
|
|
|
|
|
|
|
if(pOLV)
|
|
|
|
{
|
|
|
|
for(sal_uInt16 a(0); a < aInputString.Len(); a++)
|
|
|
|
{
|
2004-01-20 11:47:57 +00:00
|
|
|
sal_Char aChar = (sal_Char)aInputString.GetChar(a);
|
2002-05-17 13:05:39 +00:00
|
|
|
KeyCode aKeyCode;
|
|
|
|
KeyEvent aKeyEvent(aChar, aKeyCode);
|
|
|
|
|
|
|
|
// add actual character
|
|
|
|
pOLV->PostKeyEvent(aKeyEvent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
void DrawViewShell::FuPermanent(SfxRequest& rReq)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Waehrend einer Native-Diashow wird nichts ausgefuehrt!
|
2004-04-02 12:25:54 +00:00
|
|
|
|
2004-11-27 13:41:03 +00:00
|
|
|
if (mpSlideShow)
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
USHORT nSId = rReq.GetSlot();
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if( HasCurrentFunction() &&
|
2001-02-05 10:35:37 +00:00
|
|
|
( nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE ||
|
|
|
|
nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
FunctionReference xFunc( GetCurrentFunction() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
FuText* pFuText = dynamic_cast< FuText* >( xFunc.get() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if( pFuText )
|
|
|
|
{
|
|
|
|
pFuText->SetPermanent(TRUE);
|
|
|
|
xFunc->ReceiveRequest( rReq );
|
2002-05-17 13:05:39 +00:00
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
MapSlot( nSId );
|
2002-05-17 13:05:39 +00:00
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
Invalidate();
|
2002-05-17 13:05:39 +00:00
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
Invalidate();
|
|
|
|
|
|
|
|
// #98198# evtl. feed characters to activated textedit
|
|
|
|
if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit())
|
|
|
|
ImpAddPrintableCharactersToTextEdit(rReq, GetView());
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
return;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CheckLineTo (rReq);
|
|
|
|
USHORT nOldSId = 0;
|
|
|
|
BOOL bPermanent = FALSE;
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasCurrentFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
if(GetOldFunction() == GetCurrentFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetOldFunction(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2001-02-05 10:35:37 +00:00
|
|
|
if ( nSId != SID_TEXTEDIT && nSId != SID_ATTR_CHAR && nSId != SID_TEXT_FITTOSIZE &&
|
|
|
|
nSId != SID_ATTR_CHAR_VERTICAL && nSId != SID_TEXT_FITTOSIZE_VERTICAL &&
|
2000-09-18 16:07:07 +00:00
|
|
|
pDrView->IsTextEdit() )
|
|
|
|
{
|
|
|
|
pDrView->EndTextEdit();
|
|
|
|
}
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if( HasCurrentFunction() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
nOldSId = GetCurrentFunction()->GetSlotID();
|
|
|
|
|
|
|
|
if (nOldSId == nSId ||
|
|
|
|
((nOldSId == SID_TEXTEDIT || nOldSId == SID_ATTR_CHAR || nOldSId == SID_TEXT_FITTOSIZE ||
|
|
|
|
nOldSId == SID_ATTR_CHAR_VERTICAL || nOldSId == SID_TEXT_FITTOSIZE_VERTICAL) &&
|
|
|
|
(nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE ||
|
|
|
|
nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL )))
|
|
|
|
{
|
|
|
|
bPermanent = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GetCurrentFunction()->Deactivate();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2000-09-21 15:12:50 +00:00
|
|
|
SfxBindings& rBind = GetViewFrame()->GetBindings();
|
2000-09-18 16:07:07 +00:00
|
|
|
rBind.Invalidate(nOldSId);
|
|
|
|
rBind.Update(nOldSId);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Slot wird gemapped (ToolboxImages/-Slots)
|
|
|
|
MapSlot( nSId );
|
|
|
|
|
|
|
|
switch ( nSId )
|
|
|
|
{
|
|
|
|
case SID_TEXTEDIT: // BASIC ???
|
|
|
|
case SID_ATTR_CHAR:
|
2001-02-05 10:35:37 +00:00
|
|
|
case SID_ATTR_CHAR_VERTICAL:
|
2000-09-18 16:07:07 +00:00
|
|
|
case SID_TEXT_FITTOSIZE:
|
2001-02-05 10:35:37 +00:00
|
|
|
case SID_TEXT_FITTOSIZE_VERTICAL:
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuText::Create(this, GetActiveWindow(), pDrView, GetDoc(), rReq) );
|
2006-01-10 13:37:11 +00:00
|
|
|
GetCurrentFunction()->DoExecute(rReq);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2000-09-21 15:12:50 +00:00
|
|
|
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
|
|
|
rBindings.Invalidate( SID_ATTR_CHAR );
|
2001-02-05 10:35:37 +00:00
|
|
|
rBindings.Invalidate( SID_ATTR_CHAR_VERTICAL );
|
2000-09-21 15:12:50 +00:00
|
|
|
rBindings.Invalidate( SID_TEXT_FITTOSIZE );
|
2001-02-05 10:35:37 +00:00
|
|
|
rBindings.Invalidate( SID_TEXT_FITTOSIZE_VERTICAL );
|
2002-03-18 14:30:07 +00:00
|
|
|
|
|
|
|
// #98198# evtl. feed characters to activated textedit
|
2004-07-13 14:15:18 +00:00
|
|
|
if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit())
|
|
|
|
ImpAddPrintableCharactersToTextEdit(rReq, GetView());
|
2002-03-18 14:30:07 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_FM_CREATE_CONTROL:
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuConstructUnoControl::Create( this, GetActiveWindow(), pDrView, GetDoc(), rReq, bPermanent ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2002-05-06 12:43:29 +00:00
|
|
|
// #98721#
|
|
|
|
case SID_FM_CREATE_FIELDCONTROL:
|
|
|
|
{
|
|
|
|
SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False );
|
2004-01-20 11:47:57 +00:00
|
|
|
DBG_ASSERT( pDescriptorItem, "DrawViewShell::FuPermanent(SID_FM_CREATE_FIELDCONTROL): invalid request args!" );
|
2002-05-06 12:43:29 +00:00
|
|
|
|
|
|
|
if(pDescriptorItem)
|
|
|
|
{
|
|
|
|
// get the form view
|
|
|
|
FmFormView* pFormView = PTR_CAST(FmFormView, pDrView);
|
|
|
|
SdrPageView* pPageView = pFormView ? pFormView->GetPageViewPvNum(0) : NULL;
|
|
|
|
|
|
|
|
if(pPageView)
|
|
|
|
{
|
|
|
|
::svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue());
|
|
|
|
SdrObject* pNewDBField = pFormView->CreateFieldControl(aDescriptor);
|
|
|
|
|
|
|
|
if(pNewDBField)
|
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
|
2002-05-06 12:43:29 +00:00
|
|
|
Point aObjPos(aVisArea.Center());
|
|
|
|
Size aObjSize(pNewDBField->GetLogicRect().GetSize());
|
|
|
|
aObjPos.X() -= aObjSize.Width() / 2;
|
|
|
|
aObjPos.Y() -= aObjSize.Height() / 2;
|
|
|
|
Rectangle aNewObjectRectangle(aObjPos, aObjSize);
|
|
|
|
|
|
|
|
pNewDBField->SetLogicRect(aNewObjectRectangle);
|
|
|
|
|
2004-07-13 14:15:18 +00:00
|
|
|
GetView()->InsertObject(pNewDBField, *pPageView, GetView()->IsSolidDraggingNow() ? SDRINSERT_NOBROADCAST : 0);
|
2002-05-06 12:43:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
case SID_OBJECT_SELECT:
|
|
|
|
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:
|
|
|
|
{
|
|
|
|
short nSlotId = rReq.GetSlot();
|
|
|
|
|
|
|
|
if (nSlotId == SID_OBJECT_CROOK_ROTATE ||
|
|
|
|
nSlotId == SID_OBJECT_CROOK_SLANT ||
|
|
|
|
nSlotId == SID_OBJECT_CROOK_STRETCH)
|
|
|
|
{
|
2004-07-12 14:20:08 +00:00
|
|
|
if ( pDrView->GetMarkedObjectList().GetMarkCount() > 0 &&
|
2001-01-26 13:25:33 +00:00
|
|
|
!pDrView->IsCrookAllowed( pDrView->IsCrookNoContortion() ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if ( pDrView->IsPresObjSelected() )
|
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 16:07:07 +00:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
2004-07-13 14:15:18 +00:00
|
|
|
else if ( QueryBox(GetActiveWindow(), WB_YES_NO,
|
2000-09-18 16:07:07 +00:00
|
|
|
String(SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) )
|
|
|
|
).Execute() == RET_YES )
|
|
|
|
{
|
|
|
|
// Implizite Wandlung in Bezier
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
|
|
|
pDrView->ConvertMarkedToPathObj(FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (nSlotId == SID_OBJECT_SHEAR)
|
|
|
|
{
|
|
|
|
ULONG i = 0;
|
2004-07-12 14:20:08 +00:00
|
|
|
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
ULONG nMarkCnt = rMarkList.GetMarkCount();
|
|
|
|
BOOL b3DObjMarked = FALSE;
|
|
|
|
|
|
|
|
while (i < nMarkCnt && !b3DObjMarked)
|
|
|
|
{
|
|
|
|
if (rMarkList.GetMark(i)->GetObj()->ISA(E3dObject))
|
|
|
|
{
|
|
|
|
b3DObjMarked = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-12-14 14:14:56 +00:00
|
|
|
if ( nMarkCnt > 0 && !b3DObjMarked &&
|
2000-09-18 16:07:07 +00:00
|
|
|
(!pDrView->IsShearAllowed() || !pDrView->IsDistortAllowed()) )
|
|
|
|
{
|
|
|
|
if ( pDrView->IsPresObjSelected() )
|
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 16:07:07 +00:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
2004-07-13 14:15:18 +00:00
|
|
|
else if ( QueryBox(GetActiveWindow(), WB_YES_NO,
|
2000-09-18 16:07:07 +00:00
|
|
|
String(SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) )
|
|
|
|
).Execute() == RET_YES )
|
|
|
|
{
|
|
|
|
// Implizite Wandlung in Bezier
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
|
|
|
pDrView->ConvertMarkedToPathObj(FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuSelection::Create(this, GetActiveWindow(), pDrView, GetDoc(), rReq) );
|
2000-09-18 16:07:07 +00:00
|
|
|
rReq.Done();
|
|
|
|
Invalidate( SID_OBJECT_SELECT );
|
|
|
|
}
|
|
|
|
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:
|
|
|
|
|
|
|
|
case SID_DRAW_RECT:
|
|
|
|
case SID_DRAW_RECT_NOFILL:
|
|
|
|
case SID_DRAW_RECT_ROUND:
|
|
|
|
case SID_DRAW_RECT_ROUND_NOFILL:
|
|
|
|
case SID_DRAW_SQUARE:
|
|
|
|
case SID_DRAW_SQUARE_NOFILL:
|
|
|
|
case SID_DRAW_SQUARE_ROUND:
|
|
|
|
case SID_DRAW_SQUARE_ROUND_NOFILL:
|
|
|
|
case SID_DRAW_ELLIPSE:
|
|
|
|
case SID_DRAW_ELLIPSE_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLE:
|
|
|
|
case SID_DRAW_CIRCLE_NOFILL:
|
|
|
|
case SID_DRAW_CAPTION:
|
2001-02-05 10:35:37 +00:00
|
|
|
case SID_DRAW_CAPTION_VERTICAL:
|
2000-09-18 16:07:07 +00:00
|
|
|
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:
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuConstructRectangle::Create( this, GetActiveWindow(), pDrView, GetDoc(), rReq, bPermanent ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_DRAW_POLYGON:
|
|
|
|
case SID_DRAW_POLYGON_NOFILL:
|
|
|
|
case SID_DRAW_XPOLYGON:
|
|
|
|
case SID_DRAW_XPOLYGON_NOFILL:
|
|
|
|
case SID_DRAW_FREELINE:
|
|
|
|
case SID_DRAW_FREELINE_NOFILL:
|
|
|
|
case SID_DRAW_BEZIER_FILL: // BASIC
|
|
|
|
case SID_DRAW_BEZIER_NOFILL: // BASIC
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuConstructBezierPolygon::Create(this, GetActiveWindow(), pDrView, GetDoc(), rReq, bPermanent) );
|
2000-09-18 16:07:07 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_GLUE_EDITMODE:
|
|
|
|
{
|
|
|
|
if (nOldSId != SID_GLUE_EDITMODE)
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuEditGluePoints::Create( this, GetActiveWindow(), pDrView, GetDoc(), rReq, bPermanent ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
|
|
|
|
}
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_DRAW_ARC:
|
|
|
|
case SID_DRAW_CIRCLEARC:
|
|
|
|
case SID_DRAW_PIE:
|
|
|
|
case SID_DRAW_PIE_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLEPIE:
|
|
|
|
case SID_DRAW_CIRCLEPIE_NOFILL:
|
|
|
|
case SID_DRAW_ELLIPSECUT:
|
|
|
|
case SID_DRAW_ELLIPSECUT_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLECUT:
|
|
|
|
case SID_DRAW_CIRCLECUT_NOFILL:
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuConstructArc::Create( this, GetActiveWindow(), pDrView, GetDoc(), rReq, bPermanent) );
|
2000-09-18 16:07:07 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_3D_CUBE:
|
|
|
|
case SID_3D_SHELL:
|
|
|
|
case SID_3D_SPHERE:
|
|
|
|
case SID_3D_TORUS:
|
|
|
|
case SID_3D_HALF_SPHERE:
|
|
|
|
case SID_3D_CYLINDER:
|
|
|
|
case SID_3D_CONE:
|
|
|
|
case SID_3D_PYRAMID:
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuConstruct3dObject::Create(this, GetActiveWindow(), pDrView, GetDoc(), rReq, bPermanent ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2004-10-12 12:13:41 +00:00
|
|
|
case SID_DRAWTBX_CS_BASIC :
|
|
|
|
case SID_DRAWTBX_CS_SYMBOL :
|
|
|
|
case SID_DRAWTBX_CS_ARROW :
|
|
|
|
case SID_DRAWTBX_CS_FLOWCHART :
|
|
|
|
case SID_DRAWTBX_CS_CALLOUT :
|
|
|
|
case SID_DRAWTBX_CS_STAR :
|
|
|
|
case SID_DRAW_CS_ID :
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
SetCurrentFunction( FuConstructCustomShape::Create( this, GetActiveWindow(), pDrView, GetDoc(), rReq, bPermanent ) );
|
2004-10-12 12:13:41 +00:00
|
|
|
rReq.Done();
|
|
|
|
|
|
|
|
if ( nSId != SID_DRAW_CS_ID )
|
|
|
|
{
|
2005-03-08 13:43:41 +00:00
|
|
|
SfxBindings& rBind = GetViewFrame()->GetBindings();
|
|
|
|
rBind.Invalidate( nSId );
|
|
|
|
rBind.Update( nSId );
|
2004-10-12 12:13:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasOldFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
USHORT nSId = GetOldFunction()->GetSlotID();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
GetOldFunction()->Deactivate();
|
|
|
|
SetOldFunction(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2000-09-21 15:12:50 +00:00
|
|
|
SfxBindings& rBind = GetViewFrame()->GetBindings();
|
2000-09-18 16:07:07 +00:00
|
|
|
rBind.Invalidate( nSId );
|
|
|
|
rBind.Update( nSId );
|
|
|
|
}
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasCurrentFunction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
GetCurrentFunction()->Activate();
|
|
|
|
SetOldFunction( GetCurrentFunction() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
SetHelpId( GetCurrentFunction()->GetSlotID() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Shell wird invalidiert, schneller als einzeln (laut MI)
|
|
|
|
// Jetzt explizit der letzte Slot incl. Update()
|
|
|
|
Invalidate();
|
2002-02-15 16:09:27 +00:00
|
|
|
|
2002-03-13 13:28:36 +00:00
|
|
|
// #97016# III CTRL-SID_OBJECT_SELECT -> select first draw object if none is selected yet
|
2005-12-14 16:29:11 +00:00
|
|
|
if(SID_OBJECT_SELECT == nSId && HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
|
2002-03-13 13:28:36 +00:00
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
if(!GetView()->AreObjectsMarked())
|
2002-03-13 13:28:36 +00:00
|
|
|
{
|
|
|
|
// select first object
|
2004-07-13 14:15:18 +00:00
|
|
|
GetView()->UnmarkAllObj();
|
|
|
|
GetView()->MarkNextObj(TRUE);
|
2002-03-13 13:28:36 +00:00
|
|
|
|
|
|
|
// ...and make it visible
|
2004-07-13 14:15:18 +00:00
|
|
|
if(GetView()->AreObjectsMarked())
|
2004-07-15 08:00:36 +00:00
|
|
|
GetView()->MakeVisible(GetView()->GetAllMarkedRect(), *GetActiveWindow());
|
2002-03-13 13:28:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-02-15 16:09:27 +00:00
|
|
|
// #97016# with qualifier construct directly
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
|
2002-02-15 16:09:27 +00:00
|
|
|
{
|
|
|
|
// get SdOptions
|
2004-01-20 11:47:57 +00:00
|
|
|
SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
|
2002-02-15 16:09:27 +00:00
|
|
|
sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth());
|
|
|
|
sal_uInt32 nDefaultObjectSizeHeight(pOptions->GetDefaultObjectSizeHeight());
|
2002-03-21 15:31:08 +00:00
|
|
|
|
|
|
|
// calc position and size
|
2004-07-13 14:15:18 +00:00
|
|
|
Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
|
2002-03-21 15:31:08 +00:00
|
|
|
Point aPagePos = aVisArea.Center();
|
|
|
|
aPagePos.X() -= nDefaultObjectSizeWidth / 2;
|
|
|
|
aPagePos.Y() -= nDefaultObjectSizeHeight / 2;
|
|
|
|
Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
|
2002-02-15 16:09:27 +00:00
|
|
|
SdrPageView* pPageView = pDrView->GetPageViewPvNum(0);
|
|
|
|
|
|
|
|
if(pPageView)
|
|
|
|
{
|
2002-03-21 15:31:08 +00:00
|
|
|
// create the default object
|
2005-12-14 16:29:11 +00:00
|
|
|
SdrObject* pObj = GetCurrentFunction()->CreateDefaultObject(nSId, aNewObjectRectangle);
|
2002-02-15 16:09:27 +00:00
|
|
|
|
|
|
|
if(pObj)
|
|
|
|
{
|
|
|
|
// insert into page
|
2004-07-13 14:15:18 +00:00
|
|
|
GetView()->InsertObject(pObj, *pPageView, GetView()->IsSolidDraggingNow() ? SDRINSERT_NOBROADCAST : 0);
|
2003-03-27 09:58:12 +00:00
|
|
|
|
|
|
|
// Now that pFuActual has done what it was created for we
|
|
|
|
// can switch on the edit mode for callout objects.
|
|
|
|
switch (nSId)
|
|
|
|
{
|
|
|
|
case SID_DRAW_CAPTION:
|
|
|
|
case SID_DRAW_CAPTION_VERTICAL:
|
|
|
|
{
|
|
|
|
// Make FuText the current function.
|
|
|
|
SfxUInt16Item aItem (SID_TEXTEDIT, 1);
|
|
|
|
GetViewFrame()->GetDispatcher()->
|
|
|
|
Execute(SID_TEXTEDIT, SFX_CALLMODE_SYNCHRON |
|
|
|
|
SFX_CALLMODE_RECORD, &aItem, 0L);
|
|
|
|
// Put text object into edit mode.
|
2004-07-13 14:15:18 +00:00
|
|
|
GetView()->BegTextEdit (reinterpret_cast<SdrTextObj*>(pObj), pPageView);
|
2003-03-27 09:58:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2002-02-15 16:09:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2001-05-30 10:14:06 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// service routine for Undo/Redo implementation
|
2004-01-20 11:47:57 +00:00
|
|
|
extern SfxUndoManager* ImpGetUndoManagerFromViewShell(DrawViewShell& rDViewShell);
|
2001-05-30 10:14:06 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SfxRequests fuer Support-Funktionen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
void DrawViewShell::FuSupport(SfxRequest& rReq)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs())
|
2004-01-20 11:47:57 +00:00
|
|
|
GetDocSh()->SetStyleFamily(((SfxUInt16Item&)rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// Waehrend einer Native-Diashow wird nichts ausgefuehrt!
|
2004-11-27 13:41:03 +00:00
|
|
|
if(mpSlideShow &&
|
2000-09-18 16:07:07 +00:00
|
|
|
(rReq.GetSlot() != SID_PRESENTATION_END &&
|
|
|
|
rReq.GetSlot() != SID_SIZE_PAGE))
|
|
|
|
return;
|
|
|
|
|
|
|
|
CheckLineTo (rReq);
|
|
|
|
|
|
|
|
USHORT nSId = rReq.GetSlot();
|
|
|
|
|
|
|
|
// Slot wird evtl. gemapped (ToolboxImages/-Slots)
|
|
|
|
MapSlot( nSId );
|
|
|
|
|
|
|
|
switch ( nSId )
|
|
|
|
{
|
|
|
|
// Slots der ToolboxController gemapped ausfuehren
|
|
|
|
case SID_OBJECT_CHOOSE_MODE:
|
|
|
|
case SID_POSITION:
|
|
|
|
case SID_OBJECT_ALIGN:
|
|
|
|
case SID_ZOOM_TOOLBOX:
|
|
|
|
case SID_DRAWTBX_TEXT:
|
|
|
|
case SID_DRAWTBX_RECTANGLES:
|
|
|
|
case SID_DRAWTBX_ELLIPSES:
|
|
|
|
case SID_DRAWTBX_LINES:
|
|
|
|
case SID_DRAWTBX_ARROWS:
|
|
|
|
case SID_DRAWTBX_3D_OBJECTS:
|
|
|
|
case SID_DRAWTBX_CONNECTORS:
|
|
|
|
case SID_DRAWTBX_INSERT:
|
|
|
|
{
|
|
|
|
USHORT nMappedSlot = GetMappedSlot( nSId );
|
|
|
|
if( nMappedSlot > 0 )
|
|
|
|
{
|
2004-01-20 11:47:57 +00:00
|
|
|
SfxRequest aReq( nMappedSlot, 0, GetDoc()->GetItemPool() );
|
2000-09-18 16:07:07 +00:00
|
|
|
ExecuteSlot( aReq );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_PRESENTATION:
|
|
|
|
case SID_REHEARSE_TIMINGS:
|
|
|
|
{
|
2004-11-27 13:41:03 +00:00
|
|
|
if( mpSlideShow )
|
|
|
|
{
|
|
|
|
mpSlideShow->deactivate();
|
|
|
|
delete mpSlideShow;
|
|
|
|
mpSlideShow = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !mpSlideShow )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-06-29 13:08:08 +00:00
|
|
|
if( pDrView->IsTextEdit() )
|
|
|
|
pDrView->EndTextEdit();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-08-03 13:39:07 +00:00
|
|
|
SFX_REQUEST_ARG( rReq, pFullScreen, SfxBoolItem, ATTR_PRESENT_FULLSCREEN, FALSE );
|
2004-11-27 13:41:03 +00:00
|
|
|
const BOOL bFullScreen = ( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) && pFullScreen ) ? pFullScreen->GetValue() : GetDoc()->getPresentationSettings().mbFullScreen;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-08-03 13:39:07 +00:00
|
|
|
if( bFullScreen )
|
2004-01-20 11:47:57 +00:00
|
|
|
PresentationViewShell::CreateFullScreenShow( this, rReq );
|
2001-08-03 13:39:07 +00:00
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2005-07-07 12:39:29 +00:00
|
|
|
// Save the current view shell type so that it can be
|
|
|
|
// restored after the show has ended. If there already
|
|
|
|
// is a saved shell type then that is not overwritten.
|
|
|
|
if (pFrameView->GetPreviousViewShellType() == ViewShell::ST_NONE)
|
|
|
|
pFrameView->SetPreviousViewShellType(GetShellType());
|
2004-11-27 13:41:03 +00:00
|
|
|
|
2005-02-24 14:09:26 +00:00
|
|
|
mpSlideShow = new Slideshow( this, pDrView, GetDoc() );
|
|
|
|
mpSlideShow->setRehearseTimings(
|
2005-01-21 15:38:04 +00:00
|
|
|
nSId == SID_REHEARSE_TIMINGS );
|
2005-02-24 14:09:26 +00:00
|
|
|
if (!mpSlideShow->startShow())
|
|
|
|
{
|
|
|
|
delete mpSlideShow;
|
|
|
|
mpSlideShow = 0;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-29 13:08:08 +00:00
|
|
|
rReq.Ignore ();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_PRESENTATION_END:
|
|
|
|
{
|
2004-11-17 14:15:01 +00:00
|
|
|
StopSlideShow(true);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
rReq.Ignore ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-06-29 13:08:08 +00:00
|
|
|
case SID_BEZIER_EDIT:
|
|
|
|
{
|
|
|
|
pDrView->SetFrameDragSingles(!pDrView->IsFrameDragSingles());
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* ObjectBar einschalten
|
|
|
|
******************************************************************/
|
2005-12-14 16:29:11 +00:00
|
|
|
if( dynamic_cast< FuSelection* >( GetCurrentFunction().get() ) || dynamic_cast< FuConstructBezierPolygon* >( GetCurrentFunction().get() ) )
|
2001-06-29 13:08:08 +00:00
|
|
|
{
|
2006-03-21 16:45:15 +00:00
|
|
|
// Tell the tool bar manager about the context change.
|
|
|
|
GetViewShellBase().GetToolBarManager().SelectionHasChanged(*this,*pDrView);
|
2001-06-29 13:08:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Invalidate(SID_BEZIER_EDIT);
|
|
|
|
rReq.Ignore();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
case SID_OBJECT_CLOSE:
|
|
|
|
{
|
2004-07-12 14:20:08 +00:00
|
|
|
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( rMarkList.GetMark(0) && !pDrView->IsAction() )
|
|
|
|
{
|
|
|
|
SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetObj();
|
|
|
|
pDrView->BegUndo(String(SdResId(STR_UNDO_BEZCLOSE)));
|
|
|
|
pDrView->UnmarkAllPoints();
|
2004-07-13 14:15:18 +00:00
|
|
|
Size aDist(GetActiveWindow()->PixelToLogic(Size(8,8)));
|
2000-09-18 16:07:07 +00:00
|
|
|
pDrView->AddUndo(new SdrUndoGeoObj(*pPathObj));
|
|
|
|
pPathObj->ToggleClosed(aDist.Width());
|
|
|
|
pDrView->EndUndo();
|
|
|
|
}
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CUT:
|
|
|
|
{
|
2004-03-30 14:55:07 +00:00
|
|
|
if ( pDrView->IsPresObjSelected(FALSE, TRUE, FALSE, TRUE) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 16:07:07 +00:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasCurrentFunction())
|
|
|
|
{
|
|
|
|
GetCurrentFunction()->DoCut();
|
|
|
|
}
|
|
|
|
else if(pDrView)
|
|
|
|
{
|
|
|
|
pDrView->DoCut();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
rReq.Ignore ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_COPY:
|
|
|
|
{
|
2004-03-30 14:55:07 +00:00
|
|
|
if ( pDrView->IsPresObjSelected(FALSE, TRUE, FALSE, TRUE) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 16:07:07 +00:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasCurrentFunction())
|
|
|
|
{
|
|
|
|
GetCurrentFunction()->DoCopy();
|
|
|
|
}
|
|
|
|
else if( pDrView )
|
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
pDrView->DoCopy();
|
2005-12-14 16:29:11 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
rReq.Ignore ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_PASTE:
|
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasCurrentFunction())
|
|
|
|
{
|
|
|
|
GetCurrentFunction()->DoPaste();
|
|
|
|
}
|
|
|
|
else if(pDrView)
|
|
|
|
{
|
|
|
|
pDrView->DoPaste();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
rReq.Ignore ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-04-25 07:39:16 +00:00
|
|
|
case SID_CLIPBOARD_FORMAT_ITEMS:
|
|
|
|
{
|
|
|
|
WaitObject aWait( (Window*)GetActiveWindow() );
|
2001-05-14 09:55:42 +00:00
|
|
|
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) );
|
2001-04-25 07:39:16 +00:00
|
|
|
const SfxItemSet* pReqArgs = rReq.GetArgs();
|
|
|
|
UINT32 nFormat = 0;
|
|
|
|
|
|
|
|
if( pReqArgs )
|
|
|
|
{
|
|
|
|
SFX_REQUEST_ARG( rReq, pIsActive, SfxUInt32Item, SID_CLIPBOARD_FORMAT_ITEMS, FALSE );
|
|
|
|
nFormat = pIsActive->GetValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( nFormat && aDataHelper.GetTransferable().is() )
|
|
|
|
{
|
|
|
|
sal_Int8 nAction = DND_ACTION_COPY;
|
2001-08-15 09:54:50 +00:00
|
|
|
|
|
|
|
if( !pDrView->InsertData( aDataHelper,
|
2004-07-13 14:15:18 +00:00
|
|
|
GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ),
|
2001-08-15 09:54:50 +00:00
|
|
|
nAction, FALSE, nFormat ) )
|
|
|
|
{
|
|
|
|
String aEmptyStr;
|
|
|
|
INetBookmark aINetBookmark( aEmptyStr, aEmptyStr );
|
|
|
|
|
|
|
|
if( ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) &&
|
|
|
|
aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) ) ||
|
|
|
|
( aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) &&
|
|
|
|
aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, aINetBookmark ) ) ||
|
|
|
|
( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) &&
|
|
|
|
aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
|
|
|
|
{
|
|
|
|
InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL );
|
|
|
|
}
|
|
|
|
}
|
2001-04-25 07:39:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
case SID_DELETE:
|
|
|
|
{
|
|
|
|
if ( pDrView->IsTextEdit() )
|
|
|
|
{
|
|
|
|
OutlinerView* pOLV = pDrView->GetTextEditOutlinerView();
|
|
|
|
|
|
|
|
if (pOLV)
|
|
|
|
{
|
|
|
|
KeyCode aKCode(KEY_DELETE);
|
|
|
|
KeyEvent aKEvt( 0, aKCode);
|
|
|
|
pOLV->PostKeyEvent(aKEvt);
|
|
|
|
}
|
|
|
|
}
|
2004-03-30 14:55:07 +00:00
|
|
|
else if ( pDrView->IsPresObjSelected(FALSE, TRUE, FALSE, TRUE) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
::sd::Window* pWindow = GetActiveWindow();
|
2000-09-18 16:07:07 +00:00
|
|
|
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
|
|
|
|
}
|
2005-12-14 16:29:11 +00:00
|
|
|
else if( HasCurrentFunction() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
KeyCode aKCode(KEY_DELETE);
|
|
|
|
KeyEvent aKEvt( 0, aKCode);
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if( !GetCurrentFunction()->KeyInput(aKEvt) && pDrView )
|
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
pDrView->DeleteMarked();
|
2005-12-14 16:29:11 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pDrView->DeleteMarked();
|
|
|
|
}
|
|
|
|
rReq.Ignore ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_PIXELMODE:
|
|
|
|
{
|
|
|
|
const SfxItemSet* pReqArgs = rReq.GetArgs();
|
|
|
|
BOOL bPixelMode = pDrView->IsPixelMode();
|
|
|
|
|
|
|
|
if (pReqArgs)
|
|
|
|
{
|
|
|
|
SFX_REQUEST_ARG(rReq, pIsActive, SfxBoolItem, SID_PIXELMODE, FALSE);
|
|
|
|
bPixelMode = pIsActive->GetValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->SetPixelMode(!bPixelMode);
|
|
|
|
|
|
|
|
Invalidate(SID_PIXELMODE);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ACTIONMODE:
|
|
|
|
{
|
|
|
|
const SfxItemSet* pReqArgs = rReq.GetArgs();
|
|
|
|
BOOL bActionMode = FALSE;
|
|
|
|
|
|
|
|
if (pDrView->IsActionMode())
|
|
|
|
{
|
|
|
|
bActionMode = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pReqArgs)
|
|
|
|
{
|
|
|
|
SFX_REQUEST_ARG(rReq, pIsActive, SfxBoolItem, SID_ACTIONMODE, FALSE);
|
|
|
|
bActionMode = pIsActive->GetValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->SetActionMode(!bActionMode);
|
|
|
|
|
|
|
|
Invalidate(SID_ACTIONMODE);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
case SID_NOTESMODE:
|
|
|
|
case SID_HANDOUTMODE:
|
|
|
|
// AutoLayouts have to be ready.
|
|
|
|
GetDoc()->StopWorkStartupDelay();
|
|
|
|
|
|
|
|
// Turn off effects.
|
|
|
|
// pDrView->SetAnimationMode(FALSE);
|
|
|
|
|
|
|
|
// Fall through to following case statements.
|
|
|
|
|
|
|
|
case SID_DRAWINGMODE:
|
|
|
|
case SID_DIAMODE:
|
|
|
|
case SID_OUTLINEMODE:
|
|
|
|
// Let the sub-shell manager handle the slot handling.
|
2004-07-13 14:15:18 +00:00
|
|
|
GetViewShellBase().GetPaneManager().HandleModeChangeSlot (
|
|
|
|
nSId,
|
|
|
|
rReq);
|
2004-01-20 11:47:57 +00:00
|
|
|
rReq.Ignore ();
|
|
|
|
break;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
case SID_MASTERPAGE: // BASIC
|
|
|
|
case SID_SLIDE_MASTERPAGE: // BASIC
|
|
|
|
case SID_TITLE_MASTERPAGE: // BASIC
|
|
|
|
case SID_NOTES_MASTERPAGE: // BASIC
|
|
|
|
case SID_HANDOUT_MASTERPAGE: // BASIC
|
|
|
|
{
|
|
|
|
// AutoLayouts muessen fertig sein
|
2004-01-20 11:47:57 +00:00
|
|
|
GetDoc()->StopWorkStartupDelay();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
const SfxItemSet* pReqArgs = rReq.GetArgs();
|
|
|
|
|
|
|
|
if ( pReqArgs )
|
|
|
|
{
|
|
|
|
SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_MASTERPAGE, FALSE);
|
2004-07-13 14:15:18 +00:00
|
|
|
mbIsLayerModeActive = pIsActive->GetValue ();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-10-28 12:34:57 +00:00
|
|
|
Broadcast (
|
|
|
|
ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if (nSId == SID_MASTERPAGE ||
|
|
|
|
(nSId == SID_SLIDE_MASTERPAGE && ePageKind == PK_STANDARD) ||
|
|
|
|
(nSId == SID_TITLE_MASTERPAGE && ePageKind == PK_STANDARD) ||
|
|
|
|
(nSId == SID_NOTES_MASTERPAGE && ePageKind == PK_NOTES) ||
|
|
|
|
(nSId == SID_HANDOUT_MASTERPAGE && ePageKind == PK_HANDOUT))
|
|
|
|
{
|
|
|
|
if (nSId == SID_TITLE_MASTERPAGE ||
|
|
|
|
nSId == SID_SLIDE_MASTERPAGE)
|
|
|
|
{
|
|
|
|
// Gibt es eine Seite mit dem AutoLayout "Titel"?
|
|
|
|
BOOL bFound = FALSE;
|
|
|
|
USHORT i = 0;
|
2004-01-20 11:47:57 +00:00
|
|
|
USHORT nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
while (i < nCount && !bFound)
|
|
|
|
{
|
2004-01-20 11:47:57 +00:00
|
|
|
SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (nSId == SID_TITLE_MASTERPAGE && pPage->GetAutoLayout() == AUTOLAYOUT_TITLE)
|
|
|
|
{
|
|
|
|
bFound = TRUE;
|
|
|
|
SwitchPage((pPage->GetPageNum() - 1) / 2);
|
|
|
|
}
|
|
|
|
else if (nSId == SID_SLIDE_MASTERPAGE && pPage->GetAutoLayout() != AUTOLAYOUT_TITLE)
|
|
|
|
{
|
|
|
|
bFound = TRUE;
|
|
|
|
SwitchPage((pPage->GetPageNum() - 1) / 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Default-Layer der MasterPage einschalten
|
|
|
|
pDrView->SetActiveLayer( String( SdResId(STR_LAYER_BCKGRNDOBJ) ) );
|
|
|
|
|
2004-07-13 14:15:18 +00:00
|
|
|
ChangeEditMode(EM_MASTERPAGE, mbIsLayerModeActive);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasCurrentFunction(SID_BEZIER_EDIT))
|
2000-09-18 16:07:07 +00:00
|
|
|
GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
// Switch to requested ViewShell.
|
|
|
|
ViewShell::ShellType eShellType;
|
|
|
|
PageKind ePageKind;
|
|
|
|
switch (nSId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
case SID_SLIDE_MASTERPAGE:
|
|
|
|
case SID_TITLE_MASTERPAGE:
|
|
|
|
default:
|
|
|
|
eShellType = ViewShell::ST_IMPRESS;
|
|
|
|
ePageKind = PK_STANDARD;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_NOTES_MASTERPAGE:
|
|
|
|
eShellType = ViewShell::ST_NOTES;
|
|
|
|
ePageKind = PK_NOTES;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_HANDOUT_MASTERPAGE:
|
|
|
|
eShellType = ViewShell::ST_HANDOUT;
|
|
|
|
ePageKind = PK_HANDOUT;
|
|
|
|
break;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 14:15:18 +00:00
|
|
|
pFrameView->SetViewShEditMode(EM_MASTERPAGE, ePageKind);
|
|
|
|
pFrameView->SetLayerMode(mbIsLayerModeActive);
|
|
|
|
GetViewShellBase().GetPaneManager().RequestMainViewShellChange(
|
|
|
|
eShellType);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-10-28 12:34:57 +00:00
|
|
|
Broadcast (
|
|
|
|
ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
InvalidateWindows();
|
|
|
|
Invalidate();
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2004-10-28 12:34:57 +00:00
|
|
|
|
|
|
|
case SID_CLOSE_MASTER_VIEW:
|
|
|
|
{
|
|
|
|
Broadcast (
|
|
|
|
ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
|
|
|
|
|
|
|
|
// Switch page back to the first one. Not doing so leads to a
|
|
|
|
// crash. This seems to be some bug in the edit mode switching
|
|
|
|
// and page switching methods.
|
|
|
|
SwitchPage (0);
|
|
|
|
ChangeEditMode(EM_PAGE, IsLayerModeActive());
|
|
|
|
Broadcast (
|
|
|
|
ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
|
|
|
|
|
2005-12-14 16:29:11 +00:00
|
|
|
if(HasCurrentFunction(SID_BEZIER_EDIT))
|
2004-10-28 12:34:57 +00:00
|
|
|
{
|
|
|
|
GetViewFrame()->GetDispatcher()->Execute(
|
|
|
|
SID_OBJECT_SELECT,
|
|
|
|
SFX_CALLMODE_ASYNCHRON);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
case SID_RULER:
|
|
|
|
{
|
|
|
|
const SfxItemSet* pReqArgs = rReq.GetArgs();
|
|
|
|
|
2002-02-27 13:40:58 +00:00
|
|
|
// #97516# Remember old ruler state
|
|
|
|
BOOL bOldHasRuler(HasRuler());
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( pReqArgs )
|
|
|
|
{
|
2002-08-29 13:48:05 +00:00
|
|
|
SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_RULER, FALSE);
|
2000-09-18 16:07:07 +00:00
|
|
|
SetRuler (pIsActive->GetValue ());
|
|
|
|
}
|
|
|
|
else SetRuler (!HasRuler());
|
|
|
|
|
2002-02-27 13:40:58 +00:00
|
|
|
// #97516# Did ruler state change? Tell that to SdOptions, too.
|
|
|
|
BOOL bHasRuler(HasRuler());
|
|
|
|
|
|
|
|
if(bOldHasRuler != bHasRuler)
|
|
|
|
{
|
2004-01-20 11:47:57 +00:00
|
|
|
SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
|
2002-02-27 13:40:58 +00:00
|
|
|
|
|
|
|
if(pOptions && pOptions->IsRulerVisible() != bHasRuler)
|
|
|
|
{
|
|
|
|
pOptions->SetRulerVisible(bHasRuler);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate (SID_RULER);
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_SIZE_PAGE:
|
|
|
|
case SID_SIZE_PAGE_WIDTH: // BASIC
|
|
|
|
{
|
|
|
|
bZoomOnPage = ( rReq.GetSlot() == SID_SIZE_PAGE );
|
|
|
|
|
|
|
|
SdrPageView* pPageView = pDrView->GetPageViewPvNum(0);
|
|
|
|
|
|
|
|
if ( pPageView )
|
|
|
|
{
|
|
|
|
Point aPagePos = pPageView->GetOffset();
|
|
|
|
Size aPageSize = pPageView->GetPage()->GetSize();
|
|
|
|
|
|
|
|
aPagePos.X() += aPageSize.Width() / 2;
|
|
|
|
aPageSize.Width() = (long) (aPageSize.Width() * 1.03);
|
|
|
|
|
|
|
|
if( rReq.GetSlot() == SID_SIZE_PAGE )
|
|
|
|
{
|
|
|
|
aPagePos.Y() += aPageSize.Height() / 2;
|
|
|
|
aPageSize.Height() = (long) (aPageSize.Height() * 1.03);
|
|
|
|
aPagePos.Y() -= aPageSize.Height() / 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
Point aPt = GetActiveWindow()->PixelToLogic( Point( 0, GetActiveWindow()->GetSizePixel().Height() / 2 ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
aPagePos.Y() += aPt.Y();
|
|
|
|
aPageSize.Height() = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
aPagePos.X() -= aPageSize.Width() / 2;
|
|
|
|
|
|
|
|
SetZoomRect( Rectangle( aPagePos, aPageSize ) );
|
|
|
|
|
2004-07-13 14:15:18 +00:00
|
|
|
Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
|
|
|
|
GetActiveWindow()->GetOutputSizePixel()) );
|
2000-09-18 16:07:07 +00:00
|
|
|
pZoomList->InsertZoomRect(aVisAreaWin);
|
|
|
|
}
|
|
|
|
Invalidate( SID_ZOOM_IN );
|
|
|
|
Invalidate( SID_ZOOM_OUT );
|
|
|
|
Invalidate( SID_ZOOM_PANNING );
|
|
|
|
Invalidate( SID_ZOOM_TOOLBOX );
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_SIZE_REAL: // BASIC
|
|
|
|
{
|
|
|
|
bZoomOnPage = FALSE;
|
|
|
|
SetZoom( 100 );
|
2004-07-13 14:15:18 +00:00
|
|
|
Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
|
|
|
|
GetActiveWindow()->GetOutputSizePixel()) );
|
2000-09-18 16:07:07 +00:00
|
|
|
pZoomList->InsertZoomRect(aVisAreaWin);
|
|
|
|
Invalidate( SID_ZOOM_IN );
|
|
|
|
Invalidate( SID_ZOOM_OUT );
|
|
|
|
Invalidate( SID_ZOOM_PANNING );
|
|
|
|
Invalidate( SID_ZOOM_TOOLBOX );
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ZOOM_IN: // BASIC
|
|
|
|
{
|
|
|
|
bZoomOnPage = FALSE;
|
2004-07-13 14:15:18 +00:00
|
|
|
SetZoom( Max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) );
|
|
|
|
Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
|
|
|
|
GetActiveWindow()->GetOutputSizePixel()) );
|
2000-09-18 16:07:07 +00:00
|
|
|
pZoomList->InsertZoomRect(aVisAreaWin);
|
|
|
|
Invalidate( SID_ZOOM_IN );
|
|
|
|
Invalidate( SID_ZOOM_OUT );
|
|
|
|
Invalidate( SID_ZOOM_PANNING );
|
|
|
|
Invalidate( SID_ZOOM_TOOLBOX );
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_SIZE_VISAREA:
|
|
|
|
{
|
|
|
|
Rectangle aVisArea = pFrameView->GetVisArea();
|
|
|
|
Size aVisAreaSize = aVisArea.GetSize();
|
|
|
|
|
|
|
|
if (aVisAreaSize.Height()!=0 && aVisAreaSize.Width()!=0)
|
|
|
|
{
|
|
|
|
bZoomOnPage = FALSE;
|
|
|
|
SetZoomRect(aVisArea);
|
|
|
|
Invalidate( SID_ZOOM_IN );
|
|
|
|
Invalidate( SID_ZOOM_OUT );
|
|
|
|
Invalidate( SID_ZOOM_PANNING );
|
|
|
|
Invalidate( SID_ZOOM_TOOLBOX );
|
|
|
|
}
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// Namensverwirrung: SID_SIZE_OPTIMAL -> Zoom auf selektierte Objekte
|
|
|
|
// --> Wird als Objektzoom im Programm angeboten
|
|
|
|
case SID_SIZE_OPTIMAL: // BASIC
|
|
|
|
{
|
|
|
|
bZoomOnPage = FALSE;
|
2004-07-12 14:20:08 +00:00
|
|
|
if ( pDrView->AreObjectsMarked() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-11-26 14:04:28 +00:00
|
|
|
aMarkRect = pDrView->GetAllMarkedRect();
|
2000-09-18 16:07:07 +00:00
|
|
|
long nW = (long) (aMarkRect.GetWidth() * 1.03);
|
|
|
|
long nH = (long) (aMarkRect.GetHeight() * 1.03);
|
|
|
|
Point aPos = aMarkRect.Center();
|
|
|
|
aPos.X() -= nW / 2;
|
|
|
|
aPos.Y() -= nH / 2;
|
|
|
|
if ( nW && nH )
|
|
|
|
{
|
|
|
|
SetZoomRect(Rectangle(aPos, Size(nW, nH)));
|
|
|
|
|
2004-07-13 14:15:18 +00:00
|
|
|
Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
|
|
|
|
GetActiveWindow()->GetOutputSizePixel()) );
|
2000-09-18 16:07:07 +00:00
|
|
|
pZoomList->InsertZoomRect(aVisAreaWin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Invalidate( SID_ZOOM_IN );
|
|
|
|
Invalidate( SID_ZOOM_OUT );
|
|
|
|
Invalidate( SID_ZOOM_PANNING );
|
|
|
|
Invalidate( SID_ZOOM_TOOLBOX );
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// Namensverwirrung: SID_SIZE_ALL -> Zoom auf alle Objekte
|
|
|
|
// --> Wird als Optimal im Programm angeboten
|
|
|
|
case SID_SIZE_ALL: // BASIC
|
|
|
|
{
|
|
|
|
bZoomOnPage = FALSE;
|
|
|
|
SdrPageView* pPageView = pDrView->GetPageViewPvNum( 0 );
|
|
|
|
|
|
|
|
if( pPageView )
|
|
|
|
{
|
|
|
|
Rectangle aBoundRect( pPageView->GetObjList()->GetAllObjBoundRect() );
|
|
|
|
|
|
|
|
long nW = (long) (aBoundRect.GetWidth() * 1.03);
|
|
|
|
long nH = (long) (aBoundRect.GetHeight() * 1.03);
|
|
|
|
Point aPos = aBoundRect.Center();
|
|
|
|
aPos.X() -= nW / 2;
|
|
|
|
aPos.Y() -= nH / 2;
|
|
|
|
if ( nW && nH )
|
|
|
|
{
|
|
|
|
SetZoomRect( Rectangle( aPos, Size( nW, nH ) ) );
|
|
|
|
|
2004-07-13 14:15:18 +00:00
|
|
|
Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
|
|
|
|
GetActiveWindow()->GetOutputSizePixel()) );
|
2000-09-18 16:07:07 +00:00
|
|
|
pZoomList->InsertZoomRect(aVisAreaWin);
|
|
|
|
}
|
|
|
|
|
|
|
|
Invalidate( SID_ZOOM_IN );
|
|
|
|
Invalidate( SID_ZOOM_OUT );
|
|
|
|
Invalidate( SID_ZOOM_PANNING );
|
|
|
|
Invalidate( SID_ZOOM_TOOLBOX );
|
|
|
|
}
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ZOOM_PREV:
|
|
|
|
{
|
|
|
|
if (pDrView->IsTextEdit())
|
|
|
|
{
|
|
|
|
pDrView->EndTextEdit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pZoomList->IsPreviousPossible())
|
|
|
|
{
|
|
|
|
// Vorheriges ZoomRect einstellen
|
|
|
|
SetZoomRect(pZoomList->GetPreviousZoomRect());
|
|
|
|
}
|
|
|
|
rReq.Done ();
|
|
|
|
Invalidate( SID_ZOOM_TOOLBOX );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ZOOM_NEXT:
|
|
|
|
{
|
|
|
|
if (pDrView->IsTextEdit())
|
|
|
|
{
|
|
|
|
pDrView->EndTextEdit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pZoomList->IsNextPossible())
|
|
|
|
{
|
|
|
|
// Naechstes ZoomRect einstellen
|
|
|
|
SetZoomRect(pZoomList->GetNextZoomRect());
|
|
|
|
}
|
|
|
|
rReq.Done ();
|
|
|
|
Invalidate( SID_ZOOM_TOOLBOX );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_GLUE_INSERT_POINT:
|
|
|
|
case SID_GLUE_PERCENT:
|
|
|
|
case SID_GLUE_ESCDIR:
|
|
|
|
case SID_GLUE_ESCDIR_LEFT:
|
|
|
|
case SID_GLUE_ESCDIR_RIGHT:
|
|
|
|
case SID_GLUE_ESCDIR_TOP:
|
|
|
|
case SID_GLUE_ESCDIR_BOTTOM:
|
|
|
|
case SID_GLUE_HORZALIGN_CENTER:
|
|
|
|
case SID_GLUE_HORZALIGN_LEFT:
|
|
|
|
case SID_GLUE_HORZALIGN_RIGHT:
|
|
|
|
case SID_GLUE_VERTALIGN_CENTER:
|
|
|
|
case SID_GLUE_VERTALIGN_TOP:
|
|
|
|
case SID_GLUE_VERTALIGN_BOTTOM:
|
|
|
|
{
|
2005-12-14 16:29:11 +00:00
|
|
|
FunctionReference xFunc( GetCurrentFunction() );
|
|
|
|
FuEditGluePoints* pFunc = dynamic_cast< FuEditGluePoints* >( xFunc.get() );
|
|
|
|
|
|
|
|
if(pFunc)
|
|
|
|
pFunc->ReceiveRequest(rReq);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifndef PRODUCT
|
|
|
|
case SID_SHOW_ITEMBROWSER:
|
|
|
|
{
|
|
|
|
pDrView->ShowItemBrowser( !pDrView->IsItemBrowserVisible() );
|
|
|
|
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
case SID_AUTOSPELL_CHECK:
|
|
|
|
{
|
2004-01-20 11:47:57 +00:00
|
|
|
BOOL bOnlineSpell = !GetDoc()->GetOnlineSpell();
|
|
|
|
GetDoc()->SetOnlineSpell(bOnlineSpell);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
::Outliner* pOL = pDrView->GetTextEditOutliner();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pOL)
|
|
|
|
{
|
|
|
|
ULONG nCntrl = pOL->GetControlWord();
|
|
|
|
|
|
|
|
if (bOnlineSpell)
|
|
|
|
nCntrl |= EE_CNTRL_ONLINESPELLING;
|
|
|
|
else
|
|
|
|
nCntrl &= ~EE_CNTRL_ONLINESPELLING;
|
|
|
|
|
|
|
|
pOL->SetControlWord(nCntrl);
|
|
|
|
}
|
|
|
|
|
2004-07-13 14:15:18 +00:00
|
|
|
GetActiveWindow()->Invalidate();
|
2000-09-18 16:07:07 +00:00
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONVERT_TO_1BIT_THRESHOLD:
|
|
|
|
case SID_CONVERT_TO_1BIT_MATRIX:
|
|
|
|
case SID_CONVERT_TO_4BIT_GRAYS:
|
|
|
|
case SID_CONVERT_TO_4BIT_COLORS:
|
|
|
|
case SID_CONVERT_TO_8BIT_GRAYS:
|
|
|
|
case SID_CONVERT_TO_8BIT_COLORS:
|
|
|
|
case SID_CONVERT_TO_24BIT:
|
|
|
|
{
|
|
|
|
BmpConversion eBmpConvert = BMP_CONVERSION_NONE;
|
|
|
|
|
|
|
|
switch( nSId )
|
|
|
|
{
|
|
|
|
case SID_CONVERT_TO_1BIT_THRESHOLD:
|
|
|
|
eBmpConvert = BMP_CONVERSION_1BIT_THRESHOLD;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONVERT_TO_1BIT_MATRIX:
|
|
|
|
eBmpConvert = BMP_CONVERSION_1BIT_MATRIX;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONVERT_TO_4BIT_GRAYS:
|
|
|
|
eBmpConvert = BMP_CONVERSION_4BIT_GREYS;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONVERT_TO_4BIT_COLORS:
|
|
|
|
eBmpConvert = BMP_CONVERSION_4BIT_COLORS;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONVERT_TO_8BIT_GRAYS:
|
|
|
|
eBmpConvert = BMP_CONVERSION_8BIT_GREYS;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONVERT_TO_8BIT_COLORS:
|
|
|
|
eBmpConvert = BMP_CONVERSION_8BIT_COLORS;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CONVERT_TO_24BIT:
|
|
|
|
eBmpConvert = BMP_CONVERSION_24BIT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->BegUndo(String(SdResId(STR_UNDO_COLORRESOLUTION)));
|
2004-07-12 14:20:08 +00:00
|
|
|
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
for (ULONG i=0; i<rMarkList.GetMarkCount(); i++)
|
|
|
|
{
|
|
|
|
SdrObject* pObj = rMarkList.GetMark(i)->GetObj();
|
|
|
|
|
|
|
|
if (pObj->GetObjInventor() == SdrInventor)
|
|
|
|
{
|
|
|
|
if (pObj->GetObjIdentifier() == OBJ_GRAF && !((SdrGrafObj*) pObj)->IsLinkedGraphic())
|
|
|
|
{
|
|
|
|
const Graphic& rGraphic = ((SdrGrafObj*) pObj)->GetGraphic();
|
|
|
|
|
|
|
|
if( rGraphic.GetType() == GRAPHIC_BITMAP )
|
|
|
|
{
|
|
|
|
SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->Clone();
|
|
|
|
|
|
|
|
if( rGraphic.IsAnimated() )
|
|
|
|
{
|
|
|
|
Animation aAnim( rGraphic.GetAnimation() );
|
|
|
|
aAnim.Convert( eBmpConvert );
|
|
|
|
pNewObj->SetGraphic( aAnim );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
|
|
|
|
aBmpEx.Convert( eBmpConvert );
|
|
|
|
pNewObj->SetGraphic( aBmpEx );
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->ReplaceObject( pObj, *pDrView->GetPageViewPvNum(0), pNewObj );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->EndUndo();
|
|
|
|
rReq.Done ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-03-12 06:54:26 +00:00
|
|
|
case SID_TRANSLITERATE_UPPER:
|
|
|
|
case SID_TRANSLITERATE_LOWER:
|
|
|
|
case SID_TRANSLITERATE_HALFWIDTH:
|
|
|
|
case SID_TRANSLITERATE_FULLWIDTH:
|
|
|
|
case SID_TRANSLITERATE_HIRAGANA:
|
|
|
|
case SID_TRANSLITERATE_KATAGANA:
|
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
OutlinerView* pOLV = GetView()->GetTextEditOutlinerView();
|
2001-03-12 06:54:26 +00:00
|
|
|
if( pOLV )
|
|
|
|
{
|
|
|
|
using namespace ::com::sun::star::i18n;
|
|
|
|
sal_Int32 nType = 0;
|
|
|
|
|
|
|
|
switch( nSId )
|
|
|
|
{
|
|
|
|
case SID_TRANSLITERATE_UPPER:
|
|
|
|
nType = TransliterationModules_LOWERCASE_UPPERCASE;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_LOWER:
|
|
|
|
nType = TransliterationModules_UPPERCASE_LOWERCASE;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_HALFWIDTH:
|
|
|
|
nType = TransliterationModules_FULLWIDTH_HALFWIDTH;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_FULLWIDTH:
|
|
|
|
nType = TransliterationModules_HALFWIDTH_FULLWIDTH;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_HIRAGANA:
|
|
|
|
nType = TransliterationModules_KATAKANA_HIRAGANA;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_KATAGANA:
|
|
|
|
nType = TransliterationModules_HIRAGANA_KATAKANA;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
pOLV->TransliterateText( nType );
|
|
|
|
}
|
|
|
|
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-04-27 10:37:50 +00:00
|
|
|
// #UndoRedo#
|
|
|
|
case SID_UNDO :
|
|
|
|
{
|
2002-01-16 10:10:17 +00:00
|
|
|
// #96090# moved implementation to BaseClass
|
|
|
|
ImpSidUndo(TRUE, rReq);
|
2001-04-27 10:37:50 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_REDO :
|
|
|
|
{
|
2002-01-16 10:10:17 +00:00
|
|
|
// #96090# moved implementation to BaseClass
|
|
|
|
ImpSidRedo(TRUE, rReq);
|
2001-04-27 10:37:50 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* URL-Feld einfuegen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
void DrawViewShell::InsertURLField(const String& rURL, const String& rText,
|
2000-09-18 16:07:07 +00:00
|
|
|
const String& rTarget, const Point* pPos)
|
|
|
|
{
|
|
|
|
SvxURLField aURLField(rURL, rText, SVXURLFORMAT_REPR);
|
|
|
|
aURLField.SetTargetFrame(rTarget);
|
|
|
|
SvxFieldItem aURLItem(aURLField);
|
|
|
|
|
|
|
|
OutlinerView* pOLV = pDrView->GetTextEditOutlinerView();
|
|
|
|
|
|
|
|
if (pOLV)
|
|
|
|
{
|
2001-06-12 13:31:07 +00:00
|
|
|
ESelection aSel( pOLV->GetSelection() );
|
2001-06-12 13:07:50 +00:00
|
|
|
SvxFieldItem aURLItem( SvxURLField( rURL, rText, SVXURLFORMAT_REPR ) );
|
|
|
|
pOLV->InsertField( aURLItem );
|
2001-06-12 13:31:07 +00:00
|
|
|
if ( aSel.nStartPos <= aSel.nEndPos )
|
|
|
|
aSel.nEndPos = aSel.nStartPos + 1;
|
|
|
|
else
|
|
|
|
aSel.nStartPos = aSel.nEndPos + 1;
|
2001-06-12 13:07:50 +00:00
|
|
|
pOLV->SetSelection( aSel );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-01-20 11:47:57 +00:00
|
|
|
Outliner* pOutl = GetDoc()->GetInternalOutliner();
|
2000-09-18 16:07:07 +00:00
|
|
|
pOutl->Init( OUTLINERMODE_TEXTOBJECT );
|
|
|
|
USHORT nOutlMode = pOutl->GetMode();
|
|
|
|
pOutl->QuickInsertField( aURLItem, ESelection() );
|
|
|
|
OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
|
|
|
|
|
|
|
|
SdrRectObj* pRectObj = new SdrRectObj(OBJ_TEXT);
|
|
|
|
|
|
|
|
pOutl->UpdateFields();
|
|
|
|
pOutl->SetUpdateMode( TRUE );
|
|
|
|
Size aSize(pOutl->CalcTextSize());
|
|
|
|
pOutl->SetUpdateMode( FALSE );
|
|
|
|
|
|
|
|
Point aPos;
|
|
|
|
|
|
|
|
if (pPos)
|
|
|
|
{
|
|
|
|
aPos = *pPos;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
|
2000-09-18 16:07:07 +00:00
|
|
|
aPos = aRect.Center();
|
2004-07-13 14:15:18 +00:00
|
|
|
aPos = GetActiveWindow()->PixelToLogic(aPos);
|
2000-09-18 16:07:07 +00:00
|
|
|
aPos.X() -= aSize.Width() / 2;
|
|
|
|
aPos.Y() -= aSize.Height() / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle aLogicRect(aPos, aSize);
|
|
|
|
pRectObj->SetLogicRect(aLogicRect);
|
|
|
|
pRectObj->SetOutlinerParaObject( pOutlParaObject );
|
|
|
|
pActualPage->InsertObject(pRectObj);
|
|
|
|
pOutl->Init( nOutlMode );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* URL-Button einfuegen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
void DrawViewShell::InsertURLButton(const String& rURL, const String& rText,
|
2000-09-18 16:07:07 +00:00
|
|
|
const String& rTarget, const Point* pPos)
|
|
|
|
{
|
|
|
|
BOOL bNewObj = TRUE;
|
|
|
|
|
2004-07-12 14:20:08 +00:00
|
|
|
if (pDrView->GetMarkedObjectList().GetMarkCount() > 0)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-12 14:20:08 +00:00
|
|
|
SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pDrView->GetMarkedObjectList().GetMark(0)->GetObj());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor() &&
|
|
|
|
pUnoCtrl->GetObjIdentifier() == OBJ_FM_BUTTON)
|
|
|
|
{
|
|
|
|
// Markiertes Objekt aendern
|
|
|
|
bNewObj = FALSE;
|
|
|
|
uno::Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel() );
|
|
|
|
|
|
|
|
if( !xControlModel.is() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
|
|
|
|
|
|
|
|
uno::Any aTmp;
|
|
|
|
|
|
|
|
aTmp <<= rtl::OUString( rText );
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), aTmp );
|
|
|
|
|
2005-01-11 11:13:05 +00:00
|
|
|
aTmp <<= rtl::OUString( ::URIHelper::SmartRel2Abs( INetURLObject( GetDocSh()->GetMedium()->GetBaseURL() ), rURL, URIHelper::GetMaybeFileHdl(), true, false,
|
2000-09-18 16:07:07 +00:00
|
|
|
INetURLObject::WAS_ENCODED,
|
|
|
|
INetURLObject::DECODE_UNAMBIGUOUS ) );
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), aTmp );
|
|
|
|
|
|
|
|
if( rTarget.Len() )
|
|
|
|
{
|
|
|
|
aTmp <<= rtl::OUString(rTarget);
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), aTmp );
|
|
|
|
}
|
|
|
|
|
|
|
|
form::FormButtonType eButtonType = form::FormButtonType_URL;
|
|
|
|
aTmp <<= eButtonType;
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), aTmp );
|
2003-03-27 09:58:12 +00:00
|
|
|
if ( Sound::IsSoundFile( rURL ) )
|
|
|
|
{
|
|
|
|
// #105638# OJ
|
|
|
|
aTmp <<= sal_True;
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), aTmp );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bNewObj)
|
|
|
|
{
|
|
|
|
SdrUnoObj* pUnoCtrl = (SdrUnoObj*) SdrObjFactory::MakeNewObject(FmFormInventor, OBJ_FM_BUTTON,
|
2004-01-20 11:47:57 +00:00
|
|
|
pDrView->GetPageViewPvNum(0)->GetPage(), GetDoc());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
uno::Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel() );
|
|
|
|
|
|
|
|
if( !xControlModel.is())
|
|
|
|
return;
|
|
|
|
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
|
|
|
|
|
|
|
|
uno::Any aTmp;
|
|
|
|
|
|
|
|
aTmp <<= rtl::OUString(rText);
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), aTmp );
|
|
|
|
|
2005-01-11 11:13:05 +00:00
|
|
|
aTmp <<= rtl::OUString( ::URIHelper::SmartRel2Abs( INetURLObject( GetDocSh()->GetMedium()->GetBaseURL() ), rURL, URIHelper::GetMaybeFileHdl(), true, false,
|
2000-09-18 16:07:07 +00:00
|
|
|
INetURLObject::WAS_ENCODED,
|
|
|
|
INetURLObject::DECODE_UNAMBIGUOUS ) );
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), aTmp );
|
|
|
|
|
|
|
|
if( rTarget.Len() )
|
|
|
|
{
|
|
|
|
aTmp <<= rtl::OUString(rTarget);
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), aTmp );
|
|
|
|
}
|
|
|
|
|
|
|
|
form::FormButtonType eButtonType = form::FormButtonType_URL;
|
|
|
|
aTmp <<= eButtonType;
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), aTmp );
|
2002-12-02 13:01:11 +00:00
|
|
|
// #105638# OJ
|
2003-03-27 09:58:12 +00:00
|
|
|
if ( Sound::IsSoundFile( rURL ) )
|
|
|
|
{
|
|
|
|
aTmp <<= sal_True;
|
|
|
|
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), aTmp );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
Point aPos;
|
|
|
|
|
|
|
|
if (pPos)
|
|
|
|
{
|
|
|
|
aPos = *pPos;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-07-13 14:15:18 +00:00
|
|
|
aPos = Rectangle(aPos, GetActiveWindow()->GetOutputSizePixel()).Center();
|
|
|
|
aPos = GetActiveWindow()->PixelToLogic(aPos);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Size aSize(4000, 1000);
|
|
|
|
aPos.X() -= aSize.Width() / 2;
|
|
|
|
aPos.Y() -= aSize.Height() / 2;
|
|
|
|
pUnoCtrl->SetLogicRect(Rectangle(aPos, aSize));
|
|
|
|
|
|
|
|
ULONG nOptions = SDRINSERT_SETDEFLAYER;
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
OSL_ASSERT (GetViewShell()!=NULL);
|
|
|
|
SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient();
|
2004-10-04 17:45:29 +00:00
|
|
|
if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
nOptions |= SDRINSERT_DONTMARK;
|
|
|
|
}
|
|
|
|
|
|
|
|
pDrView->InsertObject(pUnoCtrl, *pDrView->GetPageViewPvNum(0), nOptions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|*
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-08-04 08:01:19 +00:00
|
|
|
void DrawViewShell::ShowUIControls (bool bVisible)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-08-04 08:01:19 +00:00
|
|
|
ViewShell::ShowUIControls (bVisible);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-02-24 14:09:26 +00:00
|
|
|
//AF: The LayerDialogChildWindow is not used anymore (I hope).
|
|
|
|
// GetViewFrame()->SetChildWindow(
|
|
|
|
// LayerDialogChildWindow::GetChildWindowId(),
|
|
|
|
// IsLayerModeActive() && bVisible);
|
2004-07-13 14:15:18 +00:00
|
|
|
aTabControl.Show (bVisible);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-08-04 08:01:19 +00:00
|
|
|
|
2004-11-17 14:15:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
void DrawViewShell::StopSlideShow (bool bCloseFrame)
|
|
|
|
{
|
2004-11-27 13:41:03 +00:00
|
|
|
if (mpSlideShow != NULL)
|
2004-11-17 14:15:01 +00:00
|
|
|
{
|
|
|
|
if( pDrView->IsTextEdit() )
|
|
|
|
pDrView->EndTextEdit();
|
|
|
|
|
2004-11-30 09:14:52 +00:00
|
|
|
// mpSlideShow->Deactivate();
|
2004-11-27 13:41:03 +00:00
|
|
|
delete mpSlideShow;
|
|
|
|
mpSlideShow = NULL;
|
2004-11-17 14:15:01 +00:00
|
|
|
|
|
|
|
if( ISA(PresentationViewShell))
|
|
|
|
{
|
|
|
|
|
|
|
|
if (bCloseFrame)
|
|
|
|
GetViewFrame()->DoClose();
|
|
|
|
}
|
|
|
|
else if( pFrameView->GetPresentationViewShellId() != SID_VIEWSHELL0 )
|
|
|
|
{
|
|
|
|
ViewShell::ShellType ePreviousType (pFrameView->GetPreviousViewShellType());
|
2005-07-07 12:39:29 +00:00
|
|
|
pFrameView->SetPreviousViewShellType(ViewShell::ST_NONE);
|
2004-11-17 14:15:01 +00:00
|
|
|
|
|
|
|
pFrameView->SetPresentationViewShellId(SID_VIEWSHELL0);
|
|
|
|
pFrameView->SetSlotId(SID_OBJECT_SELECT);
|
|
|
|
pFrameView->SetPreviousViewShellType(GetShellType());
|
|
|
|
|
|
|
|
GetViewShellBase().GetPaneManager().RequestMainViewShellChange(ePreviousType);
|
|
|
|
|
|
|
|
GetViewFrame()->GetBindings().InvalidateAll( TRUE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifdef WNT
|
|
|
|
#pragma optimize ( "", on )
|
|
|
|
#endif
|
|
|
|
|
2004-01-20 11:47:57 +00:00
|
|
|
} // end of namespace sd
|