xref: /aoo42x/main/sd/source/ui/func/fudraw.cxx (revision 4d7c9de0)
15b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
35b190011SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
45b190011SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
55b190011SAndrew Rist  * distributed with this work for additional information
65b190011SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
75b190011SAndrew Rist  * to you under the Apache License, Version 2.0 (the
85b190011SAndrew Rist  * "License"); you may not use this file except in compliance
95b190011SAndrew Rist  * with the License.  You may obtain a copy of the License at
105b190011SAndrew Rist  *
115b190011SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
125b190011SAndrew Rist  *
135b190011SAndrew Rist  * Unless required by applicable law or agreed to in writing,
145b190011SAndrew Rist  * software distributed under the License is distributed on an
155b190011SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165b190011SAndrew Rist  * KIND, either express or implied.  See the License for the
175b190011SAndrew Rist  * specific language governing permissions and limitations
185b190011SAndrew Rist  * under the License.
195b190011SAndrew Rist  *
205b190011SAndrew Rist  *************************************************************/
215b190011SAndrew Rist 
225b190011SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <sot/object.hxx>
28cdf0e10cSrcweir #include <editeng/eeitem.hxx>
29cdf0e10cSrcweir #include <vcl/waitobj.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <editeng/flditem.hxx>
32cdf0e10cSrcweir #include <svx/svdogrp.hxx>
33cdf0e10cSrcweir #include <tools/urlobj.hxx>
34cdf0e10cSrcweir #include <vcl/help.hxx>
35cdf0e10cSrcweir #include <svx/bmpmask.hxx>
36cdf0e10cSrcweir #include <svx/svdotext.hxx>
37cdf0e10cSrcweir #include <sfx2/app.hxx>
38cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
39cdf0e10cSrcweir #include <sfx2/bindings.hxx>
40cdf0e10cSrcweir #include <svx/svdpagv.hxx>
41cdf0e10cSrcweir #include <svtools/imapobj.hxx>
42cdf0e10cSrcweir #include <svx/svxids.hrc>
43cdf0e10cSrcweir #include <svx/obj3d.hxx>
44cdf0e10cSrcweir #include <svx/polysc3d.hxx>
45cdf0e10cSrcweir #include <svx/svdpagv.hxx>
46cdf0e10cSrcweir 
47cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
48cdf0e10cSrcweir 
49cdf0e10cSrcweir #include "anminfo.hxx"
50cdf0e10cSrcweir #include "anmdef.hxx"
51cdf0e10cSrcweir #include "imapinfo.hxx"
52cdf0e10cSrcweir #include "app.hrc"
53cdf0e10cSrcweir #include "glob.hrc"
54cdf0e10cSrcweir #include "strings.hrc"
55cdf0e10cSrcweir #include "res_bmp.hrc"
56cdf0e10cSrcweir 
57cdf0e10cSrcweir #include "app.hxx"
58cdf0e10cSrcweir #include "GraphicDocShell.hxx"
59cdf0e10cSrcweir #include "fudraw.hxx"
60cdf0e10cSrcweir #include "ViewShell.hxx"
61cdf0e10cSrcweir #include "FrameView.hxx"
62cdf0e10cSrcweir #include "View.hxx"
63cdf0e10cSrcweir #ifndef SD_WINDOW_SHELL_HXX
64cdf0e10cSrcweir #include "Window.hxx"
65cdf0e10cSrcweir #endif
66cdf0e10cSrcweir #include "drawdoc.hxx"
67cdf0e10cSrcweir #include "DrawDocShell.hxx"
68cdf0e10cSrcweir #include "Client.hxx"
69cdf0e10cSrcweir #include "sdresid.hxx"
70cdf0e10cSrcweir #include "drawview.hxx"
71cdf0e10cSrcweir #include "fusel.hxx"
72cdf0e10cSrcweir #include <svl/aeitem.hxx>
73cdf0e10cSrcweir #include <vcl/msgbox.hxx>
74cdf0e10cSrcweir #include "slideshow.hxx"
75cdf0e10cSrcweir #include <svx/sdrhittesthelper.hxx>
76cdf0e10cSrcweir 
77cdf0e10cSrcweir using namespace ::com::sun::star;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir namespace sd {
80cdf0e10cSrcweir 
81cdf0e10cSrcweir TYPEINIT1( FuDraw, FuPoor );
82cdf0e10cSrcweir 
83cdf0e10cSrcweir /*************************************************************************
84cdf0e10cSrcweir |*
85cdf0e10cSrcweir |* Base-class for all drawmodul-specific functions
86cdf0e10cSrcweir |*
87cdf0e10cSrcweir \************************************************************************/
88cdf0e10cSrcweir 
FuDraw(ViewShell * pViewSh,::sd::Window * pWin,::sd::View * pView,SdDrawDocument * pDoc,SfxRequest & rReq)89cdf0e10cSrcweir FuDraw::FuDraw(ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView,
90cdf0e10cSrcweir 			   SdDrawDocument* pDoc, SfxRequest& rReq) :
91cdf0e10cSrcweir 	FuPoor(pViewSh, pWin, pView, pDoc, rReq),
92cdf0e10cSrcweir 	bMBDown(sal_False),
93cdf0e10cSrcweir 	bDragHelpLine(sal_False),
94cdf0e10cSrcweir 	bPermanent(sal_False)
95cdf0e10cSrcweir {
96cdf0e10cSrcweir }
97cdf0e10cSrcweir 
98cdf0e10cSrcweir /*************************************************************************
99cdf0e10cSrcweir |*
100cdf0e10cSrcweir |* Destruktor
101cdf0e10cSrcweir |*
102cdf0e10cSrcweir \************************************************************************/
103cdf0e10cSrcweir 
~FuDraw()104cdf0e10cSrcweir FuDraw::~FuDraw()
105cdf0e10cSrcweir {
106cdf0e10cSrcweir 	mpView->BrkAction();
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir /*************************************************************************
110cdf0e10cSrcweir |*
111cdf0e10cSrcweir |* MouseButtonDown-event
112cdf0e10cSrcweir |*
113cdf0e10cSrcweir \************************************************************************/
114cdf0e10cSrcweir 
MouseButtonDown(const MouseEvent & rMEvt)115cdf0e10cSrcweir sal_Bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
116cdf0e10cSrcweir {
117cdf0e10cSrcweir 	// #95491# remember button state for creation of own MouseEvents
118cdf0e10cSrcweir 	SetMouseButtonCode(rMEvt.GetButtons());
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	sal_Bool bReturn = sal_False;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	bDragHelpLine = sal_False;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	if ( rMEvt.IsLeft() )
127cdf0e10cSrcweir 	{
128cdf0e10cSrcweir 		FrameView* pFrameView = mpViewShell->GetFrameView();
129cdf0e10cSrcweir 
130cdf0e10cSrcweir //		  sal_Bool bOrtho = mpView->IsOrthoDesired() || pFrameView->IsOrtho();
131cdf0e10cSrcweir //		  bOrtho = bOrtho != rMEvt.IsShift();
132cdf0e10cSrcweir 		sal_Bool bOrtho = sal_False;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 		sal_Bool bRestricted = sal_True;
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 		if (mpView->IsDragObj())
137cdf0e10cSrcweir 		{
138cdf0e10cSrcweir 			// object is dragged (move, resize,...)
139cdf0e10cSrcweir 			const SdrHdl* pHdl = mpView->GetDragStat().GetHdl();
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 			if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
142cdf0e10cSrcweir 			{
143cdf0e10cSrcweir 				// Move
144cdf0e10cSrcweir 				bRestricted = sal_False;
145cdf0e10cSrcweir 			}
146cdf0e10cSrcweir 		}
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 		// #i33136#
149cdf0e10cSrcweir 		if(bRestricted && doConstructOrthogonal())
150cdf0e10cSrcweir 		{
151cdf0e10cSrcweir 			// Restrict movement:
152cdf0e10cSrcweir 			// rectangle->quadrat, ellipse->circle etc.
153cdf0e10cSrcweir 			bOrtho = !rMEvt.IsShift();
154cdf0e10cSrcweir 		}
155cdf0e10cSrcweir 		else
156cdf0e10cSrcweir 		{
157cdf0e10cSrcweir 			bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
158cdf0e10cSrcweir 		}
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 		if (!mpView->IsSnapEnabled())
161cdf0e10cSrcweir 			mpView->SetSnapEnabled(sal_True);
162cdf0e10cSrcweir 		sal_Bool bSnapModPressed = rMEvt.IsMod1();
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 		sal_Bool bGridSnap = pFrameView->IsGridSnap();
165cdf0e10cSrcweir 		bGridSnap = (bSnapModPressed != bGridSnap);
166cdf0e10cSrcweir 
167cdf0e10cSrcweir 		if (mpView->IsGridSnap() != bGridSnap)
168cdf0e10cSrcweir 			mpView->SetGridSnap(bGridSnap);
169cdf0e10cSrcweir 
170cdf0e10cSrcweir 		sal_Bool bBordSnap = pFrameView->IsBordSnap();
171cdf0e10cSrcweir 		bBordSnap = (bSnapModPressed != bBordSnap);
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 		if (mpView->IsBordSnap() != bBordSnap)
174cdf0e10cSrcweir 			mpView->SetBordSnap(bBordSnap);
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 		sal_Bool bHlplSnap = pFrameView->IsHlplSnap();
177cdf0e10cSrcweir 		bHlplSnap = (bSnapModPressed != bHlplSnap);
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 		if (mpView->IsHlplSnap() != bHlplSnap)
180cdf0e10cSrcweir 			mpView->SetHlplSnap(bHlplSnap);
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 		sal_Bool bOFrmSnap = pFrameView->IsOFrmSnap();
183cdf0e10cSrcweir 		bOFrmSnap = (bSnapModPressed != bOFrmSnap);
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 		if (mpView->IsOFrmSnap() != bOFrmSnap)
186cdf0e10cSrcweir 			mpView->SetOFrmSnap(bOFrmSnap);
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 		sal_Bool bOPntSnap = pFrameView->IsOPntSnap();
189cdf0e10cSrcweir 		bOPntSnap = (bSnapModPressed != bOPntSnap);
190cdf0e10cSrcweir 
191cdf0e10cSrcweir 		if (mpView->IsOPntSnap() != bOPntSnap)
192cdf0e10cSrcweir 			mpView->SetOPntSnap(bOPntSnap);
193cdf0e10cSrcweir 
194cdf0e10cSrcweir 		sal_Bool bOConSnap = pFrameView->IsOConSnap();
195cdf0e10cSrcweir 		bOConSnap = (bSnapModPressed != bOConSnap);
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 		if (mpView->IsOConSnap() != bOConSnap)
198cdf0e10cSrcweir 			mpView->SetOConSnap(bOConSnap);
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 		sal_Bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 		if (mpView->IsAngleSnapEnabled() != bAngleSnap)
203cdf0e10cSrcweir 			mpView->SetAngleSnapEnabled(bAngleSnap);
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 		if (mpView->IsOrtho() != bOrtho)
206cdf0e10cSrcweir 			mpView->SetOrtho(bOrtho);
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 		sal_Bool bCenter = rMEvt.IsMod2();
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 		if ( mpView->IsCreate1stPointAsCenter() != bCenter ||
211cdf0e10cSrcweir 			 mpView->IsResizeAtCenter() != bCenter )
212cdf0e10cSrcweir 		{
213cdf0e10cSrcweir 			mpView->SetCreate1stPointAsCenter(bCenter);
214cdf0e10cSrcweir 			mpView->SetResizeAtCenter(bCenter);
215cdf0e10cSrcweir 		}
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 		SdrPageView* pPV = 0;
218cdf0e10cSrcweir 		sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 		// #76572# look only for HelpLines when they are visible (!)
221cdf0e10cSrcweir 		sal_Bool bHelpLine(sal_False);
222cdf0e10cSrcweir 		if(mpView->IsHlplVisible())
223cdf0e10cSrcweir 			bHelpLine = mpView->PickHelpLine(aMDPos, nHitLog, *mpWindow, nHelpLine, pPV);
224cdf0e10cSrcweir 		sal_Bool bHitHdl = (mpView->PickHandle(aMDPos) != NULL);
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 		if ( bHelpLine
227cdf0e10cSrcweir 			&& !mpView->IsCreateObj()
228cdf0e10cSrcweir 			&& ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bSnapModPressed)) )
229cdf0e10cSrcweir 		{
230cdf0e10cSrcweir 			mpWindow->CaptureMouse();
231cdf0e10cSrcweir 			mpView->BegDragHelpLine(nHelpLine, pPV);
232cdf0e10cSrcweir 			bDragHelpLine = mpView->IsDragHelpLine();
233cdf0e10cSrcweir 			bReturn = sal_True;
234cdf0e10cSrcweir 		}
235cdf0e10cSrcweir 	}
236cdf0e10cSrcweir 	ForcePointer(&rMEvt);
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 	return bReturn;
239cdf0e10cSrcweir }
240cdf0e10cSrcweir 
241cdf0e10cSrcweir /*************************************************************************
242cdf0e10cSrcweir |*
243cdf0e10cSrcweir |* MouseMove-event
244cdf0e10cSrcweir |*
245cdf0e10cSrcweir \************************************************************************/
246cdf0e10cSrcweir 
MouseMove(const MouseEvent & rMEvt)247cdf0e10cSrcweir sal_Bool FuDraw::MouseMove(const MouseEvent& rMEvt)
248cdf0e10cSrcweir {
249cdf0e10cSrcweir 	FrameView* pFrameView = mpViewShell->GetFrameView();
250cdf0e10cSrcweir 	Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
251cdf0e10cSrcweir 
252cdf0e10cSrcweir //	  sal_Bool bOrtho = mpView->IsOrthoDesired() || pFrameView->IsOrtho();
253cdf0e10cSrcweir //	  bOrtho = bOrtho != rMEvt.IsShift();
254cdf0e10cSrcweir 	sal_Bool bOrtho = sal_False;
255cdf0e10cSrcweir 
256cdf0e10cSrcweir 	sal_Bool bRestricted = sal_True;
257cdf0e10cSrcweir 
258cdf0e10cSrcweir 	if (mpView->IsDragObj())
259cdf0e10cSrcweir 	{
260cdf0e10cSrcweir 		// object is dragged (move, resize, ...)
261cdf0e10cSrcweir 		const SdrHdl* pHdl = mpView->GetDragStat().GetHdl();
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 		if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
264cdf0e10cSrcweir 		{
265cdf0e10cSrcweir 			// Move
266cdf0e10cSrcweir 			bRestricted = sal_False;
267cdf0e10cSrcweir 		}
268cdf0e10cSrcweir 	}
269cdf0e10cSrcweir 
270cdf0e10cSrcweir 	if (mpView->IsAction())
271cdf0e10cSrcweir 	{
272cdf0e10cSrcweir 		// #i33136#
273cdf0e10cSrcweir 		if(bRestricted && doConstructOrthogonal())
274cdf0e10cSrcweir 		{
275cdf0e10cSrcweir 			// Restrict movement:
276cdf0e10cSrcweir 			// rectangle->quadrat, ellipse->circle etc.
277cdf0e10cSrcweir 			bOrtho = !rMEvt.IsShift();
278cdf0e10cSrcweir 		}
279cdf0e10cSrcweir 		else
280cdf0e10cSrcweir 		{
281cdf0e10cSrcweir 			bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
282cdf0e10cSrcweir 		}
283cdf0e10cSrcweir 
284cdf0e10cSrcweir 		sal_Bool bSnapModPressed = rMEvt.IsMod2();
285cdf0e10cSrcweir 		mpView->SetDragWithCopy(rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
286cdf0e10cSrcweir 
287cdf0e10cSrcweir 		sal_Bool bGridSnap = pFrameView->IsGridSnap();
288cdf0e10cSrcweir 		bGridSnap = (bSnapModPressed != bGridSnap);
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 		if (mpView->IsGridSnap() != bGridSnap)
291cdf0e10cSrcweir 			mpView->SetGridSnap(bGridSnap);
292cdf0e10cSrcweir 
293cdf0e10cSrcweir 		sal_Bool bBordSnap = pFrameView->IsBordSnap();
294cdf0e10cSrcweir 		bBordSnap = (bSnapModPressed != bBordSnap);
295cdf0e10cSrcweir 
296cdf0e10cSrcweir 		if (mpView->IsBordSnap() != bBordSnap)
297cdf0e10cSrcweir 			mpView->SetBordSnap(bBordSnap);
298cdf0e10cSrcweir 
299cdf0e10cSrcweir 		sal_Bool bHlplSnap = pFrameView->IsHlplSnap();
300cdf0e10cSrcweir 		bHlplSnap = (bSnapModPressed != bHlplSnap);
301cdf0e10cSrcweir 
302cdf0e10cSrcweir 		if (mpView->IsHlplSnap() != bHlplSnap)
303cdf0e10cSrcweir 			mpView->SetHlplSnap(bHlplSnap);
304cdf0e10cSrcweir 
305cdf0e10cSrcweir 		sal_Bool bOFrmSnap = pFrameView->IsOFrmSnap();
306cdf0e10cSrcweir 		bOFrmSnap = (bSnapModPressed != bOFrmSnap);
307cdf0e10cSrcweir 
308cdf0e10cSrcweir 		if (mpView->IsOFrmSnap() != bOFrmSnap)
309cdf0e10cSrcweir 			mpView->SetOFrmSnap(bOFrmSnap);
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 		sal_Bool bOPntSnap = pFrameView->IsOPntSnap();
312cdf0e10cSrcweir 		bOPntSnap = (bSnapModPressed != bOPntSnap);
313cdf0e10cSrcweir 
314cdf0e10cSrcweir 		if (mpView->IsOPntSnap() != bOPntSnap)
315cdf0e10cSrcweir 			mpView->SetOPntSnap(bOPntSnap);
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 		sal_Bool bOConSnap = pFrameView->IsOConSnap();
318cdf0e10cSrcweir 		bOConSnap = (bSnapModPressed != bOConSnap);
319cdf0e10cSrcweir 
320cdf0e10cSrcweir 		if (mpView->IsOConSnap() != bOConSnap)
321cdf0e10cSrcweir 			mpView->SetOConSnap(bOConSnap);
322cdf0e10cSrcweir 
323cdf0e10cSrcweir 		sal_Bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
324cdf0e10cSrcweir 
325cdf0e10cSrcweir 		if (mpView->IsAngleSnapEnabled() != bAngleSnap)
326cdf0e10cSrcweir 			mpView->SetAngleSnapEnabled(bAngleSnap);
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 		if (mpView->IsOrtho() != bOrtho)
329cdf0e10cSrcweir 			mpView->SetOrtho(bOrtho);
330cdf0e10cSrcweir 
331cdf0e10cSrcweir 		sal_Bool bCenter = rMEvt.IsMod2();
332cdf0e10cSrcweir 
333cdf0e10cSrcweir 		if ( mpView->IsCreate1stPointAsCenter() != bCenter ||
334cdf0e10cSrcweir 			 mpView->IsResizeAtCenter() != bCenter )
335cdf0e10cSrcweir 		{
336cdf0e10cSrcweir 			mpView->SetCreate1stPointAsCenter(bCenter);
337cdf0e10cSrcweir 			mpView->SetResizeAtCenter(bCenter);
338cdf0e10cSrcweir 		}
339cdf0e10cSrcweir 
340cdf0e10cSrcweir 		if ( mpView->IsDragHelpLine() )
341cdf0e10cSrcweir 			mpView->MovDragHelpLine(aPos);
342cdf0e10cSrcweir 	}
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 	sal_Bool bReturn = mpView->MouseMove(rMEvt, mpWindow);
345cdf0e10cSrcweir 
346cdf0e10cSrcweir 	if (mpView->IsAction())
347cdf0e10cSrcweir 	{
348cdf0e10cSrcweir 		// Because the flag set back if necessary in MouseMove
349cdf0e10cSrcweir 		if (mpView->IsOrtho() != bOrtho)
350cdf0e10cSrcweir 			mpView->SetOrtho(bOrtho);
351cdf0e10cSrcweir 	}
352cdf0e10cSrcweir 
353cdf0e10cSrcweir 	ForcePointer(&rMEvt);
354cdf0e10cSrcweir 
355cdf0e10cSrcweir 	return bReturn;
356cdf0e10cSrcweir }
357cdf0e10cSrcweir 
358cdf0e10cSrcweir /*************************************************************************
359cdf0e10cSrcweir |*
360cdf0e10cSrcweir |* MouseButtonUp-event
361cdf0e10cSrcweir |*
362cdf0e10cSrcweir \************************************************************************/
363cdf0e10cSrcweir 
MouseButtonUp(const MouseEvent & rMEvt)364cdf0e10cSrcweir sal_Bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
365cdf0e10cSrcweir {
366cdf0e10cSrcweir 	if ( mpView->IsDragHelpLine() )
367cdf0e10cSrcweir 		mpView->EndDragHelpLine();
368cdf0e10cSrcweir 
369cdf0e10cSrcweir 	if ( bDragHelpLine )
370cdf0e10cSrcweir 	{
371cdf0e10cSrcweir 		Rectangle aOutputArea(Point(0,0), mpWindow->GetOutputSizePixel());
372cdf0e10cSrcweir 
373cdf0e10cSrcweir 		if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) )
374cdf0e10cSrcweir 			mpView->GetSdrPageView()->DeleteHelpLine(nHelpLine);
375cdf0e10cSrcweir 
376cdf0e10cSrcweir 		mpWindow->ReleaseMouse();
377cdf0e10cSrcweir 	}
378cdf0e10cSrcweir 
379cdf0e10cSrcweir 	FrameView* pFrameView = mpViewShell->GetFrameView();
380cdf0e10cSrcweir 	mpView->SetOrtho( pFrameView->IsOrtho() );
381cdf0e10cSrcweir 	mpView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
382cdf0e10cSrcweir 	mpView->SetSnapEnabled(sal_True);
383cdf0e10cSrcweir 	mpView->SetCreate1stPointAsCenter(sal_False);
384cdf0e10cSrcweir 	mpView->SetResizeAtCenter(sal_False);
385cdf0e10cSrcweir 	mpView->SetDragWithCopy(pFrameView->IsDragWithCopy());
386cdf0e10cSrcweir 	mpView->SetGridSnap(pFrameView->IsGridSnap());
387cdf0e10cSrcweir 	mpView->SetBordSnap(pFrameView->IsBordSnap());
388cdf0e10cSrcweir 	mpView->SetHlplSnap(pFrameView->IsHlplSnap());
389cdf0e10cSrcweir 	mpView->SetOFrmSnap(pFrameView->IsOFrmSnap());
390cdf0e10cSrcweir 	mpView->SetOPntSnap(pFrameView->IsOPntSnap());
391cdf0e10cSrcweir 	mpView->SetOConSnap(pFrameView->IsOConSnap());
392cdf0e10cSrcweir 
393cdf0e10cSrcweir 	bIsInDragMode = sal_False;
394cdf0e10cSrcweir 	ForcePointer(&rMEvt);
395cdf0e10cSrcweir 	FuPoor::MouseButtonUp(rMEvt);
396cdf0e10cSrcweir 
397cdf0e10cSrcweir 	return sal_False;
398cdf0e10cSrcweir }
399cdf0e10cSrcweir 
400cdf0e10cSrcweir /*************************************************************************
401cdf0e10cSrcweir |*
402cdf0e10cSrcweir |* Process keyboard-events
403cdf0e10cSrcweir |*
404cdf0e10cSrcweir |* When processing a KeyEvent the returnvalue is sal_True, otherwise sal_False.
405cdf0e10cSrcweir |*
406cdf0e10cSrcweir \************************************************************************/
407cdf0e10cSrcweir 
KeyInput(const KeyEvent & rKEvt)408cdf0e10cSrcweir sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
409cdf0e10cSrcweir {
410cdf0e10cSrcweir 	sal_Bool bReturn = sal_False;
411cdf0e10cSrcweir 
412cdf0e10cSrcweir 	switch ( rKEvt.GetKeyCode().GetCode() )
413cdf0e10cSrcweir 	{
414cdf0e10cSrcweir 		case KEY_ESCAPE:
415cdf0e10cSrcweir 		{
416cdf0e10cSrcweir 			bReturn = FuDraw::cancel();
417cdf0e10cSrcweir 		}
418cdf0e10cSrcweir 		break;
419cdf0e10cSrcweir 
420cdf0e10cSrcweir 		case KEY_DELETE:
421cdf0e10cSrcweir 		case KEY_BACKSPACE:
422cdf0e10cSrcweir 		{
423cdf0e10cSrcweir 			if (!mpDocSh->IsReadOnly())
424cdf0e10cSrcweir 			{
425cdf0e10cSrcweir 				if ( mpView && mpView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
426cdf0e10cSrcweir 				{
427cdf0e10cSrcweir 					InfoBox(mpWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
428cdf0e10cSrcweir 				}
429cdf0e10cSrcweir 				else
430cdf0e10cSrcweir 				{
431cdf0e10cSrcweir 					// Falls IP-Client aktiv, werden die Pointer
432cdf0e10cSrcweir 					// auf das OLE- und das alte Graphic-Object
433cdf0e10cSrcweir 					// am SdClient zurueckgesetzt, damit bei
434cdf0e10cSrcweir 					// ::SelectionHasChanged nach dem Loeschen
435cdf0e10cSrcweir 					// nicht mehr versucht wird, ein Grafik-Objekt
436cdf0e10cSrcweir 					// zu restaurieren, das gar nicht mehr existiert.
437cdf0e10cSrcweir 					// Alle anderen OLE-Objekte sind davon nicht
438cdf0e10cSrcweir 					// betroffen (KA 06.10.95)
439cdf0e10cSrcweir                     OSL_ASSERT (mpViewShell->GetViewShell()!=NULL);
440cdf0e10cSrcweir 					Client* pIPClient = static_cast<Client*>(
441cdf0e10cSrcweir                         mpViewShell->GetViewShell()->GetIPClient());
442cdf0e10cSrcweir                     if (pIPClient && pIPClient->IsObjectInPlaceActive())
443cdf0e10cSrcweir 						pIPClient->SetSdrGrafObj(NULL);
444cdf0e10cSrcweir 
445cdf0e10cSrcweir 					// wait-mousepointer while deleting object
446cdf0e10cSrcweir 					WaitObject aWait( (Window*)mpViewShell->GetActiveWindow() );
447cdf0e10cSrcweir 					// delete object
448cdf0e10cSrcweir 					mpView->DeleteMarked();
449cdf0e10cSrcweir 				}
450cdf0e10cSrcweir 			}
451cdf0e10cSrcweir 			bReturn = sal_True;
452cdf0e10cSrcweir 		}
453cdf0e10cSrcweir 		break;
454cdf0e10cSrcweir 
455cdf0e10cSrcweir 		case KEY_TAB:
456cdf0e10cSrcweir 		{
457cdf0e10cSrcweir 			KeyCode aCode = rKEvt.GetKeyCode();
458cdf0e10cSrcweir 
459cdf0e10cSrcweir 			if ( !aCode.IsMod1() && !aCode.IsMod2() )
460cdf0e10cSrcweir 			{
461cdf0e10cSrcweir 				// #105336# Moved next line which was a bugfix itself into
462cdf0e10cSrcweir 				// the scope which really does the object selection travel
463cdf0e10cSrcweir 				// and thus is allowed to call SelectionHasChanged().
464cdf0e10cSrcweir 
465cdf0e10cSrcweir 				// Switch to FuSelect.
466cdf0e10cSrcweir 				mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
467cdf0e10cSrcweir 					SID_OBJECT_SELECT,
468cdf0e10cSrcweir 					SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
469cdf0e10cSrcweir 
470cdf0e10cSrcweir 				// changeover to the next object
471cdf0e10cSrcweir 				if(!mpView->MarkNextObj( !aCode.IsShift() ))
472cdf0e10cSrcweir 				{
473*0deba7fbSSteve Yin 					//If there is only one object, don't do the UnmarkAlllObj() & MarkNextObj().
474*0deba7fbSSteve Yin 					if ( mpView->GetMarkableObjCount() > 1 && mpView->AreObjectsMarked() )
475*0deba7fbSSteve Yin 					{
476*0deba7fbSSteve Yin 						// #97016# No next object: go over open end and
477*0deba7fbSSteve Yin 						// get first from the other side
478*0deba7fbSSteve Yin 						mpView->UnmarkAllObj();
479*0deba7fbSSteve Yin 						mpView->MarkNextObj(!aCode.IsShift());
480*0deba7fbSSteve Yin 					}
481cdf0e10cSrcweir 				}
482cdf0e10cSrcweir 
483cdf0e10cSrcweir 				// #97016# II
484cdf0e10cSrcweir 				if(mpView->AreObjectsMarked())
485cdf0e10cSrcweir 					mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
486cdf0e10cSrcweir 
487cdf0e10cSrcweir 				bReturn = sal_True;
488cdf0e10cSrcweir 			}
489cdf0e10cSrcweir 		}
490cdf0e10cSrcweir 		break;
491cdf0e10cSrcweir 
492cdf0e10cSrcweir 		case KEY_END:
493cdf0e10cSrcweir 		{
494cdf0e10cSrcweir 			KeyCode aCode = rKEvt.GetKeyCode();
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 			if ( aCode.IsMod1() )
497cdf0e10cSrcweir 			{
498cdf0e10cSrcweir 				// #97016# mark last object
499cdf0e10cSrcweir 				mpView->UnmarkAllObj();
500cdf0e10cSrcweir 				mpView->MarkNextObj(sal_False);
501cdf0e10cSrcweir 
502cdf0e10cSrcweir 				// #97016# II
503cdf0e10cSrcweir 				if(mpView->AreObjectsMarked())
504cdf0e10cSrcweir 					mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
505cdf0e10cSrcweir 
506cdf0e10cSrcweir 				bReturn = sal_True;
507cdf0e10cSrcweir 			}
508cdf0e10cSrcweir 		}
509cdf0e10cSrcweir 		break;
510cdf0e10cSrcweir 
511cdf0e10cSrcweir 		case KEY_HOME:
512cdf0e10cSrcweir 		{
513cdf0e10cSrcweir 			KeyCode aCode = rKEvt.GetKeyCode();
514cdf0e10cSrcweir 
515cdf0e10cSrcweir 			if ( aCode.IsMod1() )
516cdf0e10cSrcweir 			{
517cdf0e10cSrcweir 				// #97016# mark first object
518cdf0e10cSrcweir 				mpView->UnmarkAllObj();
519cdf0e10cSrcweir 				mpView->MarkNextObj(sal_True);
520cdf0e10cSrcweir 
521cdf0e10cSrcweir 				// #97016# II
522cdf0e10cSrcweir 				if(mpView->AreObjectsMarked())
523cdf0e10cSrcweir 					mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
524cdf0e10cSrcweir 
525cdf0e10cSrcweir 				bReturn = sal_True;
526cdf0e10cSrcweir 			}
527cdf0e10cSrcweir 		}
528cdf0e10cSrcweir 		break;
529cdf0e10cSrcweir 
530cdf0e10cSrcweir 		default:
531cdf0e10cSrcweir 		break;
532cdf0e10cSrcweir 	}
533cdf0e10cSrcweir 
534cdf0e10cSrcweir 	if (!bReturn)
535cdf0e10cSrcweir 	{
536cdf0e10cSrcweir 		bReturn = FuPoor::KeyInput(rKEvt);
537cdf0e10cSrcweir 	}
538cdf0e10cSrcweir 	else
539cdf0e10cSrcweir 	{
540cdf0e10cSrcweir 		mpWindow->ReleaseMouse();
541cdf0e10cSrcweir 	}
542cdf0e10cSrcweir 
543cdf0e10cSrcweir 	return (bReturn);
544cdf0e10cSrcweir }
545cdf0e10cSrcweir 
546cdf0e10cSrcweir /*************************************************************************
547cdf0e10cSrcweir |*
548cdf0e10cSrcweir |* Fade out the selection-presentation before scrolling
549cdf0e10cSrcweir |*
550cdf0e10cSrcweir \************************************************************************/
551cdf0e10cSrcweir 
ScrollStart()552cdf0e10cSrcweir void FuDraw::ScrollStart()
553cdf0e10cSrcweir {
554cdf0e10cSrcweir }
555cdf0e10cSrcweir 
556cdf0e10cSrcweir /*************************************************************************
557cdf0e10cSrcweir |*
558cdf0e10cSrcweir |* After scrolling show the selection-presentation again
559cdf0e10cSrcweir |*
560cdf0e10cSrcweir \************************************************************************/
561cdf0e10cSrcweir 
ScrollEnd()562cdf0e10cSrcweir void FuDraw::ScrollEnd()
563cdf0e10cSrcweir {
564cdf0e10cSrcweir }
565cdf0e10cSrcweir 
566cdf0e10cSrcweir /*************************************************************************
567cdf0e10cSrcweir |*
568cdf0e10cSrcweir |* Aktivate function
569cdf0e10cSrcweir |*
570cdf0e10cSrcweir \************************************************************************/
571cdf0e10cSrcweir 
Activate()572cdf0e10cSrcweir void FuDraw::Activate()
573cdf0e10cSrcweir {
574cdf0e10cSrcweir 	FuPoor::Activate();
575cdf0e10cSrcweir 	ForcePointer();
576cdf0e10cSrcweir }
577cdf0e10cSrcweir 
578cdf0e10cSrcweir /*************************************************************************
579cdf0e10cSrcweir |*
580cdf0e10cSrcweir |* Deaktivate function
581cdf0e10cSrcweir |*
582cdf0e10cSrcweir \************************************************************************/
583cdf0e10cSrcweir 
Deactivate()584cdf0e10cSrcweir void FuDraw::Deactivate()
585cdf0e10cSrcweir {
586cdf0e10cSrcweir 	FuPoor::Deactivate();
587cdf0e10cSrcweir }
588cdf0e10cSrcweir 
589cdf0e10cSrcweir 
590cdf0e10cSrcweir /*************************************************************************
591cdf0e10cSrcweir |*
592cdf0e10cSrcweir |* Toggle mouse-pointer
593cdf0e10cSrcweir |*
594cdf0e10cSrcweir \************************************************************************/
595cdf0e10cSrcweir 
ForcePointer(const MouseEvent * pMEvt)596cdf0e10cSrcweir void FuDraw::ForcePointer(const MouseEvent* pMEvt)
597cdf0e10cSrcweir {
598cdf0e10cSrcweir 	Point aPnt;
599cdf0e10cSrcweir 	sal_uInt16 nModifier = 0;
600cdf0e10cSrcweir 	sal_Bool bLeftDown = sal_False;
601cdf0e10cSrcweir 	sal_Bool bDefPointer = sal_True;
602cdf0e10cSrcweir 
603cdf0e10cSrcweir 	if (pMEvt)
604cdf0e10cSrcweir 	{
605cdf0e10cSrcweir 		aPnt = mpWindow->PixelToLogic(pMEvt->GetPosPixel());
606cdf0e10cSrcweir 		nModifier = pMEvt->GetModifier();
607cdf0e10cSrcweir 		bLeftDown = pMEvt->IsLeft();
608cdf0e10cSrcweir 	}
609cdf0e10cSrcweir 	else
610cdf0e10cSrcweir 	{
611cdf0e10cSrcweir 		aPnt = mpWindow->PixelToLogic(mpWindow->GetPointerPosPixel());
612cdf0e10cSrcweir 	}
613cdf0e10cSrcweir 
614cdf0e10cSrcweir 	if (mpView->IsDragObj())
615cdf0e10cSrcweir 	{
616cdf0e10cSrcweir 		if (SD_MOD()->GetWaterCan() && !mpView->PickHandle(aPnt))
617cdf0e10cSrcweir 		{
618cdf0e10cSrcweir 			/******************************************************************
619cdf0e10cSrcweir 			* Giesskannenmodus
620cdf0e10cSrcweir 			******************************************************************/
621cdf0e10cSrcweir 			bDefPointer = sal_False;
622cdf0e10cSrcweir 			mpWindow->SetPointer(Pointer(POINTER_FILL));
623cdf0e10cSrcweir 		}
624cdf0e10cSrcweir 	}
625cdf0e10cSrcweir 	else
626cdf0e10cSrcweir 	{
627cdf0e10cSrcweir 		SdrHdl* pHdl = mpView->PickHandle(aPnt);
628cdf0e10cSrcweir 
629cdf0e10cSrcweir 		if (SD_MOD()->GetWaterCan() && !pHdl)
630cdf0e10cSrcweir 		{
631cdf0e10cSrcweir 			/******************************************************************
632cdf0e10cSrcweir 			* Giesskannenmodus
633cdf0e10cSrcweir 			******************************************************************/
634cdf0e10cSrcweir 			bDefPointer = sal_False;
635cdf0e10cSrcweir 			mpWindow->SetPointer(Pointer(POINTER_FILL));
636cdf0e10cSrcweir 		}
637cdf0e10cSrcweir 		else if (!pHdl &&
638cdf0e10cSrcweir 				 mpViewShell->GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()))
639cdf0e10cSrcweir 		{
640cdf0e10cSrcweir 			/******************************************************************
641cdf0e10cSrcweir 			* Pipettenmodus
642cdf0e10cSrcweir 			******************************************************************/
643cdf0e10cSrcweir 			SvxBmpMask* pMask = (SvxBmpMask*) mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())->GetWindow();
644cdf0e10cSrcweir 
645cdf0e10cSrcweir 			if (pMask && pMask->IsEyedropping())
646cdf0e10cSrcweir 			{
647cdf0e10cSrcweir 				bDefPointer = sal_False;
648cdf0e10cSrcweir 				mpWindow->SetPointer(Pointer(POINTER_REFHAND));
649cdf0e10cSrcweir 			}
650cdf0e10cSrcweir 		}
651cdf0e10cSrcweir 		else if (!mpView->IsAction())
652cdf0e10cSrcweir 		{
653cdf0e10cSrcweir 			SdrObject* pObj = NULL;
654cdf0e10cSrcweir 			SdrPageView* pPV = NULL;
655cdf0e10cSrcweir 			SdrViewEvent aVEvt;
656cdf0e10cSrcweir 			SdrHitKind eHit = SDRHIT_NONE;
657cdf0e10cSrcweir 			SdrDragMode eDragMode = mpView->GetDragMode();
658cdf0e10cSrcweir 
659cdf0e10cSrcweir 			if (pMEvt)
660cdf0e10cSrcweir 			{
661cdf0e10cSrcweir 				eHit = mpView->PickAnything(*pMEvt, SDRMOUSEMOVE, aVEvt);
662cdf0e10cSrcweir 			}
663cdf0e10cSrcweir 
664cdf0e10cSrcweir 			if ((eDragMode == SDRDRAG_ROTATE) && (eHit == SDRHIT_MARKEDOBJECT))
665cdf0e10cSrcweir 			{
666cdf0e10cSrcweir 				// The goal of this request is show always the rotation-arrow for 3D-objects at rotation-modus
667cdf0e10cSrcweir 				// Independent of the settings at Extras->Optionen->Grafik "Objekte immer verschieben"
668cdf0e10cSrcweir 				// 2D-objects acquit in an other way. Otherwise, the rotation of 3d-objects around any axises
669cdf0e10cSrcweir 				// wouldn't be possible per default.
670cdf0e10cSrcweir 				const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
671cdf0e10cSrcweir 				SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj();
672cdf0e10cSrcweir 				if ((pObject->ISA(E3dObject)) && (rMarkList.GetMarkCount() == 1))
673cdf0e10cSrcweir 				{
674cdf0e10cSrcweir 					mpWindow->SetPointer(Pointer(POINTER_ROTATE));
675cdf0e10cSrcweir 					bDefPointer = sal_False;     // Otherwise it'll be calles Joes routine and the mousepointer will reconfigurate again
676cdf0e10cSrcweir 				}
677cdf0e10cSrcweir 			}
678cdf0e10cSrcweir 
679cdf0e10cSrcweir 			if (eHit == SDRHIT_NONE)
680cdf0e10cSrcweir 			{
681cdf0e10cSrcweir 				// found nothing -> look after at the masterpage
682cdf0e10cSrcweir 				mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER);
683cdf0e10cSrcweir 			}
684cdf0e10cSrcweir 			else if (eHit == SDRHIT_UNMARKEDOBJECT)
685cdf0e10cSrcweir 			{
686cdf0e10cSrcweir 				pObj = aVEvt.pObj;
687cdf0e10cSrcweir 			}
688cdf0e10cSrcweir 			else if (eHit == SDRHIT_TEXTEDITOBJ && this->ISA(FuSelection))
689cdf0e10cSrcweir 			{
690cdf0e10cSrcweir 				sal_uInt16 nSdrObjKind = aVEvt.pObj->GetObjIdentifier();
691cdf0e10cSrcweir 
692cdf0e10cSrcweir 				if ( nSdrObjKind != OBJ_TEXT		&&
693cdf0e10cSrcweir 					 nSdrObjKind != OBJ_TITLETEXT	&&
694cdf0e10cSrcweir 					 nSdrObjKind != OBJ_OUTLINETEXT &&
695cdf0e10cSrcweir 					 aVEvt.pObj->IsEmptyPresObj() )
696cdf0e10cSrcweir 				{
697cdf0e10cSrcweir 					pObj = NULL;
698cdf0e10cSrcweir 					bDefPointer = sal_False;
699cdf0e10cSrcweir 					mpWindow->SetPointer(Pointer(POINTER_ARROW));
700cdf0e10cSrcweir 				}
701cdf0e10cSrcweir 			}
702cdf0e10cSrcweir 
703cdf0e10cSrcweir 			if (pObj && pMEvt && !pMEvt->IsMod2() && this->ISA(FuSelection))
704cdf0e10cSrcweir 			{
705cdf0e10cSrcweir 				// Auf Animation oder ImageMap pruefen
706cdf0e10cSrcweir 				bDefPointer = !SetPointer(pObj, aPnt);
707cdf0e10cSrcweir 
708cdf0e10cSrcweir 				if (bDefPointer && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
709cdf0e10cSrcweir 				{
710cdf0e10cSrcweir 					// In die Gruppe hineinschauen
711cdf0e10cSrcweir 					if (mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
712cdf0e10cSrcweir 						bDefPointer = !SetPointer(pObj, aPnt);
713cdf0e10cSrcweir 				}
714cdf0e10cSrcweir 			}
715cdf0e10cSrcweir 		}
716cdf0e10cSrcweir 	}
717cdf0e10cSrcweir 
718cdf0e10cSrcweir 	if (bDefPointer)
719cdf0e10cSrcweir 	{
720cdf0e10cSrcweir 		mpWindow->SetPointer(mpView->GetPreferedPointer(
721cdf0e10cSrcweir 							aPnt, mpWindow, nModifier, bLeftDown));
722cdf0e10cSrcweir 	}
723cdf0e10cSrcweir }
724cdf0e10cSrcweir 
725cdf0e10cSrcweir /*************************************************************************
726cdf0e10cSrcweir |*
727cdf0e10cSrcweir |* Set cursor for animaton or imagemap
728cdf0e10cSrcweir |*
729cdf0e10cSrcweir \************************************************************************/
730cdf0e10cSrcweir 
SetPointer(SdrObject * pObj,const Point & rPos)731cdf0e10cSrcweir sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
732cdf0e10cSrcweir {
733cdf0e10cSrcweir 	sal_Bool bSet = sal_False;
734cdf0e10cSrcweir 
735cdf0e10cSrcweir 	sal_Bool bAnimationInfo = (!mpDocSh->ISA(GraphicDocShell) &&
736cdf0e10cSrcweir 						  mpDoc->GetAnimationInfo(pObj)) ? sal_True:sal_False;
737cdf0e10cSrcweir 
738cdf0e10cSrcweir 	sal_Bool bImageMapInfo = sal_False;
739cdf0e10cSrcweir 
740cdf0e10cSrcweir 	if (!bAnimationInfo)
741cdf0e10cSrcweir 		bImageMapInfo = mpDoc->GetIMapInfo(pObj) ? sal_True:sal_False;
742cdf0e10cSrcweir 
743cdf0e10cSrcweir 	if (bAnimationInfo || bImageMapInfo)
744cdf0e10cSrcweir 	{
745cdf0e10cSrcweir 		const SetOfByte* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers();
746cdf0e10cSrcweir 		sal_uInt16 nHitLog(sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width()));
747cdf0e10cSrcweir 		long  n2HitLog(nHitLog * 2);
748cdf0e10cSrcweir 		Point aHitPosR(rPos);
749cdf0e10cSrcweir 		Point aHitPosL(rPos);
750cdf0e10cSrcweir 		Point aHitPosT(rPos);
751cdf0e10cSrcweir 		Point aHitPosB(rPos);
752cdf0e10cSrcweir 
753cdf0e10cSrcweir 		aHitPosR.X() += n2HitLog;
754cdf0e10cSrcweir 		aHitPosL.X() -= n2HitLog;
755cdf0e10cSrcweir 		aHitPosT.Y() += n2HitLog;
756cdf0e10cSrcweir 		aHitPosB.Y() -= n2HitLog;
757cdf0e10cSrcweir 
758cdf0e10cSrcweir 		if ( !pObj->IsClosedObj() ||
759cdf0e10cSrcweir             ( SdrObjectPrimitiveHit(*pObj, aHitPosR, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
760cdf0e10cSrcweir 			  SdrObjectPrimitiveHit(*pObj, aHitPosL, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
761cdf0e10cSrcweir 			  SdrObjectPrimitiveHit(*pObj, aHitPosT, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
762cdf0e10cSrcweir 			  SdrObjectPrimitiveHit(*pObj, aHitPosB, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false)))
763cdf0e10cSrcweir 		{
764cdf0e10cSrcweir 			/**********************************************************
765cdf0e10cSrcweir 			* hit inside the object (without margin) or open object
766cdf0e10cSrcweir 			********************************************************/
767cdf0e10cSrcweir 
768cdf0e10cSrcweir 			if (bAnimationInfo)
769cdf0e10cSrcweir 			{
770cdf0e10cSrcweir 				/******************************************************
771cdf0e10cSrcweir 				* Click-Action
772cdf0e10cSrcweir 				******************************************************/
773cdf0e10cSrcweir 				SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
774cdf0e10cSrcweir 
775cdf0e10cSrcweir 				if ((mpView->ISA(DrawView) &&
776cdf0e10cSrcweir 					  (pInfo->meClickAction == presentation::ClickAction_BOOKMARK  ||
777cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_DOCUMENT  ||
778cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_PREVPAGE  ||
779cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_NEXTPAGE  ||
780cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_FIRSTPAGE ||
781cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_LASTPAGE  ||
782cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_VERB      ||
783cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_PROGRAM   ||
784cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_MACRO     ||
785cdf0e10cSrcweir 					   pInfo->meClickAction == presentation::ClickAction_SOUND))
786cdf0e10cSrcweir 																	||
787cdf0e10cSrcweir 					(mpView->ISA(DrawView) &&
788cdf0e10cSrcweir 						SlideShow::IsRunning( mpViewShell->GetViewShellBase() )   &&
789cdf0e10cSrcweir 						 (pInfo->meClickAction == presentation::ClickAction_VANISH    		  ||
790cdf0e10cSrcweir 						  pInfo->meClickAction == presentation::ClickAction_INVISIBLE 		  ||
791cdf0e10cSrcweir 						  pInfo->meClickAction == presentation::ClickAction_STOPPRESENTATION ||
792cdf0e10cSrcweir 						 (pInfo->mbActive &&
793cdf0e10cSrcweir 						  ( pInfo->meEffect != presentation::AnimationEffect_NONE ||
794cdf0e10cSrcweir 							pInfo->meTextEffect != presentation::AnimationEffect_NONE )))))
795cdf0e10cSrcweir 					{
796cdf0e10cSrcweir 						// Animations-Objekt
797cdf0e10cSrcweir 						bSet = sal_True;
798cdf0e10cSrcweir 						mpWindow->SetPointer(Pointer(POINTER_REFHAND));
799cdf0e10cSrcweir 					}
800cdf0e10cSrcweir 			}
801cdf0e10cSrcweir 			else if (bImageMapInfo &&
802cdf0e10cSrcweir 					 mpDoc->GetHitIMapObject(pObj, rPos, *mpWindow))
803cdf0e10cSrcweir 			{
804cdf0e10cSrcweir 				/******************************************************
805cdf0e10cSrcweir 				* ImageMap
806cdf0e10cSrcweir 				******************************************************/
807cdf0e10cSrcweir 				bSet = sal_True;
808cdf0e10cSrcweir 				mpWindow->SetPointer(Pointer(POINTER_REFHAND));
809cdf0e10cSrcweir 			}
810cdf0e10cSrcweir 		}
811cdf0e10cSrcweir 	}
812cdf0e10cSrcweir 
813cdf0e10cSrcweir 	return bSet;
814cdf0e10cSrcweir }
815cdf0e10cSrcweir 
816cdf0e10cSrcweir 
817cdf0e10cSrcweir 
818cdf0e10cSrcweir /*************************************************************************
819cdf0e10cSrcweir |*
820cdf0e10cSrcweir |* Response of doubleclick
821cdf0e10cSrcweir |*
822cdf0e10cSrcweir \************************************************************************/
823cdf0e10cSrcweir 
DoubleClick(const MouseEvent & rMEvt)824cdf0e10cSrcweir void FuDraw::DoubleClick(const MouseEvent& rMEvt)
825cdf0e10cSrcweir {
826cdf0e10cSrcweir 	sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
827cdf0e10cSrcweir 
828cdf0e10cSrcweir 	if ( mpView->AreObjectsMarked() )
829cdf0e10cSrcweir 	{
830cdf0e10cSrcweir 		const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
831cdf0e10cSrcweir 
832cdf0e10cSrcweir 		if (rMarkList.GetMarkCount() == 1)
833cdf0e10cSrcweir 		{
834cdf0e10cSrcweir 			SdrMark* pMark = rMarkList.GetMark(0);
835cdf0e10cSrcweir 			SdrObject* pObj = pMark->GetMarkedSdrObj();
836cdf0e10cSrcweir 
837cdf0e10cSrcweir 			sal_uInt32 nInv = pObj->GetObjInventor();
838cdf0e10cSrcweir 			sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
839cdf0e10cSrcweir 
840cdf0e10cSrcweir 			if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
841cdf0e10cSrcweir 			{
842cdf0e10cSrcweir 				DrawDocShell* pDocSh = mpDoc->GetDocSh();
843cdf0e10cSrcweir 
844cdf0e10cSrcweir 				if ( !pDocSh->IsUIActive() )
845cdf0e10cSrcweir 				{
846cdf0e10cSrcweir 					/**********************************************************
847cdf0e10cSrcweir 					* aktivate OLE-object
848cdf0e10cSrcweir 					**********************************************************/
849cdf0e10cSrcweir 					//HMHmpView->HideMarkHdl();
850cdf0e10cSrcweir 					mpViewShell->ActivateObject( (SdrOle2Obj*) pObj, 0);
851cdf0e10cSrcweir 				}
852cdf0e10cSrcweir 			}
853cdf0e10cSrcweir 			else if (nInv == SdrInventor &&  nSdrObjKind == OBJ_GRAF && pObj->IsEmptyPresObj() )
854cdf0e10cSrcweir 			{
855cdf0e10cSrcweir 				mpViewShell->GetViewFrame()->
856cdf0e10cSrcweir 					GetDispatcher()->Execute( SID_INSERT_GRAPHIC,
857cdf0e10cSrcweir 											  SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
858cdf0e10cSrcweir 			}
859cdf0e10cSrcweir 			else if ( ( pObj->ISA(SdrTextObj) || pObj->ISA(SdrObjGroup) ) &&
860cdf0e10cSrcweir 					  !SD_MOD()->GetWaterCan()                            &&
861cdf0e10cSrcweir 					  mpViewShell->GetFrameView()->IsDoubleClickTextEdit() &&
862cdf0e10cSrcweir 					  !mpDocSh->IsReadOnly())
863cdf0e10cSrcweir 			{
864cdf0e10cSrcweir 				SfxUInt16Item aItem(SID_TEXTEDIT, 2);
865cdf0e10cSrcweir 				mpViewShell->GetViewFrame()->GetDispatcher()->
866cdf0e10cSrcweir 								 Execute(SID_TEXTEDIT, SFX_CALLMODE_ASYNCHRON |
867cdf0e10cSrcweir 										 SFX_CALLMODE_RECORD, &aItem, 0L);
868cdf0e10cSrcweir 			}
869cdf0e10cSrcweir 			else if (nInv == SdrInventor &&  nSdrObjKind == OBJ_GRUP)
870cdf0e10cSrcweir 			{
871cdf0e10cSrcweir 				// hit group -> select subobject
872cdf0e10cSrcweir 				mpView->UnMarkAll();
873cdf0e10cSrcweir 				mpView->MarkObj(aMDPos, nHitLog, rMEvt.IsShift(), sal_True);
874cdf0e10cSrcweir 			}
875cdf0e10cSrcweir 		}
876cdf0e10cSrcweir 	}
877cdf0e10cSrcweir 	else
878cdf0e10cSrcweir 		mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
879cdf0e10cSrcweir }
880cdf0e10cSrcweir 
881cdf0e10cSrcweir /*************************************************************************
882cdf0e10cSrcweir |*
883cdf0e10cSrcweir |* Help-event
884cdf0e10cSrcweir |*
885cdf0e10cSrcweir \************************************************************************/
886cdf0e10cSrcweir 
RequestHelp(const HelpEvent & rHEvt)887cdf0e10cSrcweir sal_Bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
888cdf0e10cSrcweir {
889cdf0e10cSrcweir 	sal_Bool bReturn = sal_False;
890cdf0e10cSrcweir 
891cdf0e10cSrcweir 	if (Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled())
892cdf0e10cSrcweir 	{
893cdf0e10cSrcweir 		SdrViewEvent aVEvt;
894cdf0e10cSrcweir 
895cdf0e10cSrcweir 		MouseEvent aMEvt(mpWindow->GetPointerPosPixel(), 1, 0, MOUSE_LEFT);
896cdf0e10cSrcweir 
897cdf0e10cSrcweir 		SdrHitKind eHit = mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
898cdf0e10cSrcweir 
899cdf0e10cSrcweir 		SdrObject* pObj = aVEvt.pObj;
900cdf0e10cSrcweir 
901cdf0e10cSrcweir 		if (eHit != SDRHIT_NONE && pObj != NULL)
902cdf0e10cSrcweir 		{
903cdf0e10cSrcweir 			Point aPosPixel = rHEvt.GetMousePosPixel();
904cdf0e10cSrcweir 
905cdf0e10cSrcweir 			bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
906cdf0e10cSrcweir 
907cdf0e10cSrcweir 			if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
908cdf0e10cSrcweir 			{
909cdf0e10cSrcweir 				// In die Gruppe hineinschauen
910cdf0e10cSrcweir 				SdrPageView* pPV = NULL;
911cdf0e10cSrcweir 
912cdf0e10cSrcweir 				Point aPos(mpWindow->PixelToLogic(mpWindow->ScreenToOutputPixel(aPosPixel)));
913cdf0e10cSrcweir 
914cdf0e10cSrcweir 				if (mpView->PickObj(aPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
915cdf0e10cSrcweir 					bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
916cdf0e10cSrcweir 			}
917cdf0e10cSrcweir 		}
918cdf0e10cSrcweir 	}
919cdf0e10cSrcweir 
920cdf0e10cSrcweir 	if (!bReturn)
921cdf0e10cSrcweir 	{
922cdf0e10cSrcweir 		bReturn = FuPoor::RequestHelp(rHEvt);
923cdf0e10cSrcweir 	}
924cdf0e10cSrcweir 
925cdf0e10cSrcweir 	return(bReturn);
926cdf0e10cSrcweir }
927cdf0e10cSrcweir 
928cdf0e10cSrcweir 
929cdf0e10cSrcweir 
930cdf0e10cSrcweir /*************************************************************************
931cdf0e10cSrcweir |*
932cdf0e10cSrcweir |* Command-event
933cdf0e10cSrcweir |*
934cdf0e10cSrcweir \************************************************************************/
935cdf0e10cSrcweir 
SetHelpText(SdrObject * pObj,const Point & rPosPixel,const SdrViewEvent & rVEvt)936cdf0e10cSrcweir sal_Bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrViewEvent& rVEvt)
937cdf0e10cSrcweir {
938cdf0e10cSrcweir 	sal_Bool bSet = sal_False;
939cdf0e10cSrcweir 	String aHelpText;
940cdf0e10cSrcweir 	Point aPos(mpWindow->PixelToLogic(mpWindow->ScreenToOutputPixel(rPosPixel)));
941cdf0e10cSrcweir 
942cdf0e10cSrcweir 	// URL fuer IMapObject unter Pointer ist Hilfetext
943cdf0e10cSrcweir 	if ( mpDoc->GetIMapInfo(pObj) )
944cdf0e10cSrcweir 	{
945cdf0e10cSrcweir 		IMapObject* pIMapObj = mpDoc->GetHitIMapObject(pObj, aPos, *mpWindow );
946cdf0e10cSrcweir 
947cdf0e10cSrcweir 		if ( pIMapObj )
948cdf0e10cSrcweir 		{
949cdf0e10cSrcweir 			// show name
950cdf0e10cSrcweir 			aHelpText = pIMapObj->GetAltText();
951cdf0e10cSrcweir 
952cdf0e10cSrcweir 			if (aHelpText.Len() == 0)
953cdf0e10cSrcweir 			{
954cdf0e10cSrcweir 				// show url if no name is available
955cdf0e10cSrcweir 				aHelpText = INetURLObject::decode( pIMapObj->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
956cdf0e10cSrcweir 			}
957cdf0e10cSrcweir 		}
958cdf0e10cSrcweir 	}
959cdf0e10cSrcweir 	else if (!mpDocSh->ISA(GraphicDocShell) && mpDoc->GetAnimationInfo(pObj))
960cdf0e10cSrcweir 	{
961cdf0e10cSrcweir 		SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
962cdf0e10cSrcweir 
963cdf0e10cSrcweir 		switch (pInfo->meClickAction)
964cdf0e10cSrcweir 		{
965cdf0e10cSrcweir 			case presentation::ClickAction_PREVPAGE:
966cdf0e10cSrcweir 			{
967cdf0e10cSrcweir 				// jump to the prior page
968cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_PREVPAGE));
969cdf0e10cSrcweir 			}
970cdf0e10cSrcweir 			break;
971cdf0e10cSrcweir 
972cdf0e10cSrcweir 			case presentation::ClickAction_NEXTPAGE:
973cdf0e10cSrcweir 			{
974cdf0e10cSrcweir 				// jump to the next page
975cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_NEXTPAGE));
976cdf0e10cSrcweir 			}
977cdf0e10cSrcweir 			break;
978cdf0e10cSrcweir 
979cdf0e10cSrcweir 			case presentation::ClickAction_FIRSTPAGE:
980cdf0e10cSrcweir 			{
981cdf0e10cSrcweir 				// jump to the first page
982cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_FIRSTPAGE));
983cdf0e10cSrcweir 			}
984cdf0e10cSrcweir 			break;
985cdf0e10cSrcweir 
986cdf0e10cSrcweir 			case presentation::ClickAction_LASTPAGE:
987cdf0e10cSrcweir 			{
988cdf0e10cSrcweir 				// jump to the last page
989cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_LASTPAGE));
990cdf0e10cSrcweir 			}
991cdf0e10cSrcweir 			break;
992cdf0e10cSrcweir 
993cdf0e10cSrcweir 			case presentation::ClickAction_BOOKMARK:
994cdf0e10cSrcweir 			{
995cdf0e10cSrcweir 				// jump to object/page
996cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_BOOKMARK));
997cdf0e10cSrcweir 				aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
998cdf0e10cSrcweir 				aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
999cdf0e10cSrcweir 			}
1000cdf0e10cSrcweir 			break;
1001cdf0e10cSrcweir 
1002cdf0e10cSrcweir 			case presentation::ClickAction_DOCUMENT:
1003cdf0e10cSrcweir 			{
1004cdf0e10cSrcweir 				// jump to document (object/page)
1005cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_DOCUMENT));
1006cdf0e10cSrcweir 				aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
1007cdf0e10cSrcweir 				aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
1008cdf0e10cSrcweir 			}
1009cdf0e10cSrcweir 			break;
1010cdf0e10cSrcweir 
1011cdf0e10cSrcweir 			case presentation::ClickAction_PROGRAM:
1012cdf0e10cSrcweir 			{
1013cdf0e10cSrcweir 				// execute program
1014cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_PROGRAM));
1015cdf0e10cSrcweir 				aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
1016cdf0e10cSrcweir 				aHelpText.Append( String(INetURLObject::decode( pInfo->GetBookmark(), '%', INetURLObject::DECODE_WITH_CHARSET ) ));
1017cdf0e10cSrcweir 			}
1018cdf0e10cSrcweir 			break;
1019cdf0e10cSrcweir 
1020cdf0e10cSrcweir 			case presentation::ClickAction_MACRO:
1021cdf0e10cSrcweir 			{
1022cdf0e10cSrcweir 				// execute program
1023cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_MACRO));
1024cdf0e10cSrcweir 				aHelpText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
1025cdf0e10cSrcweir 
1026cdf0e10cSrcweir 				if ( SfxApplication::IsXScriptURL( pInfo->GetBookmark() ) )
1027cdf0e10cSrcweir 				{
1028cdf0e10cSrcweir 					aHelpText.Append( pInfo->GetBookmark() );
1029cdf0e10cSrcweir 				}
1030cdf0e10cSrcweir 				else
1031cdf0e10cSrcweir 				{
1032cdf0e10cSrcweir                     String sBookmark( pInfo->GetBookmark() );
1033cdf0e10cSrcweir 					sal_Unicode cToken = '.';
1034cdf0e10cSrcweir 					aHelpText.Append( sBookmark.GetToken( 2, cToken ) );
1035cdf0e10cSrcweir 					aHelpText.Append( cToken );
1036cdf0e10cSrcweir 					aHelpText.Append( sBookmark.GetToken( 1, cToken ) );
1037cdf0e10cSrcweir 					aHelpText.Append( cToken );
1038cdf0e10cSrcweir 					aHelpText.Append( sBookmark.GetToken( 0, cToken ) );
1039cdf0e10cSrcweir 				}
1040cdf0e10cSrcweir 			}
1041cdf0e10cSrcweir 			break;
1042cdf0e10cSrcweir 
1043cdf0e10cSrcweir 			case presentation::ClickAction_SOUND:
1044cdf0e10cSrcweir 			{
1045cdf0e10cSrcweir 				// play-back sound
1046cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_SOUND));
1047cdf0e10cSrcweir 			}
1048cdf0e10cSrcweir 			break;
1049cdf0e10cSrcweir 
1050cdf0e10cSrcweir 			case presentation::ClickAction_VERB:
1051cdf0e10cSrcweir 			{
1052cdf0e10cSrcweir 				// execute OLE-verb
1053cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_VERB));
1054cdf0e10cSrcweir 			}
1055cdf0e10cSrcweir 			break;
1056cdf0e10cSrcweir 
1057cdf0e10cSrcweir 			case presentation::ClickAction_STOPPRESENTATION:
1058cdf0e10cSrcweir 			{
1059cdf0e10cSrcweir 				// quit presentation
1060cdf0e10cSrcweir 				aHelpText = String(SdResId(STR_CLICK_ACTION_STOPPRESENTATION));
1061cdf0e10cSrcweir 			}
1062cdf0e10cSrcweir 			break;
1063cdf0e10cSrcweir 			default:
1064cdf0e10cSrcweir 				break;
1065cdf0e10cSrcweir 		}
1066cdf0e10cSrcweir 	}
1067cdf0e10cSrcweir 	else if (rVEvt.pURLField)
1068cdf0e10cSrcweir 	{
1069cdf0e10cSrcweir 		/**************************************************************
1070cdf0e10cSrcweir 		* URL-Field
1071cdf0e10cSrcweir 		**************************************************************/
1072cdf0e10cSrcweir 		aHelpText = INetURLObject::decode( rVEvt.pURLField->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
1073cdf0e10cSrcweir 	}
1074cdf0e10cSrcweir 
1075cdf0e10cSrcweir 	if (aHelpText.Len())
1076cdf0e10cSrcweir 	{
1077cdf0e10cSrcweir 		bSet = sal_True;
1078cdf0e10cSrcweir 		Rectangle aLogicPix = mpWindow->LogicToPixel(pObj->GetLogicRect());
1079cdf0e10cSrcweir 		Rectangle aScreenRect(mpWindow->OutputToScreenPixel(aLogicPix.TopLeft()),
1080cdf0e10cSrcweir 							  mpWindow->OutputToScreenPixel(aLogicPix.BottomRight()));
1081cdf0e10cSrcweir 
1082cdf0e10cSrcweir 		if (Help::IsBalloonHelpEnabled())
1083cdf0e10cSrcweir 			Help::ShowBalloon( (Window*)mpWindow, rPosPixel, aScreenRect, aHelpText);
1084cdf0e10cSrcweir 		else if (Help::IsQuickHelpEnabled())
1085cdf0e10cSrcweir 			Help::ShowQuickHelp( (Window*)mpWindow, aScreenRect, aHelpText);
1086cdf0e10cSrcweir 	}
1087cdf0e10cSrcweir 
1088cdf0e10cSrcweir 	return bSet;
1089cdf0e10cSrcweir }
1090cdf0e10cSrcweir 
1091cdf0e10cSrcweir 
1092cdf0e10cSrcweir /** is called when the currenct function should be aborted. <p>
1093cdf0e10cSrcweir 	This is used when a function gets a KEY_ESCAPE but can also
1094cdf0e10cSrcweir 	be called directly.
1095cdf0e10cSrcweir 
1096cdf0e10cSrcweir 	@returns true if a active function was aborted
1097cdf0e10cSrcweir */
cancel()1098cdf0e10cSrcweir bool FuDraw::cancel()
1099cdf0e10cSrcweir {
1100cdf0e10cSrcweir 	bool bReturn = false;
1101cdf0e10cSrcweir 
1102cdf0e10cSrcweir 	if ( mpView->IsAction() )
1103cdf0e10cSrcweir 	{
1104cdf0e10cSrcweir 		mpView->BrkAction();
1105cdf0e10cSrcweir 		bReturn = true;
1106cdf0e10cSrcweir 	}
1107cdf0e10cSrcweir 	else if ( mpView->IsTextEdit() )
1108cdf0e10cSrcweir 	{
1109cdf0e10cSrcweir 		mpView->SdrEndTextEdit();
1110cdf0e10cSrcweir 		bReturn = true;
1111cdf0e10cSrcweir 
1112cdf0e10cSrcweir 		SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
1113cdf0e10cSrcweir 		rBindings.Invalidate( SID_PARASPACE_INCREASE );
1114cdf0e10cSrcweir 		rBindings.Invalidate( SID_PARASPACE_DECREASE );
1115cdf0e10cSrcweir 	}
1116cdf0e10cSrcweir 	else if ( mpView->AreObjectsMarked() )
1117cdf0e10cSrcweir 	{
1118cdf0e10cSrcweir 		// #97016# II
1119cdf0e10cSrcweir 		const SdrHdlList& rHdlList = mpView->GetHdlList();
1120cdf0e10cSrcweir 		SdrHdl* pHdl = rHdlList.GetFocusHdl();
1121cdf0e10cSrcweir 
1122cdf0e10cSrcweir 		if(pHdl)
1123cdf0e10cSrcweir 		{
1124cdf0e10cSrcweir 			((SdrHdlList&)rHdlList).ResetFocusHdl();
1125cdf0e10cSrcweir 		}
1126cdf0e10cSrcweir 		else
1127cdf0e10cSrcweir 		{
1128cdf0e10cSrcweir 			mpView->UnmarkAll();
1129cdf0e10cSrcweir 		}
1130cdf0e10cSrcweir 
1131cdf0e10cSrcweir         // Switch to FuSelect.
1132cdf0e10cSrcweir         mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
1133cdf0e10cSrcweir             SID_OBJECT_SELECT,
1134cdf0e10cSrcweir             SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
1135cdf0e10cSrcweir 
1136cdf0e10cSrcweir 		bReturn = true;
1137cdf0e10cSrcweir 	}
1138cdf0e10cSrcweir 
1139cdf0e10cSrcweir 	return bReturn;
1140cdf0e10cSrcweir }
1141cdf0e10cSrcweir 
1142cdf0e10cSrcweir } // end of namespace sd
1143