xref: /AOO41X/main/sd/source/ui/func/fupoor.cxx (revision 79aad27f7f29270c03e208e3d687e8e3850af11d)
1*5b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*5b190011SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*5b190011SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*5b190011SAndrew Rist  * distributed with this work for additional information
6*5b190011SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*5b190011SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*5b190011SAndrew Rist  * "License"); you may not use this file except in compliance
9*5b190011SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*5b190011SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*5b190011SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*5b190011SAndrew Rist  * software distributed under the License is distributed on an
15*5b190011SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5b190011SAndrew Rist  * KIND, either express or implied.  See the License for the
17*5b190011SAndrew Rist  * specific language governing permissions and limitations
18*5b190011SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*5b190011SAndrew Rist  *************************************************************/
21*5b190011SAndrew Rist 
22*5b190011SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "fupoor.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <svx/svxids.hrc>
31cdf0e10cSrcweir #include <svl/aeitem.hxx>
32cdf0e10cSrcweir #include <svx/svdpagv.hxx>
33cdf0e10cSrcweir #include <svx/svdoole2.hxx>
34cdf0e10cSrcweir #include <svx/svdograf.hxx>
35cdf0e10cSrcweir #include <vcl/seleng.hxx>
36cdf0e10cSrcweir #include <sfx2/app.hxx>
37cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
38cdf0e10cSrcweir #include <sfx2/bindings.hxx>
39cdf0e10cSrcweir #include <sfx2/request.hxx>
40cdf0e10cSrcweir #include <vcl/dialog.hxx>
41cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
42cdf0e10cSrcweir #include <com/sun/star/drawing/XLayer.hpp>
43cdf0e10cSrcweir #include <com/sun/star/drawing/XLayerManager.hpp>
44cdf0e10cSrcweir #include <com/sun/star/container/XChild.hpp>
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #ifndef SD_FRAMW_VIEW_HXX
47cdf0e10cSrcweir #include "FrameView.hxx"
48cdf0e10cSrcweir #endif
49cdf0e10cSrcweir #include "app.hrc"
50cdf0e10cSrcweir #include "fusel.hxx"
51cdf0e10cSrcweir #include "sdpage.hxx"
52cdf0e10cSrcweir #include "drawview.hxx"
53cdf0e10cSrcweir #include "DrawViewShell.hxx"
54cdf0e10cSrcweir #ifndef SD_WINDOW_SHELL_HXX
55cdf0e10cSrcweir #include "Window.hxx"
56cdf0e10cSrcweir #endif
57cdf0e10cSrcweir #include "drawdoc.hxx"
58cdf0e10cSrcweir #include "DrawDocShell.hxx"
59cdf0e10cSrcweir #include "zoomlist.hxx"
60cdf0e10cSrcweir #include "Client.hxx"
61cdf0e10cSrcweir #include "slideshow.hxx"
62cdf0e10cSrcweir #include "LayerTabBar.hxx"
63cdf0e10cSrcweir 
64cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
65cdf0e10cSrcweir 
66cdf0e10cSrcweir // #97016# IV
67cdf0e10cSrcweir #include <svx/svditer.hxx>
68cdf0e10cSrcweir 
69cdf0e10cSrcweir // #98533#
70cdf0e10cSrcweir #include <editeng/editeng.hxx>
71cdf0e10cSrcweir 
72cdf0e10cSrcweir using namespace ::com::sun::star;
73cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir namespace sd {
76cdf0e10cSrcweir 
77cdf0e10cSrcweir TYPEINIT0( FuPoor );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir /*************************************************************************
80cdf0e10cSrcweir |*
81cdf0e10cSrcweir |* Konstruktor
82cdf0e10cSrcweir |*
83cdf0e10cSrcweir \************************************************************************/
84cdf0e10cSrcweir 
FuPoor(ViewShell * pViewSh,::sd::Window * pWin,::sd::View * pView,SdDrawDocument * pDrDoc,SfxRequest & rReq)85cdf0e10cSrcweir FuPoor::FuPoor (
86cdf0e10cSrcweir     ViewShell* pViewSh,
87cdf0e10cSrcweir     ::sd::Window* pWin,
88cdf0e10cSrcweir     ::sd::View* pView,
89cdf0e10cSrcweir     SdDrawDocument* pDrDoc,
90cdf0e10cSrcweir     SfxRequest& rReq)
91cdf0e10cSrcweir     : mpView(pView),
92cdf0e10cSrcweir 	  mpViewShell(pViewSh),
93cdf0e10cSrcweir 	  mpWindow(pWin),
94cdf0e10cSrcweir 	  mpDocSh( pDrDoc->GetDocSh() ),
95cdf0e10cSrcweir 	  mpDoc(pDrDoc),
96cdf0e10cSrcweir       nSlotId( rReq.GetSlot() ),
97cdf0e10cSrcweir 	  nSlotValue(0),
98cdf0e10cSrcweir 	  pDialog(NULL),
99cdf0e10cSrcweir 	  bIsInDragMode(sal_False),
100cdf0e10cSrcweir 	  bNoScrollUntilInside (sal_True),
101cdf0e10cSrcweir 	  bScrollable (sal_False),
102cdf0e10cSrcweir 	  bDelayActive (sal_False),
103cdf0e10cSrcweir 	  bFirstMouseMove (sal_False),
104cdf0e10cSrcweir 	  // #95491# remember MouseButton state
105cdf0e10cSrcweir 	  mnCode(0)
106cdf0e10cSrcweir {
107cdf0e10cSrcweir 	ReceiveRequest(rReq);
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	aScrollTimer.SetTimeoutHdl( LINK(this, FuPoor, ScrollHdl) );
110cdf0e10cSrcweir 	aScrollTimer.SetTimeout(SELENG_AUTOREPEAT_INTERVAL);
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 	aDragTimer.SetTimeoutHdl( LINK(this, FuPoor, DragHdl) );
113cdf0e10cSrcweir 	aDragTimer.SetTimeout(SELENG_DRAGDROP_TIMEOUT);
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	aDelayToScrollTimer.SetTimeoutHdl( LINK(this, FuPoor, DelayHdl) );
116cdf0e10cSrcweir 	aDelayToScrollTimer.SetTimeout(2000);
117cdf0e10cSrcweir }
118cdf0e10cSrcweir 
119cdf0e10cSrcweir /*************************************************************************
120cdf0e10cSrcweir |*
121cdf0e10cSrcweir |* Destruktor
122cdf0e10cSrcweir |*
123cdf0e10cSrcweir \************************************************************************/
124cdf0e10cSrcweir 
~FuPoor()125cdf0e10cSrcweir FuPoor::~FuPoor()
126cdf0e10cSrcweir {
127cdf0e10cSrcweir 	aDragTimer.Stop();
128cdf0e10cSrcweir 	aScrollTimer.Stop();
129cdf0e10cSrcweir 	aDelayToScrollTimer.Stop ();
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	if (pDialog)
132cdf0e10cSrcweir 		delete pDialog;
133cdf0e10cSrcweir }
134cdf0e10cSrcweir 
135cdf0e10cSrcweir /*************************************************************************
136cdf0e10cSrcweir |*
137cdf0e10cSrcweir |* Function aktivieren
138cdf0e10cSrcweir |*
139cdf0e10cSrcweir \************************************************************************/
140cdf0e10cSrcweir 
Activate()141cdf0e10cSrcweir void FuPoor::Activate()
142cdf0e10cSrcweir {
143cdf0e10cSrcweir 	if (pDialog)
144cdf0e10cSrcweir 	{
145cdf0e10cSrcweir 		pDialog->Show();
146cdf0e10cSrcweir 	}
147cdf0e10cSrcweir }
148cdf0e10cSrcweir 
149cdf0e10cSrcweir /*************************************************************************
150cdf0e10cSrcweir |*
151cdf0e10cSrcweir |* Function deaktivieren
152cdf0e10cSrcweir |*
153cdf0e10cSrcweir \************************************************************************/
154cdf0e10cSrcweir 
Deactivate()155cdf0e10cSrcweir void FuPoor::Deactivate()
156cdf0e10cSrcweir {
157cdf0e10cSrcweir 	aDragTimer.Stop();
158cdf0e10cSrcweir 	aScrollTimer.Stop();
159cdf0e10cSrcweir 	aDelayToScrollTimer.Stop ();
160cdf0e10cSrcweir 		bScrollable  =
161cdf0e10cSrcweir 		bDelayActive = sal_False;
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 	if (pDialog)
164cdf0e10cSrcweir 	{
165cdf0e10cSrcweir 		pDialog->Hide();
166cdf0e10cSrcweir 	}
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 	if (mpWindow) mpWindow->ReleaseMouse ();
169cdf0e10cSrcweir }
170cdf0e10cSrcweir 
171cdf0e10cSrcweir /*************************************************************************
172cdf0e10cSrcweir |*
173cdf0e10cSrcweir |* Scrollen bei Erreichen des Fensterrandes; wird von
174cdf0e10cSrcweir |* MouseMove aufgerufen
175cdf0e10cSrcweir |*
176cdf0e10cSrcweir \************************************************************************/
177cdf0e10cSrcweir 
ForceScroll(const Point & aPixPos)178cdf0e10cSrcweir void FuPoor::ForceScroll(const Point& aPixPos)
179cdf0e10cSrcweir {
180cdf0e10cSrcweir 	aScrollTimer.Stop();
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 	if ( !mpView->IsDragHelpLine() && !mpView->IsSetPageOrg() &&
183cdf0e10cSrcweir 			!SlideShow::IsRunning( mpViewShell->GetViewShellBase() ) )
184cdf0e10cSrcweir 	{
185cdf0e10cSrcweir /*		Size aSize = mpWindow->GetSizePixel();
186cdf0e10cSrcweir 		short dx = 0, dy = 0;
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 		if ( aPixPos.X() <= 0			   ) dx = -1;
189cdf0e10cSrcweir 		if ( aPixPos.X() >= aSize.Width()  ) dx =  1;
190cdf0e10cSrcweir 		if ( aPixPos.Y() <= 0			   ) dy = -1;
191cdf0e10cSrcweir 		if ( aPixPos.Y() >= aSize.Height() ) dy =  1;
192cdf0e10cSrcweir */
193cdf0e10cSrcweir 		Point aPos = mpWindow->OutputToScreenPixel(aPixPos);
194cdf0e10cSrcweir 		const Rectangle& rRect = mpViewShell->GetAllWindowRect();
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 		if ( bNoScrollUntilInside )
197cdf0e10cSrcweir 		{
198cdf0e10cSrcweir 			if ( rRect.IsInside(aPos) )
199cdf0e10cSrcweir 				bNoScrollUntilInside = sal_False;
200cdf0e10cSrcweir 		}
201cdf0e10cSrcweir 		else
202cdf0e10cSrcweir 		{
203cdf0e10cSrcweir 			short dx = 0, dy = 0;
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 			if ( aPos.X() <= rRect.Left()	) dx = -1;
206cdf0e10cSrcweir 			if ( aPos.X() >= rRect.Right()	) dx =	1;
207cdf0e10cSrcweir 			if ( aPos.Y() <= rRect.Top()	) dy = -1;
208cdf0e10cSrcweir 			if ( aPos.Y() >= rRect.Bottom() ) dy =	1;
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 			if ( dx != 0 || dy != 0 )
211cdf0e10cSrcweir 			{
212cdf0e10cSrcweir 				if (bScrollable)
213cdf0e10cSrcweir 				{
214cdf0e10cSrcweir 					// Scrollaktion in abgeleiteter Klasse
215cdf0e10cSrcweir 					ScrollStart();
216cdf0e10cSrcweir 					mpViewShell->ScrollLines(dx, dy);
217cdf0e10cSrcweir 					ScrollEnd();
218cdf0e10cSrcweir 					aScrollTimer.Start();
219cdf0e10cSrcweir 				}
220cdf0e10cSrcweir 				else if (! bDelayActive) StartDelayToScrollTimer ();
221cdf0e10cSrcweir 			}
222cdf0e10cSrcweir 		}
223cdf0e10cSrcweir 	}
224cdf0e10cSrcweir }
225cdf0e10cSrcweir 
226cdf0e10cSrcweir /*************************************************************************
227cdf0e10cSrcweir |*
228cdf0e10cSrcweir |* Timer-Handler fuer Fensterscrolling
229cdf0e10cSrcweir |*
230cdf0e10cSrcweir \************************************************************************/
231cdf0e10cSrcweir 
IMPL_LINK_INLINE_START(FuPoor,ScrollHdl,Timer *,EMPTYARG)232cdf0e10cSrcweir IMPL_LINK_INLINE_START( FuPoor, ScrollHdl, Timer *, EMPTYARG )
233cdf0e10cSrcweir {
234cdf0e10cSrcweir 	Point aPnt(mpWindow->GetPointerPosPixel());
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	// #95491# use remembered MouseButton state to create correct
237cdf0e10cSrcweir 	// MouseEvents for this artifical MouseMove.
238cdf0e10cSrcweir 	MouseMove(MouseEvent(aPnt, 1, 0, GetMouseButtonCode()));
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 	return 0;
241cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(FuPoor,ScrollHdl,Timer *,pTimer)242cdf0e10cSrcweir IMPL_LINK_INLINE_END( FuPoor, ScrollHdl, Timer *, pTimer )
243cdf0e10cSrcweir 
244cdf0e10cSrcweir /*************************************************************************
245cdf0e10cSrcweir |*
246cdf0e10cSrcweir |* Tastaturereignisse bearbeiten
247cdf0e10cSrcweir |*
248cdf0e10cSrcweir |* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
249cdf0e10cSrcweir |* sal_False.
250cdf0e10cSrcweir |*
251cdf0e10cSrcweir \************************************************************************/
252cdf0e10cSrcweir 
253cdf0e10cSrcweir sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
254cdf0e10cSrcweir {
255cdf0e10cSrcweir 	sal_uInt16          nCode = rKEvt.GetKeyCode().GetCode();
256cdf0e10cSrcweir 	sal_Bool            bReturn = sal_False;
257cdf0e10cSrcweir 	sal_Bool            bSlideShow = SlideShow::IsRunning( mpViewShell->GetViewShellBase() );
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 	switch (nCode)
260cdf0e10cSrcweir 	{
261cdf0e10cSrcweir 		// #97016# IV
262cdf0e10cSrcweir 		case KEY_RETURN:
263cdf0e10cSrcweir 		{
264cdf0e10cSrcweir 			if(rKEvt.GetKeyCode().IsMod1())
265cdf0e10cSrcweir 			{
266cdf0e10cSrcweir 				if(mpViewShell && mpViewShell->ISA(DrawViewShell))
267cdf0e10cSrcweir 				{
268cdf0e10cSrcweir 					DrawViewShell* pDrawViewShell =
269cdf0e10cSrcweir                         static_cast<DrawViewShell*>(mpViewShell);
270cdf0e10cSrcweir 					SdPage* pActualPage = pDrawViewShell->GetActualPage();
271cdf0e10cSrcweir 					SdrTextObj* pCandidate = 0L;
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 					if(pActualPage)
274cdf0e10cSrcweir 					{
275cdf0e10cSrcweir 						SdrObjListIter aIter(*pActualPage, IM_DEEPNOGROUPS);
276cdf0e10cSrcweir 
277cdf0e10cSrcweir 						while(aIter.IsMore() && !pCandidate)
278cdf0e10cSrcweir 						{
279cdf0e10cSrcweir 							SdrObject* pObj = aIter.Next();
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 							if(pObj && pObj->ISA(SdrTextObj))
282cdf0e10cSrcweir 							{
283cdf0e10cSrcweir 								sal_uInt32 nInv(pObj->GetObjInventor());
284cdf0e10cSrcweir 								sal_uInt16 nKnd(pObj->GetObjIdentifier());
285cdf0e10cSrcweir 
286cdf0e10cSrcweir 								if(SdrInventor == nInv &&
287cdf0e10cSrcweir 									(OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd))
288cdf0e10cSrcweir 								{
289cdf0e10cSrcweir 									pCandidate = (SdrTextObj*)pObj;
290cdf0e10cSrcweir 								}
291cdf0e10cSrcweir 							}
292cdf0e10cSrcweir 						}
293cdf0e10cSrcweir 					}
294cdf0e10cSrcweir 
295cdf0e10cSrcweir 					if(pCandidate)
296cdf0e10cSrcweir 					{
297cdf0e10cSrcweir 						mpView->UnMarkAll();
298cdf0e10cSrcweir 						mpView->MarkObj(pCandidate, mpView->GetSdrPageView());
299cdf0e10cSrcweir 
300cdf0e10cSrcweir 						mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
301cdf0e10cSrcweir 							SID_ATTR_CHAR, SFX_CALLMODE_ASYNCHRON);
302cdf0e10cSrcweir 					}
303cdf0e10cSrcweir 					else
304cdf0e10cSrcweir 					{
305cdf0e10cSrcweir 						// insert a new page with the same page layout
306cdf0e10cSrcweir 						mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
307cdf0e10cSrcweir 							SID_INSERTPAGE_QUICK, SFX_CALLMODE_ASYNCHRON);
308cdf0e10cSrcweir 					}
309cdf0e10cSrcweir 
310cdf0e10cSrcweir 					// consumed
311cdf0e10cSrcweir 					bReturn = sal_True;
312cdf0e10cSrcweir 				}
313cdf0e10cSrcweir 			}
314cdf0e10cSrcweir 			else
315cdf0e10cSrcweir 			{
316cdf0e10cSrcweir                 // #98255# activate OLE object on RETURN for selected object
317cdf0e10cSrcweir 				// #98198# activate text edit on RETURN for selected object
318cdf0e10cSrcweir 				const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
319cdf0e10cSrcweir 
320cdf0e10cSrcweir 				if( !mpView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
321cdf0e10cSrcweir 				{
322cdf0e10cSrcweir                     SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
323cdf0e10cSrcweir 
324cdf0e10cSrcweir         			if( pObj && pObj->ISA( SdrOle2Obj ) && !mpDocSh->IsUIActive() )
325cdf0e10cSrcweir 			        {
326cdf0e10cSrcweir                         //HMHmpView->HideMarkHdl();
327cdf0e10cSrcweir                         mpViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
328cdf0e10cSrcweir 			        }
329cdf0e10cSrcweir 			        else if( pObj && pObj->IsEmptyPresObj() && pObj->ISA( SdrGrafObj ) )
330cdf0e10cSrcweir 			        {
331cdf0e10cSrcweir 				        mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_GRAPHIC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
332cdf0e10cSrcweir 			        }
333cdf0e10cSrcweir                     else
334cdf0e10cSrcweir                     {
335cdf0e10cSrcweir     					mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_CHAR, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
336cdf0e10cSrcweir                     }
337cdf0e10cSrcweir 
338cdf0e10cSrcweir 					// consumed
339cdf0e10cSrcweir 					bReturn = sal_True;
340cdf0e10cSrcweir 				}
341cdf0e10cSrcweir 			}
342cdf0e10cSrcweir 		}
343cdf0e10cSrcweir 		break;
344cdf0e10cSrcweir 
345cdf0e10cSrcweir 		// #97016# II
346cdf0e10cSrcweir 		case KEY_TAB:
347cdf0e10cSrcweir 		{
348cdf0e10cSrcweir 			// #98994# handle Mod1 and Mod2 to get travelling running on different systems
349cdf0e10cSrcweir 			if(rKEvt.GetKeyCode().IsMod1() || rKEvt.GetKeyCode().IsMod2())
350cdf0e10cSrcweir 			{
351cdf0e10cSrcweir 				// #97016# II do something with a selected handle?
352cdf0e10cSrcweir 				const SdrHdlList& rHdlList = mpView->GetHdlList();
353cdf0e10cSrcweir 				sal_Bool bForward(!rKEvt.GetKeyCode().IsShift());
354cdf0e10cSrcweir 
355cdf0e10cSrcweir 				((SdrHdlList&)rHdlList).TravelFocusHdl(bForward);
356cdf0e10cSrcweir 
357cdf0e10cSrcweir 				// guarantee visibility of focused handle
358cdf0e10cSrcweir 				SdrHdl* pHdl = rHdlList.GetFocusHdl();
359cdf0e10cSrcweir 
360cdf0e10cSrcweir 				if(pHdl)
361cdf0e10cSrcweir 				{
362cdf0e10cSrcweir 					Point aHdlPosition(pHdl->GetPos());
363cdf0e10cSrcweir 					Rectangle aVisRect(aHdlPosition - Point(100, 100), Size(200, 200));
364cdf0e10cSrcweir 					mpView->MakeVisible(aVisRect, *mpWindow);
365cdf0e10cSrcweir 				}
366cdf0e10cSrcweir 
367cdf0e10cSrcweir 				// consumed
368cdf0e10cSrcweir 				bReturn = sal_True;
369cdf0e10cSrcweir 			}
370cdf0e10cSrcweir 		}
371cdf0e10cSrcweir 		break;
372cdf0e10cSrcweir 
373cdf0e10cSrcweir 		case KEY_ESCAPE:
374cdf0e10cSrcweir 		{
375cdf0e10cSrcweir 			bReturn = FuPoor::cancel();
376cdf0e10cSrcweir 		}
377cdf0e10cSrcweir 		break;
378cdf0e10cSrcweir 
379cdf0e10cSrcweir 		case KEY_ADD:
380cdf0e10cSrcweir 		{
381cdf0e10cSrcweir 			if (!mpView->IsTextEdit() && !bSlideShow && !mpDocSh->IsUIActive())
382cdf0e10cSrcweir 			{
383cdf0e10cSrcweir 				// Zoom vergroessern
384cdf0e10cSrcweir 				mpViewShell->SetZoom(mpWindow->GetZoom() * 3 / 2);
385cdf0e10cSrcweir 
386cdf0e10cSrcweir 				if (mpViewShell->ISA(DrawViewShell))
387cdf0e10cSrcweir 					static_cast<DrawViewShell*>(mpViewShell)
388cdf0e10cSrcweir                         ->SetZoomOnPage(sal_False);
389cdf0e10cSrcweir 
390cdf0e10cSrcweir 				bReturn = sal_True;
391cdf0e10cSrcweir 			}
392cdf0e10cSrcweir 		}
393cdf0e10cSrcweir 		break;
394cdf0e10cSrcweir 
395cdf0e10cSrcweir 		case KEY_SUBTRACT:
396cdf0e10cSrcweir 		{
397cdf0e10cSrcweir 			if (!mpView->IsTextEdit() && !bSlideShow && !mpDocSh->IsUIActive())
398cdf0e10cSrcweir 			{
399cdf0e10cSrcweir 				// Zoom verringern
400cdf0e10cSrcweir 				mpViewShell->SetZoom(mpWindow->GetZoom() * 2 / 3);
401cdf0e10cSrcweir 
402cdf0e10cSrcweir 				if (mpViewShell->ISA(DrawViewShell))
403cdf0e10cSrcweir 					static_cast<DrawViewShell*>(mpViewShell)
404cdf0e10cSrcweir                         ->SetZoomOnPage(sal_False);
405cdf0e10cSrcweir 
406cdf0e10cSrcweir 				bReturn = sal_True;
407cdf0e10cSrcweir 			}
408cdf0e10cSrcweir 		}
409cdf0e10cSrcweir 		break;
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 		case KEY_MULTIPLY:
412cdf0e10cSrcweir 		{
413cdf0e10cSrcweir 			if (!mpView->IsTextEdit() && !bSlideShow)
414cdf0e10cSrcweir 			{
415cdf0e10cSrcweir 				// Zoom auf Seite
416cdf0e10cSrcweir 				mpViewShell->GetViewFrame()->GetDispatcher()->
417cdf0e10cSrcweir 				Execute(SID_SIZE_PAGE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
418cdf0e10cSrcweir 				bReturn = sal_True;
419cdf0e10cSrcweir 			}
420cdf0e10cSrcweir 		}
421cdf0e10cSrcweir 		break;
422cdf0e10cSrcweir 
423cdf0e10cSrcweir 		case KEY_DIVIDE:
424cdf0e10cSrcweir 		{
425cdf0e10cSrcweir 			if (!mpView->IsTextEdit() && !bSlideShow)
426cdf0e10cSrcweir 			{
427cdf0e10cSrcweir 				// Zoom auf selektierte Objekte
428cdf0e10cSrcweir 				mpViewShell->GetViewFrame()->GetDispatcher()->
429cdf0e10cSrcweir 				Execute(SID_SIZE_OPTIMAL, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
430cdf0e10cSrcweir 				bReturn = sal_True;
431cdf0e10cSrcweir 			}
432cdf0e10cSrcweir 		}
433cdf0e10cSrcweir 		break;
434cdf0e10cSrcweir 
435cdf0e10cSrcweir 		case KEY_POINT:
436cdf0e10cSrcweir 		{
437cdf0e10cSrcweir 			ZoomList* pZoomList = mpViewShell->GetZoomList();
438cdf0e10cSrcweir 
439cdf0e10cSrcweir 			if (!mpView->IsTextEdit() && pZoomList->IsNextPossible() && !bSlideShow && !mpDocSh->IsUIActive())
440cdf0e10cSrcweir 			{
441cdf0e10cSrcweir 				// Naechstes ZoomRect einstellen
442cdf0e10cSrcweir 				mpViewShell->SetZoomRect(pZoomList->GetNextZoomRect());
443cdf0e10cSrcweir 				bReturn = sal_True;
444cdf0e10cSrcweir 			}
445cdf0e10cSrcweir 		}
446cdf0e10cSrcweir 		break;
447cdf0e10cSrcweir 
448cdf0e10cSrcweir 		case KEY_COMMA:
449cdf0e10cSrcweir 		{
450cdf0e10cSrcweir 			ZoomList* pZoomList = mpViewShell->GetZoomList();
451cdf0e10cSrcweir 
452cdf0e10cSrcweir 			if (!mpView->IsTextEdit() && pZoomList->IsPreviousPossible() && !bSlideShow && !mpDocSh->IsUIActive())
453cdf0e10cSrcweir 			{
454cdf0e10cSrcweir 				// Vorheriges ZoomRect einstellen
455cdf0e10cSrcweir 				mpViewShell->SetZoomRect(pZoomList->GetPreviousZoomRect());
456cdf0e10cSrcweir 				bReturn = sal_True;
457cdf0e10cSrcweir 			}
458cdf0e10cSrcweir 		}
459cdf0e10cSrcweir 		break;
460cdf0e10cSrcweir 
461cdf0e10cSrcweir 		case KEY_HOME:
462cdf0e10cSrcweir 		{
463cdf0e10cSrcweir 			if (!mpView->IsTextEdit()
464cdf0e10cSrcweir                 && mpViewShell->ISA(DrawViewShell)
465cdf0e10cSrcweir                 && !bSlideShow)
466cdf0e10cSrcweir 			{
467cdf0e10cSrcweir 			   // Sprung zu erster Seite
468cdf0e10cSrcweir 			   static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(0);
469cdf0e10cSrcweir 			   bReturn = sal_True;
470cdf0e10cSrcweir 			}
471cdf0e10cSrcweir 		}
472cdf0e10cSrcweir 		break;
473cdf0e10cSrcweir 
474cdf0e10cSrcweir 		case KEY_END:
475cdf0e10cSrcweir 		{
476cdf0e10cSrcweir 			if (!mpView->IsTextEdit()
477cdf0e10cSrcweir                 && mpViewShell->ISA(DrawViewShell)
478cdf0e10cSrcweir                 && !bSlideShow)
479cdf0e10cSrcweir 			{
480cdf0e10cSrcweir 				// Sprung zu letzter Seite
481cdf0e10cSrcweir 				SdPage* pPage =
482cdf0e10cSrcweir                     static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
483cdf0e10cSrcweir 				static_cast<DrawViewShell*>(mpViewShell)
484cdf0e10cSrcweir                     ->SwitchPage(mpDoc->GetSdPageCount(
485cdf0e10cSrcweir                         pPage->GetPageKind()) - 1);
486cdf0e10cSrcweir 				bReturn = sal_True;
487cdf0e10cSrcweir 			}
488cdf0e10cSrcweir 		}
489cdf0e10cSrcweir 		break;
490cdf0e10cSrcweir 
491cdf0e10cSrcweir 		case KEY_PAGEUP:
492cdf0e10cSrcweir 		{
493cdf0e10cSrcweir 		    if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() )
494cdf0e10cSrcweir 		        break;
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 			if(mpViewShell->ISA(DrawViewShell) && !bSlideShow)
497cdf0e10cSrcweir 			{
498cdf0e10cSrcweir                 // The page-up key switches layers or pages depending on the
499cdf0e10cSrcweir                 // modifier key.
500cdf0e10cSrcweir                 if ( ! rKEvt.GetKeyCode().GetAllModifier())
501cdf0e10cSrcweir                 {
502cdf0e10cSrcweir                     // With no modifier pressed we move to the previous
503cdf0e10cSrcweir                     // slide.
504cdf0e10cSrcweir                     mpView->SdrEndTextEdit();
505cdf0e10cSrcweir 
506cdf0e10cSrcweir                     // Previous page.
507cdf0e10cSrcweir                     bReturn = sal_True;
508cdf0e10cSrcweir                     SdPage* pPage = static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
509cdf0e10cSrcweir                     sal_uInt16 nSdPage = (pPage->GetPageNum() - 1) / 2;
510cdf0e10cSrcweir 
511cdf0e10cSrcweir                     if (nSdPage > 0)
512cdf0e10cSrcweir                     {
513cdf0e10cSrcweir                         // Switch the page and send events regarding
514cdf0e10cSrcweir                         // deactivation the old page and activating the new
515cdf0e10cSrcweir                         // one.
516cdf0e10cSrcweir                         TabControl* pPageTabControl =
517cdf0e10cSrcweir                             static_cast<DrawViewShell*>(mpViewShell)
518cdf0e10cSrcweir                             ->GetPageTabControl();
519cdf0e10cSrcweir                         if (pPageTabControl->IsReallyShown())
520cdf0e10cSrcweir                             pPageTabControl->SendDeactivatePageEvent ();
521cdf0e10cSrcweir                         static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(nSdPage - 1);
522cdf0e10cSrcweir                         if (pPageTabControl->IsReallyShown())
523cdf0e10cSrcweir                             pPageTabControl->SendActivatePageEvent ();
524cdf0e10cSrcweir                     }
525cdf0e10cSrcweir                 }
526cdf0e10cSrcweir                 else if (rKEvt.GetKeyCode().IsMod1())
527cdf0e10cSrcweir                 {
528cdf0e10cSrcweir                     // With the CONTROL modifier we switch layers.
529cdf0e10cSrcweir                     if (static_cast<DrawViewShell*>(mpViewShell)->IsLayerModeActive())
530cdf0e10cSrcweir                     {
531cdf0e10cSrcweir                         // Moves to the previous layer.
532cdf0e10cSrcweir                         SwitchLayer (-1);
533cdf0e10cSrcweir                     }
534cdf0e10cSrcweir                 }
535cdf0e10cSrcweir             }
536cdf0e10cSrcweir 		}
537cdf0e10cSrcweir 		break;
538cdf0e10cSrcweir 
539cdf0e10cSrcweir 		case KEY_PAGEDOWN:
540cdf0e10cSrcweir 		{
541cdf0e10cSrcweir 		    if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() )
542cdf0e10cSrcweir 		        break;
543cdf0e10cSrcweir             if(mpViewShell->ISA(DrawViewShell) && !bSlideShow)
544cdf0e10cSrcweir             {
545cdf0e10cSrcweir                 // The page-down key switches layers or pages depending on the
546cdf0e10cSrcweir                 // modifier key.
547cdf0e10cSrcweir                 if ( ! rKEvt.GetKeyCode().GetAllModifier())
548cdf0e10cSrcweir                 {
549cdf0e10cSrcweir                     // With no modifier pressed we move to the next slide.
550cdf0e10cSrcweir                     mpView->SdrEndTextEdit();
551cdf0e10cSrcweir 
552cdf0e10cSrcweir                     // Next page.
553cdf0e10cSrcweir                     bReturn = sal_True;
554cdf0e10cSrcweir                     SdPage* pPage = static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
555cdf0e10cSrcweir                     sal_uInt16 nSdPage = (pPage->GetPageNum() - 1) / 2;
556cdf0e10cSrcweir 
557cdf0e10cSrcweir                     if (nSdPage < mpDoc->GetSdPageCount(pPage->GetPageKind()) - 1)
558cdf0e10cSrcweir                     {
559cdf0e10cSrcweir                         // Switch the page and send events regarding
560cdf0e10cSrcweir                         // deactivation the old page and activating the new
561cdf0e10cSrcweir                         // one.
562cdf0e10cSrcweir                         TabControl* pPageTabControl =
563cdf0e10cSrcweir                             static_cast<DrawViewShell*>(mpViewShell)->GetPageTabControl();
564cdf0e10cSrcweir                         if (pPageTabControl->IsReallyShown())
565cdf0e10cSrcweir                             pPageTabControl->SendDeactivatePageEvent ();
566cdf0e10cSrcweir                         static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(nSdPage + 1);
567cdf0e10cSrcweir                         if (pPageTabControl->IsReallyShown())
568cdf0e10cSrcweir                             pPageTabControl->SendActivatePageEvent ();
569cdf0e10cSrcweir                     }
570cdf0e10cSrcweir                 }
571cdf0e10cSrcweir                 else if (rKEvt.GetKeyCode().IsMod1())
572cdf0e10cSrcweir                 {
573cdf0e10cSrcweir                     // With the CONTROL modifier we switch layers.
574cdf0e10cSrcweir                     if (static_cast<DrawViewShell*>(mpViewShell)->IsLayerModeActive())
575cdf0e10cSrcweir                     {
576cdf0e10cSrcweir                         // With the layer mode active pressing page-down
577cdf0e10cSrcweir                         // moves to the next layer.
578cdf0e10cSrcweir                         SwitchLayer (+1);
579cdf0e10cSrcweir                     }
580cdf0e10cSrcweir                 }
581cdf0e10cSrcweir             }
582cdf0e10cSrcweir         }
583cdf0e10cSrcweir         break;
584cdf0e10cSrcweir 
585cdf0e10cSrcweir 		// #97016# II change select state when focus is on poly point
586cdf0e10cSrcweir 		case KEY_SPACE:
587cdf0e10cSrcweir 		{
588cdf0e10cSrcweir 			const SdrHdlList& rHdlList = mpView->GetHdlList();
589cdf0e10cSrcweir 			SdrHdl* pHdl = rHdlList.GetFocusHdl();
590cdf0e10cSrcweir 
591cdf0e10cSrcweir 			if(pHdl)
592cdf0e10cSrcweir 			{
593cdf0e10cSrcweir 				if(pHdl->GetKind() == HDL_POLY)
594cdf0e10cSrcweir 				{
595cdf0e10cSrcweir 					// rescue ID of point with focus
596cdf0e10cSrcweir 					sal_uInt32 nPol(pHdl->GetPolyNum());
597cdf0e10cSrcweir 					sal_uInt32 nPnt(pHdl->GetPointNum());
598cdf0e10cSrcweir 
599cdf0e10cSrcweir 					if(mpView->IsPointMarked(*pHdl))
600cdf0e10cSrcweir 					{
601cdf0e10cSrcweir 						if(rKEvt.GetKeyCode().IsShift())
602cdf0e10cSrcweir 						{
603cdf0e10cSrcweir 							mpView->UnmarkPoint(*pHdl);
604cdf0e10cSrcweir 						}
605cdf0e10cSrcweir 					}
606cdf0e10cSrcweir 					else
607cdf0e10cSrcweir 					{
608cdf0e10cSrcweir 						if(!rKEvt.GetKeyCode().IsShift())
609cdf0e10cSrcweir 						{
610cdf0e10cSrcweir 							mpView->UnmarkAllPoints();
611cdf0e10cSrcweir 						}
612cdf0e10cSrcweir 
613cdf0e10cSrcweir 						mpView->MarkPoint(*pHdl);
614cdf0e10cSrcweir 					}
615cdf0e10cSrcweir 
616cdf0e10cSrcweir 					if(0L == rHdlList.GetFocusHdl())
617cdf0e10cSrcweir 					{
618cdf0e10cSrcweir 						// restore point with focus
619cdf0e10cSrcweir 						SdrHdl* pNewOne = 0L;
620cdf0e10cSrcweir 
621cdf0e10cSrcweir 						for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++)
622cdf0e10cSrcweir 						{
623cdf0e10cSrcweir 							SdrHdl* pAct = rHdlList.GetHdl(a);
624cdf0e10cSrcweir 
625cdf0e10cSrcweir 							if(pAct
626cdf0e10cSrcweir 								&& pAct->GetKind() == HDL_POLY
627cdf0e10cSrcweir 								&& pAct->GetPolyNum() == nPol
628cdf0e10cSrcweir 								&& pAct->GetPointNum() == nPnt)
629cdf0e10cSrcweir 							{
630cdf0e10cSrcweir 								pNewOne = pAct;
631cdf0e10cSrcweir 							}
632cdf0e10cSrcweir 						}
633cdf0e10cSrcweir 
634cdf0e10cSrcweir 						if(pNewOne)
635cdf0e10cSrcweir 						{
636cdf0e10cSrcweir 							((SdrHdlList&)rHdlList).SetFocusHdl(pNewOne);
637cdf0e10cSrcweir 						}
638cdf0e10cSrcweir 					}
639cdf0e10cSrcweir 
640cdf0e10cSrcweir 					bReturn = sal_True;
641cdf0e10cSrcweir 				}
642cdf0e10cSrcweir 			}
643cdf0e10cSrcweir 		}
644cdf0e10cSrcweir 		break;
645cdf0e10cSrcweir 
646cdf0e10cSrcweir 		case KEY_UP:
647cdf0e10cSrcweir 		case KEY_DOWN:
648cdf0e10cSrcweir 		case KEY_LEFT:
649cdf0e10cSrcweir 		case KEY_RIGHT:
650cdf0e10cSrcweir 		{
651cdf0e10cSrcweir 			if (!mpView->IsTextEdit() && !bSlideShow)
652cdf0e10cSrcweir 			{
653cdf0e10cSrcweir 				long nX = 0;
654cdf0e10cSrcweir 				long nY = 0;
655cdf0e10cSrcweir 
656cdf0e10cSrcweir 				if (nCode == KEY_UP)
657cdf0e10cSrcweir 				{
658cdf0e10cSrcweir 					// Scroll nach oben
659cdf0e10cSrcweir 					nX = 0;
660cdf0e10cSrcweir 					nY =-1;
661cdf0e10cSrcweir 				}
662cdf0e10cSrcweir 				else if (nCode == KEY_DOWN)
663cdf0e10cSrcweir 				{
664cdf0e10cSrcweir 					// Scroll nach unten
665cdf0e10cSrcweir 					nX = 0;
666cdf0e10cSrcweir 					nY = 1;
667cdf0e10cSrcweir 				}
668cdf0e10cSrcweir 				else if (nCode == KEY_LEFT)
669cdf0e10cSrcweir 				{
670cdf0e10cSrcweir 					// Scroll nach links
671cdf0e10cSrcweir 					nX =-1;
672cdf0e10cSrcweir 					nY = 0;
673cdf0e10cSrcweir 				}
674cdf0e10cSrcweir 				else if (nCode == KEY_RIGHT)
675cdf0e10cSrcweir 				{
676cdf0e10cSrcweir 					// Scroll nach rechts
677cdf0e10cSrcweir 					nX = 1;
678cdf0e10cSrcweir 					nY = 0;
679cdf0e10cSrcweir 				}
680cdf0e10cSrcweir 
681cdf0e10cSrcweir 				if (mpView->AreObjectsMarked() && !rKEvt.GetKeyCode().IsMod1() &&
682cdf0e10cSrcweir 					!mpDocSh->IsReadOnly())
683cdf0e10cSrcweir 				{
684cdf0e10cSrcweir 					// #97016# II
685cdf0e10cSrcweir 					const SdrHdlList& rHdlList = mpView->GetHdlList();
686cdf0e10cSrcweir 					SdrHdl* pHdl = rHdlList.GetFocusHdl();
687cdf0e10cSrcweir 
688cdf0e10cSrcweir 					// #109007#
689cdf0e10cSrcweir 					sal_Bool bIsMoveOfConnectedHandle(sal_False);
690cdf0e10cSrcweir 					sal_Bool bOldSuppress = false;
691cdf0e10cSrcweir 					SdrEdgeObj* pEdgeObj = 0L;
692cdf0e10cSrcweir 
693cdf0e10cSrcweir 					if(pHdl && pHdl->GetObj() && pHdl->GetObj()->ISA(SdrEdgeObj) && 0 == pHdl->GetPolyNum())
694cdf0e10cSrcweir 					{
695cdf0e10cSrcweir 						pEdgeObj = (SdrEdgeObj*)pHdl->GetObj();
696cdf0e10cSrcweir 
697cdf0e10cSrcweir 						if(0L == pHdl->GetPointNum())
698cdf0e10cSrcweir 						{
699cdf0e10cSrcweir 							if(pEdgeObj->GetConnection(sal_True).GetObject())
700cdf0e10cSrcweir 							{
701cdf0e10cSrcweir 								bIsMoveOfConnectedHandle = sal_True;
702cdf0e10cSrcweir 							}
703cdf0e10cSrcweir 						}
704cdf0e10cSrcweir 						if(1L == pHdl->GetPointNum())
705cdf0e10cSrcweir 						{
706cdf0e10cSrcweir 							if(pEdgeObj->GetConnection(sal_False).GetObject())
707cdf0e10cSrcweir 							{
708cdf0e10cSrcweir 								bIsMoveOfConnectedHandle = sal_True;
709cdf0e10cSrcweir 							}
710cdf0e10cSrcweir 						}
711cdf0e10cSrcweir 					}
712cdf0e10cSrcweir 
713cdf0e10cSrcweir 					// #109007#
714cdf0e10cSrcweir 					if(pEdgeObj)
715cdf0e10cSrcweir 					{
716cdf0e10cSrcweir 						// Suppress default connects to inside object and object center
717cdf0e10cSrcweir 						bOldSuppress = pEdgeObj->GetSuppressDefaultConnect();
718cdf0e10cSrcweir 						pEdgeObj->SetSuppressDefaultConnect(sal_True);
719cdf0e10cSrcweir 					}
720cdf0e10cSrcweir 
721cdf0e10cSrcweir 					// #109007#
722cdf0e10cSrcweir 					if(bIsMoveOfConnectedHandle)
723cdf0e10cSrcweir 					{
724cdf0e10cSrcweir 						sal_uInt16 nMarkHdSiz(mpView->GetMarkHdlSizePixel());
725cdf0e10cSrcweir 						Size aHalfConSiz(nMarkHdSiz + 1, nMarkHdSiz + 1);
726cdf0e10cSrcweir 						aHalfConSiz = mpWindow->PixelToLogic(aHalfConSiz);
727cdf0e10cSrcweir 
728cdf0e10cSrcweir 						if(100 < aHalfConSiz.Width())
729cdf0e10cSrcweir 							nX *= aHalfConSiz.Width();
730cdf0e10cSrcweir 						else
731cdf0e10cSrcweir 							nX *= 100;
732cdf0e10cSrcweir 
733cdf0e10cSrcweir 						if(100 < aHalfConSiz.Height())
734cdf0e10cSrcweir 							nY *= aHalfConSiz.Height();
735cdf0e10cSrcweir 						else
736cdf0e10cSrcweir 							nY *= 100;
737cdf0e10cSrcweir 					}
738cdf0e10cSrcweir 					else if(rKEvt.GetKeyCode().IsMod2())
739cdf0e10cSrcweir 					{
740cdf0e10cSrcweir 						// #97016# move in 1 pixel distance
741cdf0e10cSrcweir 						Size aLogicSizeOnePixel = (mpWindow) ? mpWindow->PixelToLogic(Size(1,1)) : Size(100, 100);
742cdf0e10cSrcweir 						nX *= aLogicSizeOnePixel.Width();
743cdf0e10cSrcweir 						nY *= aLogicSizeOnePixel.Height();
744cdf0e10cSrcweir 					}
745cdf0e10cSrcweir 					else if(rKEvt.GetKeyCode().IsShift())
746cdf0e10cSrcweir 					{
747cdf0e10cSrcweir 						nX *= 1000;
748cdf0e10cSrcweir 						nY *= 1000;
749cdf0e10cSrcweir 					}
750cdf0e10cSrcweir 					else
751cdf0e10cSrcweir 					{
752cdf0e10cSrcweir 						// old, fixed move distance
753cdf0e10cSrcweir 						nX *= 100;
754cdf0e10cSrcweir 						nY *= 100;
755cdf0e10cSrcweir 					}
756cdf0e10cSrcweir 
757cdf0e10cSrcweir 					if(0L == pHdl)
758cdf0e10cSrcweir 					{
759cdf0e10cSrcweir 						// #67368# only take action when move is allowed
760cdf0e10cSrcweir 						if(mpView->IsMoveAllowed())
761cdf0e10cSrcweir 						{
762cdf0e10cSrcweir 							// #90129# restrict movement to WorkArea
763cdf0e10cSrcweir 							const Rectangle& rWorkArea = mpView->GetWorkArea();
764cdf0e10cSrcweir 
765cdf0e10cSrcweir 							if(!rWorkArea.IsEmpty())
766cdf0e10cSrcweir 							{
767cdf0e10cSrcweir 								Rectangle aMarkRect(mpView->GetMarkedObjRect());
768cdf0e10cSrcweir 								aMarkRect.Move(nX, nY);
769cdf0e10cSrcweir 
770cdf0e10cSrcweir 								if(!aMarkRect.IsInside(rWorkArea))
771cdf0e10cSrcweir 								{
772cdf0e10cSrcweir 									if(aMarkRect.Left() < rWorkArea.Left())
773cdf0e10cSrcweir 									{
774cdf0e10cSrcweir 										nX += rWorkArea.Left() - aMarkRect.Left();
775cdf0e10cSrcweir 									}
776cdf0e10cSrcweir 
777cdf0e10cSrcweir 									if(aMarkRect.Right() > rWorkArea.Right())
778cdf0e10cSrcweir 									{
779cdf0e10cSrcweir 										nX -= aMarkRect.Right() - rWorkArea.Right();
780cdf0e10cSrcweir 									}
781cdf0e10cSrcweir 
782cdf0e10cSrcweir 									if(aMarkRect.Top() < rWorkArea.Top())
783cdf0e10cSrcweir 									{
784cdf0e10cSrcweir 										nY += rWorkArea.Top() - aMarkRect.Top();
785cdf0e10cSrcweir 									}
786cdf0e10cSrcweir 
787cdf0e10cSrcweir 									if(aMarkRect.Bottom() > rWorkArea.Bottom())
788cdf0e10cSrcweir 									{
789cdf0e10cSrcweir 										nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
790cdf0e10cSrcweir 									}
791cdf0e10cSrcweir 								}
792cdf0e10cSrcweir 							}
793cdf0e10cSrcweir 
794cdf0e10cSrcweir 							// no handle selected
795cdf0e10cSrcweir 							if(0 != nX || 0 != nY)
796cdf0e10cSrcweir 							{
797cdf0e10cSrcweir 								mpView->MoveAllMarked(Size(nX, nY));
798cdf0e10cSrcweir 
799cdf0e10cSrcweir 								// #97016# II
800cdf0e10cSrcweir 								mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
801cdf0e10cSrcweir 							}
802cdf0e10cSrcweir 						}
803cdf0e10cSrcweir 					}
804cdf0e10cSrcweir 					else
805cdf0e10cSrcweir 					{
806cdf0e10cSrcweir 						// move handle with index nHandleIndex
807cdf0e10cSrcweir 						if(pHdl && (nX || nY))
808cdf0e10cSrcweir 						{
809cdf0e10cSrcweir 							// now move the Handle (nX, nY)
810cdf0e10cSrcweir 							Point aStartPoint(pHdl->GetPos());
811cdf0e10cSrcweir 							Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
812cdf0e10cSrcweir 							const SdrDragStat& rDragStat = mpView->GetDragStat();
813cdf0e10cSrcweir 
814cdf0e10cSrcweir 							// start dragging
815cdf0e10cSrcweir 							mpView->BegDragObj(aStartPoint, 0, pHdl, 0);
816cdf0e10cSrcweir 
817cdf0e10cSrcweir 					        if(mpView->IsDragObj())
818cdf0e10cSrcweir 							{
819cdf0e10cSrcweir 								FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
820cdf0e10cSrcweir 								sal_Bool bWasSnapEnabled = mpView->IsSnapEnabled();
821cdf0e10cSrcweir 
822cdf0e10cSrcweir 								// switch snapping off
823cdf0e10cSrcweir 								if(!bWasNoSnap)
824cdf0e10cSrcweir 									((SdrDragStat&)rDragStat).SetNoSnap(sal_True);
825cdf0e10cSrcweir 								if(bWasSnapEnabled)
826cdf0e10cSrcweir 									mpView->SetSnapEnabled(sal_False);
827cdf0e10cSrcweir 
828cdf0e10cSrcweir 								mpView->MovAction(aEndPoint);
829cdf0e10cSrcweir 								mpView->EndDragObj();
830cdf0e10cSrcweir 
831cdf0e10cSrcweir 								// restore snap
832cdf0e10cSrcweir 								if(!bWasNoSnap)
833cdf0e10cSrcweir 									((SdrDragStat&)rDragStat).SetNoSnap(bWasNoSnap);
834cdf0e10cSrcweir 								if(bWasSnapEnabled)
835cdf0e10cSrcweir 									mpView->SetSnapEnabled(bWasSnapEnabled);
836cdf0e10cSrcweir 							}
837cdf0e10cSrcweir 
838cdf0e10cSrcweir 							// make moved handle visible
839cdf0e10cSrcweir 							Rectangle aVisRect(aEndPoint - Point(100, 100), Size(200, 200));
840cdf0e10cSrcweir 							mpView->MakeVisible(aVisRect, *mpWindow);
841cdf0e10cSrcweir 						}
842cdf0e10cSrcweir 					}
843cdf0e10cSrcweir 
844cdf0e10cSrcweir 					// #109007#
845cdf0e10cSrcweir 					if(pEdgeObj)
846cdf0e10cSrcweir 					{
847cdf0e10cSrcweir 						// Restore original suppress value
848cdf0e10cSrcweir 						pEdgeObj->SetSuppressDefaultConnect(bOldSuppress);
849cdf0e10cSrcweir 					}
850cdf0e10cSrcweir 				}
851cdf0e10cSrcweir 				else
852cdf0e10cSrcweir 				{
853cdf0e10cSrcweir 					// Seite scrollen
854cdf0e10cSrcweir 					ScrollStart();
855cdf0e10cSrcweir 					mpViewShell->ScrollLines(nX, nY);
856cdf0e10cSrcweir 					ScrollEnd();
857cdf0e10cSrcweir 				}
858cdf0e10cSrcweir 
859cdf0e10cSrcweir 				bReturn = sal_True;
860cdf0e10cSrcweir 			}
861cdf0e10cSrcweir 		}
862cdf0e10cSrcweir 		break;
863cdf0e10cSrcweir 	}
864cdf0e10cSrcweir 
865cdf0e10cSrcweir 	if (bReturn)
866cdf0e10cSrcweir 	{
867cdf0e10cSrcweir 		mpWindow->ReleaseMouse();
868cdf0e10cSrcweir 	}
869cdf0e10cSrcweir 
870cdf0e10cSrcweir 	// #98198# when a text-editable object is selected and the
871cdf0e10cSrcweir 	// input character is printable, activate text edit on that object
872cdf0e10cSrcweir 	// and feed character to object
873cdf0e10cSrcweir 	if(!bReturn && !mpDocSh->IsReadOnly())
874cdf0e10cSrcweir 	{
875cdf0e10cSrcweir 		if(!mpView->IsTextEdit() && mpViewShell)
876cdf0e10cSrcweir 		{
877cdf0e10cSrcweir 			const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
878cdf0e10cSrcweir 
879cdf0e10cSrcweir 			if(1 == rMarkList.GetMarkCount())
880cdf0e10cSrcweir 			{
881cdf0e10cSrcweir 				SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
882cdf0e10cSrcweir 
883a5258243SPedro Giffuni                 // #i118485# allow TextInput for OLEs, too
884a5258243SPedro Giffuni 				if(pObj->ISA(SdrTextObj) && pObj->HasTextEdit())
885cdf0e10cSrcweir 				{
886cdf0e10cSrcweir 					// #98533# use common IsSimpleCharInput from
887cdf0e10cSrcweir 					// the EditEngine.
888cdf0e10cSrcweir 					sal_Bool bPrintable(EditEngine::IsSimpleCharInput(rKEvt));
889cdf0e10cSrcweir 
890cdf0e10cSrcweir 					if(bPrintable)
891cdf0e10cSrcweir 					{
892cdf0e10cSrcweir 						// try to activate textedit mode for the selected object
893cdf0e10cSrcweir 						SfxStringItem aInputString(SID_ATTR_CHAR, String(rKEvt.GetCharCode()));
894cdf0e10cSrcweir 
895cdf0e10cSrcweir 						mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
896cdf0e10cSrcweir 							SID_ATTR_CHAR,
897cdf0e10cSrcweir 							SFX_CALLMODE_ASYNCHRON,
898cdf0e10cSrcweir 							&aInputString,
899cdf0e10cSrcweir 							0L);
900cdf0e10cSrcweir 
901cdf0e10cSrcweir 						// consumed
902cdf0e10cSrcweir 						bReturn = sal_True;
903cdf0e10cSrcweir 					}
904cdf0e10cSrcweir 				}
905cdf0e10cSrcweir 			}
906cdf0e10cSrcweir 			else
907cdf0e10cSrcweir 			{
908cdf0e10cSrcweir 				// #99039# test if there is a title object there. If yes, try to
909cdf0e10cSrcweir 				// set it to edit mode and start typing...
910cdf0e10cSrcweir 				if(mpViewShell->ISA(DrawViewShell)
911cdf0e10cSrcweir                     && EditEngine::IsSimpleCharInput(rKEvt))
912cdf0e10cSrcweir 				{
913cdf0e10cSrcweir 					DrawViewShell* pDrawViewShell =
914cdf0e10cSrcweir                         static_cast<DrawViewShell*>(mpViewShell);
915cdf0e10cSrcweir 					SdPage* pActualPage = pDrawViewShell->GetActualPage();
916cdf0e10cSrcweir 					SdrTextObj* pCandidate = 0L;
917cdf0e10cSrcweir 
918cdf0e10cSrcweir 					if(pActualPage)
919cdf0e10cSrcweir 					{
920cdf0e10cSrcweir 						SdrObjListIter aIter(*pActualPage, IM_DEEPNOGROUPS);
921cdf0e10cSrcweir 
922cdf0e10cSrcweir 						while(aIter.IsMore() && !pCandidate)
923cdf0e10cSrcweir 						{
924cdf0e10cSrcweir 							SdrObject* pObj = aIter.Next();
925cdf0e10cSrcweir 
926cdf0e10cSrcweir 							if(pObj && pObj->ISA(SdrTextObj))
927cdf0e10cSrcweir 							{
928cdf0e10cSrcweir 								sal_uInt32 nInv(pObj->GetObjInventor());
929cdf0e10cSrcweir 								sal_uInt16 nKnd(pObj->GetObjIdentifier());
930cdf0e10cSrcweir 
931cdf0e10cSrcweir 								if(SdrInventor == nInv && OBJ_TITLETEXT == nKnd)
932cdf0e10cSrcweir 								{
933cdf0e10cSrcweir 									pCandidate = (SdrTextObj*)pObj;
934cdf0e10cSrcweir 								}
935cdf0e10cSrcweir 							}
936cdf0e10cSrcweir 						}
937cdf0e10cSrcweir 					}
938cdf0e10cSrcweir 
939cdf0e10cSrcweir 					// when candidate found and candidate is untouched, start editing text...
940cdf0e10cSrcweir 					if(pCandidate && pCandidate->IsEmptyPresObj())
941cdf0e10cSrcweir 					{
942cdf0e10cSrcweir 						mpView->UnMarkAll();
943cdf0e10cSrcweir 						mpView->MarkObj(pCandidate, mpView->GetSdrPageView());
944cdf0e10cSrcweir 						SfxStringItem aInputString(SID_ATTR_CHAR, String(rKEvt.GetCharCode()));
945cdf0e10cSrcweir 
946cdf0e10cSrcweir 						mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
947cdf0e10cSrcweir 							SID_ATTR_CHAR,
948cdf0e10cSrcweir 							SFX_CALLMODE_ASYNCHRON,
949cdf0e10cSrcweir 							&aInputString,
950cdf0e10cSrcweir 							0L);
951cdf0e10cSrcweir 
952cdf0e10cSrcweir 						// consumed
953cdf0e10cSrcweir 						bReturn = sal_True;
954cdf0e10cSrcweir 					}
955cdf0e10cSrcweir 				}
956cdf0e10cSrcweir 			}
957cdf0e10cSrcweir 		}
958cdf0e10cSrcweir 	}
959cdf0e10cSrcweir 
960cdf0e10cSrcweir 	return(bReturn);
961cdf0e10cSrcweir }
962cdf0e10cSrcweir 
MouseMove(const MouseEvent &)963cdf0e10cSrcweir sal_Bool FuPoor::MouseMove(const MouseEvent& )
964cdf0e10cSrcweir {
965cdf0e10cSrcweir 	return sal_False;
966cdf0e10cSrcweir }
967cdf0e10cSrcweir 
968cdf0e10cSrcweir // #97016# II
SelectionHasChanged()969cdf0e10cSrcweir void FuPoor::SelectionHasChanged()
970cdf0e10cSrcweir {
971cdf0e10cSrcweir 	const SdrHdlList& rHdlList = mpView->GetHdlList();
972cdf0e10cSrcweir 	((SdrHdlList&)rHdlList).ResetFocusHdl();
973cdf0e10cSrcweir }
974cdf0e10cSrcweir 
975cdf0e10cSrcweir /*************************************************************************
976cdf0e10cSrcweir |*
977cdf0e10cSrcweir |* Cut object to clipboard
978cdf0e10cSrcweir |*
979cdf0e10cSrcweir \************************************************************************/
980cdf0e10cSrcweir 
DoCut()981cdf0e10cSrcweir void FuPoor::DoCut()
982cdf0e10cSrcweir {
983cdf0e10cSrcweir 	if (mpView)
984cdf0e10cSrcweir 	{
985cdf0e10cSrcweir 		mpView->DoCut(mpWindow);
986cdf0e10cSrcweir 	}
987cdf0e10cSrcweir }
988cdf0e10cSrcweir 
989cdf0e10cSrcweir /*************************************************************************
990cdf0e10cSrcweir |*
991cdf0e10cSrcweir |* Copy object to clipboard
992cdf0e10cSrcweir |*
993cdf0e10cSrcweir \************************************************************************/
994cdf0e10cSrcweir 
DoCopy()995cdf0e10cSrcweir void FuPoor::DoCopy()
996cdf0e10cSrcweir {
997cdf0e10cSrcweir 	if (mpView)
998cdf0e10cSrcweir 	{
999cdf0e10cSrcweir 		mpView->DoCopy(mpWindow);
1000cdf0e10cSrcweir 	}
1001cdf0e10cSrcweir }
1002cdf0e10cSrcweir 
1003cdf0e10cSrcweir /*************************************************************************
1004cdf0e10cSrcweir |*
1005cdf0e10cSrcweir |* Paste object from clipboard
1006cdf0e10cSrcweir |*
1007cdf0e10cSrcweir \************************************************************************/
1008cdf0e10cSrcweir 
DoPaste()1009cdf0e10cSrcweir void FuPoor::DoPaste()
1010cdf0e10cSrcweir {
1011cdf0e10cSrcweir 	if (mpView)
1012cdf0e10cSrcweir 	{
1013cdf0e10cSrcweir 		mpView->DoPaste(mpWindow);
1014cdf0e10cSrcweir 	}
1015cdf0e10cSrcweir }
1016cdf0e10cSrcweir 
1017cdf0e10cSrcweir /*************************************************************************
1018cdf0e10cSrcweir |*
1019cdf0e10cSrcweir |* Timer-Handler fuer Drag&Drop
1020cdf0e10cSrcweir |*
1021cdf0e10cSrcweir \************************************************************************/
1022cdf0e10cSrcweir 
IMPL_LINK(FuPoor,DragHdl,Timer *,EMPTYARG)1023cdf0e10cSrcweir IMPL_LINK( FuPoor, DragHdl, Timer *, EMPTYARG )
1024cdf0e10cSrcweir {
1025cdf0e10cSrcweir 	if( mpView )
1026cdf0e10cSrcweir 	{
1027cdf0e10cSrcweir 		sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
1028cdf0e10cSrcweir 		SdrHdl* pHdl = mpView->PickHandle(aMDPos);
1029cdf0e10cSrcweir 
1030cdf0e10cSrcweir 		if ( pHdl==NULL && mpView->IsMarkedHit(aMDPos, nHitLog)
1031cdf0e10cSrcweir 			 && !mpView->IsPresObjSelected(sal_False, sal_True) )
1032cdf0e10cSrcweir 		{
1033cdf0e10cSrcweir 			mpWindow->ReleaseMouse();
1034cdf0e10cSrcweir 			bIsInDragMode = sal_True;
1035cdf0e10cSrcweir 			mpView->StartDrag( aMDPos, mpWindow );
1036cdf0e10cSrcweir 		}
1037cdf0e10cSrcweir 	}
1038cdf0e10cSrcweir 	return 0;
1039cdf0e10cSrcweir }
1040cdf0e10cSrcweir 
1041cdf0e10cSrcweir /*************************************************************************
1042cdf0e10cSrcweir |*
1043cdf0e10cSrcweir |* Command-event
1044cdf0e10cSrcweir |*
1045cdf0e10cSrcweir \************************************************************************/
1046cdf0e10cSrcweir 
Command(const CommandEvent & rCEvt)1047cdf0e10cSrcweir sal_Bool FuPoor::Command(const CommandEvent& rCEvt)
1048cdf0e10cSrcweir {
1049cdf0e10cSrcweir 	return( mpView->Command(rCEvt,mpWindow) );
1050cdf0e10cSrcweir }
1051cdf0e10cSrcweir 
1052cdf0e10cSrcweir /*************************************************************************
1053cdf0e10cSrcweir |*
1054cdf0e10cSrcweir |* Timer-Handler fuer Fensterscrolling
1055cdf0e10cSrcweir |*
1056cdf0e10cSrcweir \************************************************************************/
1057cdf0e10cSrcweir 
IMPL_LINK_INLINE_START(FuPoor,DelayHdl,Timer *,EMPTYARG)1058cdf0e10cSrcweir IMPL_LINK_INLINE_START( FuPoor, DelayHdl, Timer *, EMPTYARG )
1059cdf0e10cSrcweir {
1060cdf0e10cSrcweir 	aDelayToScrollTimer.Stop ();
1061cdf0e10cSrcweir 	bScrollable = sal_True;
1062cdf0e10cSrcweir 
1063cdf0e10cSrcweir 	Point aPnt(mpWindow->GetPointerPosPixel());
1064cdf0e10cSrcweir 
1065cdf0e10cSrcweir 	// #95491# use remembered MouseButton state to create correct
1066cdf0e10cSrcweir 	// MouseEvents for this artifical MouseMove.
1067cdf0e10cSrcweir 	MouseMove(MouseEvent(aPnt, 1, 0, GetMouseButtonCode()));
1068cdf0e10cSrcweir 
1069cdf0e10cSrcweir 	return 0;
1070cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(FuPoor,DelayHdl,Timer *,pTimer)1071cdf0e10cSrcweir IMPL_LINK_INLINE_END( FuPoor, DelayHdl, Timer *, pTimer )
1072cdf0e10cSrcweir 
1073cdf0e10cSrcweir /*************************************************************************
1074cdf0e10cSrcweir |*
1075cdf0e10cSrcweir |* Handler fuer Maustaste
1076cdf0e10cSrcweir |*
1077cdf0e10cSrcweir \************************************************************************/
1078cdf0e10cSrcweir 
1079cdf0e10cSrcweir sal_Bool FuPoor::MouseButtonUp (const MouseEvent& rMEvt)
1080cdf0e10cSrcweir {
1081cdf0e10cSrcweir 	// #95491# remember button state for creation of own MouseEvents
1082cdf0e10cSrcweir 	SetMouseButtonCode(rMEvt.GetButtons());
1083cdf0e10cSrcweir 
1084cdf0e10cSrcweir 	aDelayToScrollTimer.Stop ();
1085cdf0e10cSrcweir 	return bScrollable	=
1086cdf0e10cSrcweir 		bDelayActive = sal_False;
1087cdf0e10cSrcweir }
1088cdf0e10cSrcweir 
MouseButtonDown(const MouseEvent & rMEvt)1089cdf0e10cSrcweir sal_Bool FuPoor::MouseButtonDown(const MouseEvent& rMEvt)
1090cdf0e10cSrcweir {
1091cdf0e10cSrcweir 	// #95491# remember button state for creation of own MouseEvents
1092cdf0e10cSrcweir 	SetMouseButtonCode(rMEvt.GetButtons());
1093cdf0e10cSrcweir 
1094cdf0e10cSrcweir 	return sal_False;
1095cdf0e10cSrcweir }
1096cdf0e10cSrcweir 
1097cdf0e10cSrcweir /*************************************************************************
1098cdf0e10cSrcweir |*
1099cdf0e10cSrcweir |* Handler fuer Maustaste
1100cdf0e10cSrcweir |*
1101cdf0e10cSrcweir \************************************************************************/
1102cdf0e10cSrcweir 
StartDelayToScrollTimer()1103cdf0e10cSrcweir void FuPoor::StartDelayToScrollTimer ()
1104cdf0e10cSrcweir {
1105cdf0e10cSrcweir 	bDelayActive = sal_True;
1106cdf0e10cSrcweir 	aDelayToScrollTimer.Start ();
1107cdf0e10cSrcweir }
1108cdf0e10cSrcweir 
1109cdf0e10cSrcweir /*************************************************************************
1110cdf0e10cSrcweir |*
1111cdf0e10cSrcweir |* Help-event
1112cdf0e10cSrcweir |*
1113cdf0e10cSrcweir \************************************************************************/
1114cdf0e10cSrcweir 
RequestHelp(const HelpEvent & rHEvt)1115cdf0e10cSrcweir sal_Bool FuPoor::RequestHelp(const HelpEvent& rHEvt)
1116cdf0e10cSrcweir {
1117cdf0e10cSrcweir 	sal_Bool bReturn = sal_False;
1118cdf0e10cSrcweir 
1119cdf0e10cSrcweir 	SdrPageView* pPV = mpView->GetSdrPageView();
1120cdf0e10cSrcweir 
1121cdf0e10cSrcweir 	if (pPV)
1122cdf0e10cSrcweir 	{
1123cdf0e10cSrcweir 		SdPage* pPage = (SdPage*) pPV->GetPage();
1124cdf0e10cSrcweir 
1125cdf0e10cSrcweir 		if (pPage)
1126cdf0e10cSrcweir 		{
1127cdf0e10cSrcweir 			bReturn = pPage->RequestHelp(mpWindow, mpView, rHEvt);
1128cdf0e10cSrcweir 		}
1129cdf0e10cSrcweir 	}
1130cdf0e10cSrcweir 
1131cdf0e10cSrcweir 	return(bReturn);
1132cdf0e10cSrcweir }
1133cdf0e10cSrcweir 
Paint(const Rectangle &,::sd::Window *)1134cdf0e10cSrcweir void FuPoor::Paint(const Rectangle&, ::sd::Window* )
1135cdf0e10cSrcweir {
1136cdf0e10cSrcweir }
1137cdf0e10cSrcweir 
1138cdf0e10cSrcweir /*************************************************************************
1139cdf0e10cSrcweir |*
1140cdf0e10cSrcweir |* Request verarbeiten
1141cdf0e10cSrcweir |*
1142cdf0e10cSrcweir \************************************************************************/
1143cdf0e10cSrcweir 
ReceiveRequest(SfxRequest & rReq)1144cdf0e10cSrcweir void FuPoor::ReceiveRequest(SfxRequest& rReq)
1145cdf0e10cSrcweir {
1146cdf0e10cSrcweir 	const SfxItemSet* pSet = rReq.GetArgs();
1147cdf0e10cSrcweir 
1148cdf0e10cSrcweir 	if (pSet)
1149cdf0e10cSrcweir 	{
1150cdf0e10cSrcweir 		if( pSet->GetItemState( nSlotId ) == SFX_ITEM_SET )
1151cdf0e10cSrcweir 		{
1152cdf0e10cSrcweir 			const SfxPoolItem& rItem = pSet->Get( nSlotId );
1153cdf0e10cSrcweir 
1154cdf0e10cSrcweir 			if( rItem.ISA( SfxAllEnumItem ) )
1155cdf0e10cSrcweir 			{
1156cdf0e10cSrcweir 				nSlotValue = ( ( const SfxAllEnumItem& ) rItem ).GetValue();
1157cdf0e10cSrcweir 			}
1158cdf0e10cSrcweir 		}
1159cdf0e10cSrcweir 	}
1160cdf0e10cSrcweir }
1161cdf0e10cSrcweir 
1162cdf0e10cSrcweir /*************************************************************************
1163cdf0e10cSrcweir |*
1164cdf0e10cSrcweir |* #97016#
1165cdf0e10cSrcweir |*
1166cdf0e10cSrcweir \************************************************************************/
1167cdf0e10cSrcweir 
CreateDefaultObject(const sal_uInt16,const Rectangle &)1168cdf0e10cSrcweir SdrObject* FuPoor::CreateDefaultObject(const sal_uInt16, const Rectangle& )
1169cdf0e10cSrcweir {
1170cdf0e10cSrcweir 	// empty base implementation
1171cdf0e10cSrcweir 	return 0L;
1172cdf0e10cSrcweir }
1173cdf0e10cSrcweir 
ImpForceQuadratic(Rectangle & rRect)1174cdf0e10cSrcweir void FuPoor::ImpForceQuadratic(Rectangle& rRect)
1175cdf0e10cSrcweir {
1176cdf0e10cSrcweir 	if(rRect.GetWidth() > rRect.GetHeight())
1177cdf0e10cSrcweir 	{
1178cdf0e10cSrcweir 		rRect = Rectangle(
1179cdf0e10cSrcweir 			Point(rRect.Left() + ((rRect.GetWidth() - rRect.GetHeight()) / 2), rRect.Top()),
1180cdf0e10cSrcweir 			Size(rRect.GetHeight(), rRect.GetHeight()));
1181cdf0e10cSrcweir 	}
1182cdf0e10cSrcweir 	else
1183cdf0e10cSrcweir 	{
1184cdf0e10cSrcweir 		rRect = Rectangle(
1185cdf0e10cSrcweir 			Point(rRect.Left(), rRect.Top() + ((rRect.GetHeight() - rRect.GetWidth()) / 2)),
1186cdf0e10cSrcweir 			Size(rRect.GetWidth(), rRect.GetWidth()));
1187cdf0e10cSrcweir 	}
1188cdf0e10cSrcweir }
1189cdf0e10cSrcweir 
1190cdf0e10cSrcweir 
1191cdf0e10cSrcweir 
1192cdf0e10cSrcweir 
SwitchLayer(sal_Int32 nOffset)1193cdf0e10cSrcweir void FuPoor::SwitchLayer (sal_Int32 nOffset)
1194cdf0e10cSrcweir {
1195cdf0e10cSrcweir     if(mpViewShell && mpViewShell->ISA(DrawViewShell))
1196cdf0e10cSrcweir     {
1197cdf0e10cSrcweir         DrawViewShell* pDrawViewShell =
1198cdf0e10cSrcweir             static_cast<DrawViewShell*>(mpViewShell);
1199cdf0e10cSrcweir 
1200cdf0e10cSrcweir         // Calculate the new index.
1201cdf0e10cSrcweir         sal_Int32 nIndex = pDrawViewShell->GetActiveTabLayerIndex() + nOffset;
1202cdf0e10cSrcweir 
1203cdf0e10cSrcweir         // Make sure the new index lies inside the range of valid indices.
1204cdf0e10cSrcweir         if (nIndex < 0)
1205cdf0e10cSrcweir             nIndex = 0;
1206cdf0e10cSrcweir         else if (nIndex >= pDrawViewShell->GetTabLayerCount ())
1207cdf0e10cSrcweir             nIndex = pDrawViewShell->GetTabLayerCount() - 1;
1208cdf0e10cSrcweir 
1209cdf0e10cSrcweir         // Set the new active layer.
1210cdf0e10cSrcweir         if (nIndex != pDrawViewShell->GetActiveTabLayerIndex ())
1211cdf0e10cSrcweir         {
1212cdf0e10cSrcweir             LayerTabBar* pLayerTabControl =
1213cdf0e10cSrcweir                 static_cast<DrawViewShell*>(mpViewShell)->GetLayerTabControl();
1214cdf0e10cSrcweir             if (pLayerTabControl != NULL)
1215cdf0e10cSrcweir                 pLayerTabControl->SendDeactivatePageEvent ();
1216cdf0e10cSrcweir 
1217cdf0e10cSrcweir             pDrawViewShell->SetActiveTabLayerIndex (nIndex);
1218cdf0e10cSrcweir 
1219cdf0e10cSrcweir             if (pLayerTabControl != NULL)
1220cdf0e10cSrcweir                 pLayerTabControl->SendActivatePageEvent ();
1221cdf0e10cSrcweir         }
1222cdf0e10cSrcweir     }
1223cdf0e10cSrcweir }
1224cdf0e10cSrcweir 
1225cdf0e10cSrcweir /** is called when the currenct function should be aborted. <p>
1226cdf0e10cSrcweir 	This is used when a function gets a KEY_ESCAPE but can also
1227cdf0e10cSrcweir 	be called directly.
1228cdf0e10cSrcweir 
1229cdf0e10cSrcweir 	@returns true if a active function was aborted
1230cdf0e10cSrcweir */
cancel()1231cdf0e10cSrcweir bool FuPoor::cancel()
1232cdf0e10cSrcweir {
1233cdf0e10cSrcweir 	if ( !this->ISA(FuSelection) )
1234cdf0e10cSrcweir 	{
1235cdf0e10cSrcweir 		mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
1236cdf0e10cSrcweir 		return true;
1237cdf0e10cSrcweir 	}
1238cdf0e10cSrcweir 
1239cdf0e10cSrcweir 	return false;
1240cdf0e10cSrcweir }
1241cdf0e10cSrcweir 
1242cdf0e10cSrcweir // #i33136#
doConstructOrthogonal() const1243cdf0e10cSrcweir bool FuPoor::doConstructOrthogonal() const
1244cdf0e10cSrcweir {
1245cdf0e10cSrcweir 	return (
1246cdf0e10cSrcweir 		SID_DRAW_XLINE == nSlotId ||
1247cdf0e10cSrcweir 		SID_DRAW_CIRCLEARC == nSlotId ||
1248cdf0e10cSrcweir 		SID_DRAW_SQUARE == nSlotId ||
1249cdf0e10cSrcweir 		SID_DRAW_SQUARE_NOFILL == nSlotId ||
1250cdf0e10cSrcweir 		SID_DRAW_SQUARE_ROUND == nSlotId ||
1251cdf0e10cSrcweir 		SID_DRAW_SQUARE_ROUND_NOFILL == nSlotId ||
1252cdf0e10cSrcweir 		SID_DRAW_CIRCLE == nSlotId ||
1253cdf0e10cSrcweir 		SID_DRAW_CIRCLE_NOFILL == nSlotId ||
1254cdf0e10cSrcweir 		SID_DRAW_CIRCLEPIE == nSlotId ||
1255cdf0e10cSrcweir 		SID_DRAW_CIRCLEPIE_NOFILL == nSlotId ||
1256cdf0e10cSrcweir 		SID_DRAW_CIRCLECUT == nSlotId ||
1257cdf0e10cSrcweir 		SID_DRAW_CIRCLECUT_NOFILL == nSlotId ||
1258cdf0e10cSrcweir 		SID_DRAW_XPOLYGON == nSlotId ||
1259cdf0e10cSrcweir 		SID_DRAW_XPOLYGON_NOFILL == nSlotId ||
1260cdf0e10cSrcweir 		SID_3D_CUBE == nSlotId ||
1261cdf0e10cSrcweir 		SID_3D_SPHERE == nSlotId ||
1262cdf0e10cSrcweir 		SID_3D_SHELL == nSlotId ||
1263cdf0e10cSrcweir 		SID_3D_HALF_SPHERE == nSlotId ||
1264cdf0e10cSrcweir 		SID_3D_TORUS == nSlotId ||
1265cdf0e10cSrcweir 		SID_3D_CYLINDER == nSlotId ||
1266cdf0e10cSrcweir 		SID_3D_CONE == nSlotId ||
1267cdf0e10cSrcweir 		SID_3D_PYRAMID == nSlotId);
1268cdf0e10cSrcweir }
1269cdf0e10cSrcweir 
DoExecute(SfxRequest &)1270cdf0e10cSrcweir void FuPoor::DoExecute( SfxRequest& )
1271cdf0e10cSrcweir {
1272cdf0e10cSrcweir }
1273cdf0e10cSrcweir 
1274cdf0e10cSrcweir } // end of namespace sd
1275