Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <com/sun/star/presentation/XPresentation2.hpp>
31 : : #include <com/sun/star/form/FormButtonType.hpp>
32 : : #include <com/sun/star/beans/XPropertySet.hpp>
33 : : #include <com/sun/star/i18n/TransliterationModules.hpp>
34 : : #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
35 : :
36 : : #include <comphelper/processfactory.hxx>
37 : :
38 : : #include "undo/undomanager.hxx"
39 : : #include <vcl/waitobj.hxx>
40 : : #include <svl/aeitem.hxx>
41 : : #include <editeng/editstat.hxx>
42 : : #include <vcl/msgbox.hxx>
43 : : #include <svl/urlbmk.hxx>
44 : : #include <svx/svdpagv.hxx>
45 : : #include <svx/fmshell.hxx>
46 : : #include <vcl/scrbar.hxx>
47 : : #include <svx/svdopath.hxx>
48 : : #include <svx/svdundo.hxx>
49 : : #include <svx/svdorect.hxx>
50 : : #include <svx/svdograf.hxx>
51 : : #include <svl/eitem.hxx>
52 : : #include <editeng/eeitem.hxx>
53 : : #include <sfx2/dispatch.hxx>
54 : : #include <sfx2/viewfrm.hxx>
55 : : #include <sfx2/request.hxx>
56 : : #include <svx/svxids.hrc>
57 : : #include <editeng/flditem.hxx>
58 : : #include <svx/ruler.hxx>
59 : : #include <svx/obj3d.hxx>
60 : : #include <svx/fmglob.hxx>
61 : : #include <svx/svdouno.hxx>
62 : : #include <svx/dataaccessdescriptor.hxx>
63 : : #include <tools/urlobj.hxx>
64 : : #include <svl/slstitm.hxx>
65 : : #include <sfx2/ipclient.hxx>
66 : : #include <toolkit/helper/vclunohelper.hxx>
67 : : #include <avmedia/mediawindow.hxx>
68 : : #include <svl/urihelper.hxx>
69 : : #include <sfx2/docfile.hxx>
70 : :
71 : : #include "DrawViewShell.hxx"
72 : : #include "slideshow.hxx"
73 : : #include "ViewShellImplementation.hxx"
74 : : #include "ViewShellHint.hxx"
75 : : #include "framework/FrameworkHelper.hxx"
76 : : #include "app.hrc"
77 : : #include "glob.hrc"
78 : : #include "strings.hrc"
79 : : #include "res_bmp.hrc"
80 : : #include "drawdoc.hxx"
81 : : #include "fusel.hxx"
82 : : #include "futext.hxx"
83 : : #include "fuconrec.hxx"
84 : : #include "fuconcs.hxx"
85 : : #include "fuconuno.hxx"
86 : : #include "fuconbez.hxx"
87 : : #include "fuediglu.hxx"
88 : : #include "fuconarc.hxx"
89 : : #include "fucon3d.hxx"
90 : : #include "sdresid.hxx"
91 : : #include "Outliner.hxx"
92 : : #include "PresentationViewShell.hxx"
93 : : #include "sdpage.hxx"
94 : : #include "FrameView.hxx"
95 : : #include "zoomlist.hxx"
96 : : #include "drawview.hxx"
97 : : #include "DrawDocShell.hxx"
98 : : #include "sdattr.hxx"
99 : : #include "ViewShellBase.hxx"
100 : : #include "ToolBarManager.hxx"
101 : : #include "anminfo.hxx"
102 : : #include "optsitem.hxx"
103 : : #include "Window.hxx"
104 : : #include "fuformatpaintbrush.hxx"
105 : :
106 : : using ::rtl::OUString;
107 : : using namespace ::com::sun::star;
108 : : using namespace ::com::sun::star::uno;
109 : : using namespace ::com::sun::star::presentation;
110 : :
111 : : namespace sd {
112 : :
113 : : #ifdef _MSC_VER
114 : : #pragma optimize ( "", off )
115 : : #endif
116 : :
117 : : /*************************************************************************
118 : : |*
119 : : |* Permanente Funktionen
120 : : |*
121 : : \************************************************************************/
122 : :
123 : 0 : void ImpAddPrintableCharactersToTextEdit(SfxRequest& rReq, ::sd::View* pView)
124 : : {
125 : : // evtl. feed characters to activated textedit
126 : 0 : const SfxItemSet* pSet = rReq.GetArgs();
127 : :
128 [ # # ]: 0 : if(pSet)
129 : : {
130 [ # # ]: 0 : String aInputString;
131 : :
132 [ # # ][ # # ]: 0 : if(SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR))
133 [ # # ][ # # ]: 0 : aInputString = ((SfxStringItem&)pSet->Get(SID_ATTR_CHAR)).GetValue();
134 : :
135 [ # # ]: 0 : if(aInputString.Len())
136 : : {
137 : 0 : OutlinerView* pOLV = pView->GetTextEditOutlinerView();
138 : :
139 [ # # ]: 0 : if(pOLV)
140 : : {
141 [ # # ]: 0 : for(sal_uInt16 a(0); a < aInputString.Len(); a++)
142 : : {
143 : 0 : sal_Char aChar = (sal_Char)aInputString.GetChar(a);
144 : 0 : KeyCode aKeyCode;
145 [ # # ]: 0 : KeyEvent aKeyEvent(aChar, aKeyCode);
146 : :
147 : : // add actual character
148 [ # # ]: 0 : pOLV->PostKeyEvent(aKeyEvent);
149 : : }
150 : : }
151 [ # # ]: 0 : }
152 : : }
153 : 0 : }
154 : :
155 : 130 : void DrawViewShell::FuPermanent(SfxRequest& rReq)
156 : : {
157 : : // Waehrend einer Native-Diashow wird nichts ausgefuehrt!
158 : :
159 [ - + ]: 130 : if (SlideShow::IsRunning(GetViewShellBase()))
160 : 0 : return;
161 : :
162 : 130 : sal_uInt16 nSId = rReq.GetSlot();
163 : :
164 [ # # ][ # # ]: 130 : if( HasCurrentFunction() &&
[ # # ][ # # ]
[ # # ][ - + ]
[ - + ]
165 : : ( nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE ||
166 : : nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL ) )
167 : : {
168 [ # # ]: 0 : FunctionReference xFunc( GetCurrentFunction() );
169 : :
170 [ # # ]: 0 : FuText* pFuText = dynamic_cast< FuText* >( xFunc.get() );
171 : :
172 [ # # ]: 0 : if( pFuText )
173 : : {
174 : 0 : pFuText->SetPermanent(sal_True);
175 [ # # ]: 0 : xFunc->ReceiveRequest( rReq );
176 : :
177 [ # # ]: 0 : MapSlot( nSId );
178 : :
179 [ # # ]: 0 : Invalidate();
180 : :
181 [ # # ]: 0 : Invalidate();
182 : :
183 : : // evtl. feed characters to activated textedit
184 [ # # ][ # # ]: 0 : if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit())
[ # # ][ # # ]
[ # # ]
185 [ # # ]: 0 : ImpAddPrintableCharactersToTextEdit(rReq, GetView());
186 : :
187 [ # # ]: 0 : rReq.Done();
188 : : return;
189 [ # # ][ # # ]: 0 : }
190 : : }
191 : :
192 : 130 : CheckLineTo (rReq);
193 : 130 : sal_uInt16 nOldSId = 0;
194 : 130 : sal_Bool bPermanent = sal_False;
195 : :
196 [ - + ]: 130 : if( !mpDrawView )
197 : 0 : return;
198 : :
199 [ - + ]: 130 : if(HasCurrentFunction())
200 : : {
201 [ # # ][ # # ]: 0 : if( (nSId == SID_FORMATPAINTBRUSH) && (GetCurrentFunction()->GetSlotID() == SID_TEXTEDIT) )
[ # # ][ # # ]
[ # # # # ]
202 : : {
203 : : // save text edit mode for format paintbrush!
204 [ # # ]: 0 : SetOldFunction( GetCurrentFunction() );
205 : : }
206 : : else
207 : : {
208 [ # # ][ # # ]: 0 : if(GetOldFunction() == GetCurrentFunction())
[ # # ]
209 : : {
210 [ # # ]: 0 : SetOldFunction(0);
211 : : }
212 : : }
213 : :
214 [ # # ][ # # ]: 0 : if ( nSId != SID_TEXTEDIT && nSId != SID_ATTR_CHAR && nSId != SID_TEXT_FITTOSIZE &&
[ # # ][ # # ]
[ # # ]
[ # # # # ]
[ # # ]
215 : : nSId != SID_ATTR_CHAR_VERTICAL && nSId != SID_TEXT_FITTOSIZE_VERTICAL &&
216 : : nSId != SID_FORMATPAINTBRUSH &&
217 : 0 : mpDrawView->IsTextEdit() )
218 : : {
219 : 0 : mpDrawView->SdrEndTextEdit();
220 : : }
221 : :
222 [ # # ]: 0 : if( HasCurrentFunction() )
223 : : {
224 : 0 : nOldSId = GetCurrentFunction()->GetSlotID();
225 : :
226 [ # # ][ # # ]: 0 : if (nOldSId == nSId ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
227 : : ((nOldSId == SID_TEXTEDIT || nOldSId == SID_ATTR_CHAR || nOldSId == SID_TEXT_FITTOSIZE ||
228 : : nOldSId == SID_ATTR_CHAR_VERTICAL || nOldSId == SID_TEXT_FITTOSIZE_VERTICAL) &&
229 : : (nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE ||
230 : : nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL )))
231 : : {
232 : 0 : bPermanent = sal_True;
233 : : }
234 : :
235 [ # # ]: 0 : GetCurrentFunction()->Deactivate();
236 : : }
237 : :
238 [ # # ]: 0 : SetCurrentFunction(0);
239 : :
240 : 0 : SfxBindings& rBind = GetViewFrame()->GetBindings();
241 : 0 : rBind.Invalidate(nOldSId);
242 : 0 : rBind.Update(nOldSId);
243 : : }
244 : :
245 : : // Slot wird gemapped (ToolboxImages/-Slots)
246 : 130 : MapSlot( nSId );
247 : :
248 [ - - - + : 130 : switch ( nSId )
- - - - -
- - - ]
249 : : {
250 : : case SID_TEXTEDIT: // BASIC ???
251 : : case SID_ATTR_CHAR:
252 : : case SID_ATTR_CHAR_VERTICAL:
253 : : case SID_TEXT_FITTOSIZE:
254 : : case SID_TEXT_FITTOSIZE_VERTICAL:
255 : : {
256 [ # # ]: 0 : SetCurrentFunction( FuText::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
257 [ # # ]: 0 : GetCurrentFunction()->DoExecute(rReq);
258 : :
259 : 0 : SfxBindings& rBindings = GetViewFrame()->GetBindings();
260 : 0 : rBindings.Invalidate( SID_ATTR_CHAR );
261 : 0 : rBindings.Invalidate( SID_ATTR_CHAR_VERTICAL );
262 : 0 : rBindings.Invalidate( SID_TEXT_FITTOSIZE );
263 : 0 : rBindings.Invalidate( SID_TEXT_FITTOSIZE_VERTICAL );
264 : :
265 : : // evtl. feed characters to activated textedit
266 [ # # ][ # # ]: 0 : if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit())
[ # # ][ # # ]
267 : 0 : ImpAddPrintableCharactersToTextEdit(rReq, GetView());
268 : :
269 : 0 : rReq.Done();
270 : : }
271 : 0 : break;
272 : :
273 : : case SID_FM_CREATE_CONTROL:
274 : : {
275 [ # # ]: 0 : SetCurrentFunction( FuConstructUnoControl::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
276 : 0 : rReq.Done();
277 : : }
278 : 0 : break;
279 : :
280 : : case SID_FM_CREATE_FIELDCONTROL:
281 : : {
282 : 0 : SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False );
283 : : DBG_ASSERT( pDescriptorItem, "DrawViewShell::FuPermanent(SID_FM_CREATE_FIELDCONTROL): invalid request args!" );
284 : :
285 [ # # ]: 0 : if(pDescriptorItem)
286 : : {
287 : : // get the form view
288 [ # # ][ # # ]: 0 : FmFormView* pFormView = PTR_CAST(FmFormView, mpDrawView);
289 [ # # ]: 0 : SdrPageView* pPageView = pFormView ? pFormView->GetSdrPageView() : NULL;
290 : :
291 [ # # ]: 0 : if(pPageView)
292 : : {
293 [ # # ]: 0 : ::svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue());
294 [ # # ]: 0 : SdrObject* pNewDBField = pFormView->CreateFieldControl(aDescriptor);
295 : :
296 [ # # ]: 0 : if(pNewDBField)
297 : : {
298 [ # # ][ # # ]: 0 : Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
[ # # ][ # # ]
299 [ # # ]: 0 : Point aObjPos(aVisArea.Center());
300 [ # # ][ # # ]: 0 : Size aObjSize(pNewDBField->GetLogicRect().GetSize());
301 : 0 : aObjPos.X() -= aObjSize.Width() / 2;
302 : 0 : aObjPos.Y() -= aObjSize.Height() / 2;
303 [ # # ]: 0 : Rectangle aNewObjectRectangle(aObjPos, aObjSize);
304 : :
305 [ # # ]: 0 : pNewDBField->SetLogicRect(aNewObjectRectangle);
306 : :
307 [ # # ]: 0 : GetView()->InsertObjectAtView(pNewDBField, *pPageView);
308 [ # # ]: 0 : }
309 : : }
310 : : }
311 : 0 : rReq.Done();
312 : : }
313 : 0 : break;
314 : :
315 : : case SID_OBJECT_SELECT:
316 : : case SID_OBJECT_ROTATE:
317 : : case SID_OBJECT_MIRROR:
318 : : case SID_OBJECT_CROP:
319 : : case SID_OBJECT_TRANSPARENCE:
320 : : case SID_OBJECT_GRADIENT:
321 : : case SID_OBJECT_SHEAR:
322 : : case SID_OBJECT_CROOK_ROTATE:
323 : : case SID_OBJECT_CROOK_SLANT:
324 : : case SID_OBJECT_CROOK_STRETCH:
325 : : case SID_CONVERT_TO_3D_LATHE:
326 : : {
327 : 130 : short nSlotId = rReq.GetSlot();
328 : :
329 [ - + ]: 130 : if( nSlotId == SID_OBJECT_ROTATE )
330 : : {
331 : : // togle rotation
332 [ # # ]: 0 : if( nOldSId == nSlotId )
333 : : {
334 : 0 : nSlotId = SID_OBJECT_SELECT;
335 : 0 : rReq.SetSlot( nSlotId );
336 : : }
337 : : }
338 : :
339 [ + - ][ + - ]: 130 : if (nSlotId == SID_OBJECT_CROOK_ROTATE ||
[ - + ]
340 : : nSlotId == SID_OBJECT_CROOK_SLANT ||
341 : : nSlotId == SID_OBJECT_CROOK_STRETCH)
342 : : {
343 [ # # # # ]: 0 : if ( mpDrawView->GetMarkedObjectList().GetMarkCount() > 0 &&
[ # # ]
344 : 0 : !mpDrawView->IsCrookAllowed( mpDrawView->IsCrookNoContortion() ) )
345 : : {
346 [ # # ]: 0 : if ( mpDrawView->IsPresObjSelected() )
347 : : {
348 : 0 : ::sd::Window* pWindow = GetActiveWindow();
349 [ # # ][ # # ]: 0 : InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
[ # # ][ # # ]
[ # # ]
350 : : }
351 [ # # ][ # # ]: 0 : else if ( QueryBox(GetActiveWindow(), WB_YES_NO,
352 : : String(SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) )
353 [ # # ][ # # ]: 0 : ).Execute() == RET_YES )
[ # # ][ # # ]
[ # # ]
354 : : {
355 : : // Implizite Wandlung in Bezier
356 [ # # ][ # # ]: 0 : WaitObject aWait( (Window*)GetActiveWindow() );
357 [ # # ][ # # ]: 0 : mpDrawView->ConvertMarkedToPathObj(sal_False);
358 : : }
359 : 0 : }
360 : : }
361 [ - + ]: 130 : else if (nSlotId == SID_OBJECT_SHEAR)
362 : : {
363 : 0 : sal_uLong i = 0;
364 : 0 : const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
365 : 0 : sal_uLong nMarkCnt = rMarkList.GetMarkCount();
366 : 0 : sal_Bool b3DObjMarked = sal_False;
367 : :
368 [ # # ][ # # ]: 0 : while (i < nMarkCnt && !b3DObjMarked)
[ # # ]
369 : : {
370 [ # # ]: 0 : if (rMarkList.GetMark(i)->GetMarkedSdrObj()->ISA(E3dObject))
371 : : {
372 : 0 : b3DObjMarked = sal_True;
373 : : }
374 : : else
375 : : {
376 : 0 : i++;
377 : : }
378 : : }
379 : :
380 [ # # ][ # # : 0 : if ( nMarkCnt > 0 && !b3DObjMarked &&
# # # # ]
[ # # ]
381 : 0 : (!mpDrawView->IsShearAllowed() || !mpDrawView->IsDistortAllowed()) )
382 : : {
383 [ # # ]: 0 : if ( mpDrawView->IsPresObjSelected() )
384 : : {
385 : 0 : ::sd::Window* pWindow = GetActiveWindow();
386 [ # # ][ # # ]: 0 : InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
[ # # ][ # # ]
[ # # ]
387 : : }
388 [ # # ][ # # ]: 0 : else if ( QueryBox(GetActiveWindow(), WB_YES_NO,
389 : : String(SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) )
390 [ # # ][ # # ]: 0 : ).Execute() == RET_YES )
[ # # ][ # # ]
[ # # ]
391 : : {
392 : : // Implizite Wandlung in Bezier
393 [ # # ][ # # ]: 0 : WaitObject aWait( (Window*)GetActiveWindow() );
394 [ # # ][ # # ]: 0 : mpDrawView->ConvertMarkedToPathObj(sal_False);
395 : : }
396 : : }
397 : : }
398 : :
399 [ + - ]: 130 : SetCurrentFunction( FuSelection::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
400 : 130 : rReq.Done();
401 : 130 : Invalidate( SID_OBJECT_SELECT );
402 : : }
403 : 130 : break;
404 : :
405 : : case SID_DRAW_LINE:
406 : : case SID_DRAW_XLINE:
407 : : case SID_DRAW_MEASURELINE:
408 : : case SID_LINE_ARROW_START:
409 : : case SID_LINE_ARROW_END:
410 : : case SID_LINE_ARROWS:
411 : : case SID_LINE_ARROW_CIRCLE:
412 : : case SID_LINE_CIRCLE_ARROW:
413 : : case SID_LINE_ARROW_SQUARE:
414 : : case SID_LINE_SQUARE_ARROW:
415 : :
416 : : case SID_DRAW_RECT:
417 : : case SID_DRAW_RECT_NOFILL:
418 : : case SID_DRAW_RECT_ROUND:
419 : : case SID_DRAW_RECT_ROUND_NOFILL:
420 : : case SID_DRAW_SQUARE:
421 : : case SID_DRAW_SQUARE_NOFILL:
422 : : case SID_DRAW_SQUARE_ROUND:
423 : : case SID_DRAW_SQUARE_ROUND_NOFILL:
424 : : case SID_DRAW_ELLIPSE:
425 : : case SID_DRAW_ELLIPSE_NOFILL:
426 : : case SID_DRAW_CIRCLE:
427 : : case SID_DRAW_CIRCLE_NOFILL:
428 : : case SID_DRAW_CAPTION:
429 : : case SID_DRAW_CAPTION_VERTICAL:
430 : : case SID_TOOL_CONNECTOR:
431 : : case SID_CONNECTOR_ARROW_START:
432 : : case SID_CONNECTOR_ARROW_END:
433 : : case SID_CONNECTOR_ARROWS:
434 : : case SID_CONNECTOR_CIRCLE_START:
435 : : case SID_CONNECTOR_CIRCLE_END:
436 : : case SID_CONNECTOR_CIRCLES:
437 : : case SID_CONNECTOR_LINE:
438 : : case SID_CONNECTOR_LINE_ARROW_START:
439 : : case SID_CONNECTOR_LINE_ARROW_END:
440 : : case SID_CONNECTOR_LINE_ARROWS:
441 : : case SID_CONNECTOR_LINE_CIRCLE_START:
442 : : case SID_CONNECTOR_LINE_CIRCLE_END:
443 : : case SID_CONNECTOR_LINE_CIRCLES:
444 : : case SID_CONNECTOR_CURVE:
445 : : case SID_CONNECTOR_CURVE_ARROW_START:
446 : : case SID_CONNECTOR_CURVE_ARROW_END:
447 : : case SID_CONNECTOR_CURVE_ARROWS:
448 : : case SID_CONNECTOR_CURVE_CIRCLE_START:
449 : : case SID_CONNECTOR_CURVE_CIRCLE_END:
450 : : case SID_CONNECTOR_CURVE_CIRCLES:
451 : : case SID_CONNECTOR_LINES:
452 : : case SID_CONNECTOR_LINES_ARROW_START:
453 : : case SID_CONNECTOR_LINES_ARROW_END:
454 : : case SID_CONNECTOR_LINES_ARROWS:
455 : : case SID_CONNECTOR_LINES_CIRCLE_START:
456 : : case SID_CONNECTOR_LINES_CIRCLE_END:
457 : : case SID_CONNECTOR_LINES_CIRCLES:
458 : : {
459 [ # # ]: 0 : SetCurrentFunction( FuConstructRectangle::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
460 : 0 : rReq.Done();
461 : : }
462 : 0 : break;
463 : : case SID_DRAW_POLYGON:
464 : : case SID_DRAW_POLYGON_NOFILL:
465 : : case SID_DRAW_XPOLYGON:
466 : : case SID_DRAW_XPOLYGON_NOFILL:
467 : : case SID_DRAW_FREELINE:
468 : : case SID_DRAW_FREELINE_NOFILL:
469 : : case SID_DRAW_BEZIER_FILL: // BASIC
470 : : case SID_DRAW_BEZIER_NOFILL: // BASIC
471 : : {
472 [ # # ]: 0 : SetCurrentFunction( FuConstructBezierPolygon::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent) );
473 : 0 : rReq.Done();
474 : : }
475 : 0 : break;
476 : :
477 : : case SID_GLUE_EDITMODE:
478 : : {
479 [ # # ]: 0 : if (nOldSId != SID_GLUE_EDITMODE)
480 : : {
481 [ # # ]: 0 : SetCurrentFunction( FuEditGluePoints::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
482 : : }
483 : : else
484 : : {
485 : 0 : GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
486 : : }
487 : :
488 : 0 : rReq.Done();
489 : : }
490 : 0 : break;
491 : :
492 : : case SID_DRAW_ARC:
493 : : case SID_DRAW_CIRCLEARC:
494 : : case SID_DRAW_PIE:
495 : : case SID_DRAW_PIE_NOFILL:
496 : : case SID_DRAW_CIRCLEPIE:
497 : : case SID_DRAW_CIRCLEPIE_NOFILL:
498 : : case SID_DRAW_ELLIPSECUT:
499 : : case SID_DRAW_ELLIPSECUT_NOFILL:
500 : : case SID_DRAW_CIRCLECUT:
501 : : case SID_DRAW_CIRCLECUT_NOFILL:
502 : : {
503 [ # # ]: 0 : SetCurrentFunction( FuConstructArc::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent) );
504 : 0 : rReq.Done();
505 : : }
506 : 0 : break;
507 : :
508 : : case SID_3D_CUBE:
509 : : case SID_3D_SHELL:
510 : : case SID_3D_SPHERE:
511 : : case SID_3D_TORUS:
512 : : case SID_3D_HALF_SPHERE:
513 : : case SID_3D_CYLINDER:
514 : : case SID_3D_CONE:
515 : : case SID_3D_PYRAMID:
516 : : {
517 [ # # ]: 0 : SetCurrentFunction( FuConstruct3dObject::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
518 : 0 : rReq.Done();
519 : : }
520 : 0 : break;
521 : :
522 : : case SID_DRAWTBX_CS_BASIC :
523 : : case SID_DRAWTBX_CS_SYMBOL :
524 : : case SID_DRAWTBX_CS_ARROW :
525 : : case SID_DRAWTBX_CS_FLOWCHART :
526 : : case SID_DRAWTBX_CS_CALLOUT :
527 : : case SID_DRAWTBX_CS_STAR :
528 : : case SID_DRAW_CS_ID :
529 : : {
530 [ # # ]: 0 : SetCurrentFunction( FuConstructCustomShape::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) );
531 : 0 : rReq.Done();
532 : :
533 [ # # ]: 0 : if ( nSId != SID_DRAW_CS_ID )
534 : : {
535 : 0 : SfxBindings& rBind = GetViewFrame()->GetBindings();
536 : 0 : rBind.Invalidate( nSId );
537 : 0 : rBind.Update( nSId );
538 : : }
539 : : }
540 : 0 : break;
541 : :
542 : : case SID_FORMATPAINTBRUSH:
543 : : {
544 [ # # ]: 0 : SetCurrentFunction( FuFormatPaintBrush::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
545 : 0 : rReq.Done();
546 : 0 : SfxBindings& rBind = GetViewFrame()->GetBindings();
547 : 0 : rBind.Invalidate( nSId );
548 : 0 : rBind.Update( nSId );
549 : 0 : break;
550 : : }
551 : :
552 : : default:
553 : 0 : break;
554 : : }
555 : :
556 [ - + ]: 130 : if(HasOldFunction())
557 : : {
558 : 0 : sal_uInt16 nSlotId = GetOldFunction()->GetSlotID();
559 : :
560 [ # # ]: 0 : GetOldFunction()->Deactivate();
561 [ # # ]: 0 : SetOldFunction(0);
562 : :
563 : 0 : SfxBindings& rBind = GetViewFrame()->GetBindings();
564 : 0 : rBind.Invalidate( nSlotId );
565 : 0 : rBind.Update( nSlotId );
566 : : }
567 : :
568 [ + - ]: 130 : if(HasCurrentFunction())
569 : : {
570 [ + - ]: 130 : GetCurrentFunction()->Activate();
571 [ + - ]: 130 : SetOldFunction( GetCurrentFunction() );
572 : :
573 [ + - ]: 130 : SetHelpId( GetCurrentFunction()->GetSlotID() );
574 : : }
575 : :
576 : : // Shell wird invalidiert, schneller als einzeln (laut MI)
577 : : // Jetzt explizit der letzte Slot incl. Update()
578 : 130 : Invalidate();
579 : :
580 : : // CTRL-SID_OBJECT_SELECT -> select first draw object if none is selected yet
581 [ + - ][ - + ]: 130 : if(SID_OBJECT_SELECT == nSId && HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
[ - + ][ + - ]
582 : : {
583 [ # # ]: 0 : if(!GetView()->AreObjectsMarked())
584 : : {
585 : : // select first object
586 : 0 : GetView()->UnmarkAllObj();
587 : 0 : GetView()->MarkNextObj(sal_True);
588 : :
589 : : // ...and make it visible
590 [ # # ]: 0 : if(GetView()->AreObjectsMarked())
591 : 0 : GetView()->MakeVisible(GetView()->GetAllMarkedRect(), *GetActiveWindow());
592 : : }
593 : : }
594 : :
595 : : // with qualifier construct directly
596 [ + - ][ - + ]: 130 : if(HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
[ - + ]
597 : : {
598 : : // get SdOptions
599 [ # # ][ # # ]: 0 : SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
[ # # ]
600 [ # # ]: 0 : sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth());
601 [ # # ]: 0 : sal_uInt32 nDefaultObjectSizeHeight(pOptions->GetDefaultObjectSizeHeight());
602 : :
603 : : // calc position and size
604 [ # # ][ # # ]: 0 : Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
[ # # ][ # # ]
605 [ # # ]: 0 : Point aPagePos = aVisArea.Center();
606 : 0 : aPagePos.X() -= nDefaultObjectSizeWidth / 2;
607 : 0 : aPagePos.Y() -= nDefaultObjectSizeHeight / 2;
608 [ # # ]: 0 : Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
609 : 0 : SdrPageView* pPageView = mpDrawView->GetSdrPageView();
610 : :
611 [ # # ]: 0 : if(pPageView)
612 : : {
613 : : // create the default object
614 [ # # ][ # # ]: 0 : SdrObject* pObj = GetCurrentFunction()->CreateDefaultObject(nSId, aNewObjectRectangle);
[ # # ]
615 : :
616 [ # # ]: 0 : if(pObj)
617 : : {
618 : : // insert into page
619 [ # # ]: 0 : GetView()->InsertObjectAtView(pObj, *pPageView);
620 : :
621 : : // Now that pFuActual has done what it was created for we
622 : : // can switch on the edit mode for callout objects.
623 [ # # ]: 0 : switch (nSId)
624 : : {
625 : : case SID_DRAW_CAPTION:
626 : : case SID_DRAW_CAPTION_VERTICAL:
627 : : {
628 : : // Make FuText the current function.
629 [ # # ]: 0 : SfxUInt16Item aItem (SID_TEXTEDIT, 1);
630 : : GetViewFrame()->GetDispatcher()->
631 : : Execute(SID_TEXTEDIT, SFX_CALLMODE_SYNCHRON |
632 [ # # ][ # # ]: 0 : SFX_CALLMODE_RECORD, &aItem, 0L);
633 : : // Put text object into edit mode.
634 [ # # ]: 0 : GetView()->SdrBeginTextEdit(static_cast<SdrTextObj*>(pObj), pPageView);
635 [ # # ]: 130 : break;
636 : : }
637 : : }
638 : : }
639 : : }
640 : : }
641 : : }
642 : :
643 : : //////////////////////////////////////////////////////////////////////////////
644 : : // service routine for Undo/Redo implementation
645 : : extern SfxUndoManager* ImpGetUndoManagerFromViewShell(DrawViewShell& rDViewShell);
646 : :
647 : : /*************************************************************************
648 : : |*
649 : : |* SfxRequests fuer Support-Funktionen
650 : : |*
651 : : \************************************************************************/
652 : :
653 : 463 : void DrawViewShell::FuSupport(SfxRequest& rReq)
654 : : {
655 [ - + ][ # # ]: 463 : if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs())
[ - + ]
656 : 0 : GetDocSh()->SetStyleFamily(((SfxUInt16Item&)rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue());
657 : :
658 : : // Waehrend einer Native-Diashow wird nichts ausgefuehrt!
659 [ - + # # : 463 : if(SlideShow::IsRunning(GetViewShellBase()) &&
# # ][ - + ]
660 : 0 : (rReq.GetSlot() != SID_PRESENTATION_END &&
661 : 0 : rReq.GetSlot() != SID_SIZE_PAGE))
662 : 0 : return;
663 : :
664 : 463 : CheckLineTo (rReq);
665 : :
666 [ - + ]: 463 : if( !mpDrawView )
667 : 0 : return;
668 : :
669 : 463 : sal_uInt16 nSId = rReq.GetSlot();
670 : :
671 : : // Slot wird evtl. gemapped (ToolboxImages/-Slots)
672 : 463 : MapSlot( nSId );
673 : :
674 [ - - - - : 463 : switch ( nSId )
- - - - -
- - - - -
- - + - -
- - - - -
- - - - +
+ - ]
675 : : {
676 : : case SID_CLEAR_UNDO_STACK:
677 : : {
678 : 0 : GetDocSh()->ClearUndoBuffer();
679 : 0 : rReq.Ignore ();
680 : : }
681 : 0 : break;
682 : :
683 : : // Slots der ToolboxController gemapped ausfuehren
684 : : case SID_OBJECT_CHOOSE_MODE:
685 : : case SID_POSITION:
686 : : case SID_OBJECT_ALIGN:
687 : : case SID_ZOOM_TOOLBOX:
688 : : case SID_DRAWTBX_TEXT:
689 : : case SID_DRAWTBX_RECTANGLES:
690 : : case SID_DRAWTBX_ELLIPSES:
691 : : case SID_DRAWTBX_LINES:
692 : : case SID_DRAWTBX_ARROWS:
693 : : case SID_DRAWTBX_3D_OBJECTS:
694 : : case SID_DRAWTBX_CONNECTORS:
695 : : case SID_DRAWTBX_INSERT:
696 : : {
697 : 0 : sal_uInt16 nMappedSlot = GetMappedSlot( nSId );
698 [ # # ]: 0 : if( nMappedSlot > 0 )
699 : : {
700 [ # # ][ # # ]: 0 : SfxRequest aReq( nMappedSlot, 0, GetDoc()->GetItemPool() );
701 [ # # ][ # # ]: 0 : ExecuteSlot( aReq );
702 : : }
703 : : }
704 : 0 : break;
705 : :
706 : : case SID_PRESENTATION:
707 : : case SID_REHEARSE_TIMINGS:
708 : : {
709 [ # # ][ # # ]: 0 : Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
710 [ # # ]: 0 : if( xPresentation.is() )
711 : : {
712 [ # # ]: 0 : if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
713 [ # # ][ # # ]: 0 : xPresentation->start();
714 : : else
715 [ # # ][ # # ]: 0 : xPresentation->rehearseTimings();
716 : : }
717 [ # # ]: 0 : rReq.Ignore ();
718 : : }
719 : 0 : break;
720 : :
721 : : case SID_PRESENTATION_END:
722 : : {
723 : 0 : StopSlideShow(true);
724 : :
725 : 0 : rReq.Ignore ();
726 : : }
727 : 0 : break;
728 : :
729 : : case SID_BEZIER_EDIT:
730 : : {
731 : 0 : mpDrawView->SetFrameDragSingles(!mpDrawView->IsFrameDragSingles());
732 : :
733 : : /******************************************************************
734 : : * ObjectBar einschalten
735 : : ******************************************************************/
736 [ # # ][ # # ]: 0 : if( dynamic_cast< FuSelection* >( GetCurrentFunction().get() ) || dynamic_cast< FuConstructBezierPolygon* >( GetCurrentFunction().get() ) )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # # #
# # ][ # # ]
737 : : {
738 : : // Tell the tool bar manager about the context change.
739 [ # # ]: 0 : GetViewShellBase().GetToolBarManager()->SelectionHasChanged(*this,*mpDrawView);
740 : : }
741 : :
742 : 0 : Invalidate(SID_BEZIER_EDIT);
743 : 0 : rReq.Ignore();
744 : : }
745 : 0 : break;
746 : :
747 : : case SID_OBJECT_CLOSE:
748 : : {
749 : 0 : const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
750 [ # # ][ # # ]: 0 : if ( rMarkList.GetMark(0) && !mpDrawView->IsAction() )
[ # # ]
751 : : {
752 : 0 : SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetMarkedSdrObj();
753 : 0 : const bool bUndo = mpDrawView->IsUndoEnabled();
754 [ # # ]: 0 : if( bUndo )
755 [ # # ][ # # ]: 0 : mpDrawView->BegUndo(String(SdResId(STR_UNDO_BEZCLOSE)));
[ # # ]
756 : :
757 : 0 : mpDrawView->UnmarkAllPoints();
758 : :
759 [ # # ]: 0 : if( bUndo )
760 [ # # ]: 0 : mpDrawView->AddUndo(new SdrUndoGeoObj(*pPathObj));
761 : :
762 : 0 : pPathObj->ToggleClosed();
763 : :
764 [ # # ]: 0 : if( bUndo )
765 : 0 : mpDrawView->EndUndo();
766 : : }
767 : 0 : rReq.Done();
768 : : }
769 : 0 : break;
770 : :
771 : : case SID_CUT:
772 : : {
773 [ # # ]: 0 : if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
774 : : {
775 : 0 : ::sd::Window* pWindow = GetActiveWindow();
776 [ # # ][ # # ]: 0 : InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
[ # # ][ # # ]
[ # # ]
777 : : }
778 : : else
779 : : {
780 [ # # ]: 0 : if(HasCurrentFunction())
781 : : {
782 [ # # ]: 0 : GetCurrentFunction()->DoCut();
783 : : }
784 [ # # ]: 0 : else if(mpDrawView)
785 : : {
786 : 0 : mpDrawView->DoCut();
787 : : }
788 : : }
789 : 0 : rReq.Ignore ();
790 : : }
791 : 0 : break;
792 : :
793 : : case SID_COPY:
794 : : {
795 [ # # ]: 0 : if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
796 : : {
797 : 0 : ::sd::Window* pWindow = GetActiveWindow();
798 [ # # ][ # # ]: 0 : InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
[ # # ][ # # ]
[ # # ]
799 : : }
800 : : else
801 : : {
802 [ # # ]: 0 : if(HasCurrentFunction())
803 : : {
804 [ # # ]: 0 : GetCurrentFunction()->DoCopy();
805 : : }
806 [ # # ]: 0 : else if( mpDrawView )
807 : : {
808 : 0 : mpDrawView->DoCopy();
809 : : }
810 : : }
811 : 0 : rReq.Ignore ();
812 : : }
813 : 0 : break;
814 : :
815 : : case SID_PASTE:
816 : : {
817 [ # # ][ # # ]: 0 : WaitObject aWait( (Window*)GetActiveWindow() );
818 : :
819 [ # # ][ # # ]: 0 : if(HasCurrentFunction())
820 : : {
821 [ # # ][ # # ]: 0 : GetCurrentFunction()->DoPaste();
[ # # ]
822 : : }
823 [ # # ]: 0 : else if(mpDrawView)
824 : : {
825 [ # # ]: 0 : mpDrawView->DoPaste();
826 : : }
827 : :
828 [ # # ][ # # ]: 0 : rReq.Ignore ();
829 : : }
830 : 0 : break;
831 : :
832 : : case SID_CLIPBOARD_FORMAT_ITEMS:
833 : : {
834 [ # # ][ # # ]: 0 : WaitObject aWait( (Window*)GetActiveWindow() );
835 [ # # ][ # # ]: 0 : TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) );
836 : 0 : const SfxItemSet* pReqArgs = rReq.GetArgs();
837 : 0 : sal_uInt32 nFormat = 0;
838 : :
839 [ # # ]: 0 : if( pReqArgs )
840 : : {
841 [ # # ][ # # ]: 0 : SFX_REQUEST_ARG( rReq, pIsActive, SfxUInt32Item, SID_CLIPBOARD_FORMAT_ITEMS, sal_False );
842 : 0 : nFormat = pIsActive->GetValue();
843 : : }
844 : :
845 : :
846 [ # # ][ # # ]: 0 : if( nFormat && aDataHelper.GetTransferable().is() )
[ # # ]
847 : : {
848 : 0 : sal_Int8 nAction = DND_ACTION_COPY;
849 : :
850 [ # # ]: 0 : if( !mpDrawView->InsertData( aDataHelper,
851 [ # # ][ # # ]: 0 : GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ),
[ # # ][ # # ]
852 [ # # ][ # # ]: 0 : nAction, sal_False, nFormat ) )
853 : : {
854 [ # # ]: 0 : INetBookmark aINetBookmark( aEmptyStr, aEmptyStr );
855 : :
856 [ # # ][ # # ]: 0 : if( ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) &&
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
857 [ # # ]: 0 : aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) ) ||
858 [ # # ]: 0 : ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) &&
859 [ # # ]: 0 : aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, aINetBookmark ) ) ||
860 [ # # ]: 0 : ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) &&
861 [ # # ]: 0 : aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
862 : : {
863 [ # # ]: 0 : InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL );
864 [ # # ]: 0 : }
865 : : }
866 [ # # ][ # # ]: 0 : }
867 : : }
868 : 0 : break;
869 : :
870 : : case SID_DELETE:
871 : : {
872 [ # # ]: 0 : if ( mpDrawView->IsTextEdit() )
873 : : {
874 : 0 : OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
875 : :
876 [ # # ]: 0 : if (pOLV)
877 : : {
878 : 0 : KeyCode aKCode(KEY_DELETE);
879 [ # # ]: 0 : KeyEvent aKEvt( 0, aKCode);
880 [ # # ]: 0 : pOLV->PostKeyEvent(aKEvt);
881 : : }
882 : : }
883 [ # # ]: 0 : else if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
884 : : {
885 : 0 : ::sd::Window* pWindow = GetActiveWindow();
886 [ # # ][ # # ]: 0 : InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
[ # # ][ # # ]
[ # # ]
887 : : }
888 : : else
889 : : {
890 : 0 : KeyCode aKCode(KEY_DELETE);
891 [ # # ]: 0 : KeyEvent aKEvt( 0, aKCode);
892 : :
893 [ # # ][ # # ]: 0 : bool bConsumed = mpDrawView && mpDrawView->getSmartTags().KeyInput( aKEvt );
[ # # ]
894 : :
895 [ # # ][ # # ]: 0 : if( !bConsumed && HasCurrentFunction() )
[ # # ][ # # ]
896 [ # # ][ # # ]: 0 : bConsumed = GetCurrentFunction()->KeyInput(aKEvt);
[ # # ]
897 : :
898 [ # # ][ # # ]: 0 : if( !bConsumed && mpDrawView )
899 [ # # ]: 0 : mpDrawView->DeleteMarked();
900 : : }
901 : 0 : rReq.Ignore ();
902 : : }
903 : 0 : break;
904 : :
905 : : case SID_NOTESMODE:
906 : : case SID_HANDOUTMODE:
907 : : // AutoLayouts have to be ready.
908 : 0 : GetDoc()->StopWorkStartupDelay();
909 : : // Fall through to following case statements.
910 : :
911 : : case SID_DRAWINGMODE:
912 : : case SID_DIAMODE:
913 : : case SID_OUTLINEMODE:
914 : : // Let the sub-shell manager handle the slot handling.
915 : 0 : framework::FrameworkHelper::Instance(GetViewShellBase())->HandleModeChangeSlot(
916 : : nSId,
917 [ # # ]: 0 : rReq);
918 : 0 : rReq.Ignore ();
919 : 0 : break;
920 : :
921 : : case SID_MASTERPAGE: // BASIC
922 : : case SID_SLIDE_MASTERPAGE: // BASIC
923 : : case SID_TITLE_MASTERPAGE: // BASIC
924 : : case SID_NOTES_MASTERPAGE: // BASIC
925 : : case SID_HANDOUT_MASTERPAGE: // BASIC
926 : : {
927 : : // AutoLayouts muessen fertig sein
928 : 0 : GetDoc()->StopWorkStartupDelay();
929 : :
930 : 0 : const SfxItemSet* pReqArgs = rReq.GetArgs();
931 : :
932 [ # # ]: 0 : if ( pReqArgs )
933 : : {
934 : 0 : SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_MASTERPAGE, sal_False);
935 : 0 : mbIsLayerModeActive = pIsActive->GetValue ();
936 : : }
937 : :
938 : : Broadcast (
939 [ # # ]: 0 : ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
940 : :
941 [ # # ][ # # ]: 0 : if (nSId == SID_MASTERPAGE ||
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
942 : : (nSId == SID_SLIDE_MASTERPAGE && mePageKind == PK_STANDARD) ||
943 : : (nSId == SID_TITLE_MASTERPAGE && mePageKind == PK_STANDARD) ||
944 : : (nSId == SID_NOTES_MASTERPAGE && mePageKind == PK_NOTES) ||
945 : : (nSId == SID_HANDOUT_MASTERPAGE && mePageKind == PK_HANDOUT))
946 : : {
947 [ # # ][ # # ]: 0 : if (nSId == SID_TITLE_MASTERPAGE ||
948 : : nSId == SID_SLIDE_MASTERPAGE)
949 : : {
950 : : // Gibt es eine Seite mit dem AutoLayout "Titel"?
951 : 0 : sal_Bool bFound = sal_False;
952 : 0 : sal_uInt16 i = 0;
953 : 0 : sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
954 : :
955 [ # # ][ # # ]: 0 : while (i < nCount && !bFound)
[ # # ]
956 : : {
957 : 0 : SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD);
958 : :
959 [ # # ][ # # ]: 0 : if (nSId == SID_TITLE_MASTERPAGE && pPage->GetAutoLayout() == AUTOLAYOUT_TITLE)
[ # # ]
960 : : {
961 : 0 : bFound = sal_True;
962 : 0 : SwitchPage((pPage->GetPageNum() - 1) / 2);
963 : : }
964 [ # # ][ # # ]: 0 : else if (nSId == SID_SLIDE_MASTERPAGE && pPage->GetAutoLayout() != AUTOLAYOUT_TITLE)
[ # # ]
965 : : {
966 : 0 : bFound = sal_True;
967 : 0 : SwitchPage((pPage->GetPageNum() - 1) / 2);
968 : : }
969 : :
970 : 0 : i++;
971 : : }
972 : : }
973 : :
974 : : // Default-Layer der MasterPage einschalten
975 [ # # ][ # # ]: 0 : mpDrawView->SetActiveLayer( String( SdResId(STR_LAYER_BCKGRNDOBJ) ) );
[ # # ]
976 : :
977 : 0 : ChangeEditMode(EM_MASTERPAGE, mbIsLayerModeActive);
978 : :
979 [ # # ]: 0 : if(HasCurrentFunction(SID_BEZIER_EDIT))
980 : 0 : GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
981 : : }
982 : : else
983 : : {
984 : : // Switch to requested ViewShell.
985 : 0 : ::OUString sRequestedView;
986 : : PageKind ePageKind;
987 [ # # # ]: 0 : switch (nSId)
988 : : {
989 : : case SID_SLIDE_MASTERPAGE:
990 : : case SID_TITLE_MASTERPAGE:
991 : : default:
992 : 0 : sRequestedView = framework::FrameworkHelper::msImpressViewURL;
993 : 0 : ePageKind = PK_STANDARD;
994 : 0 : break;
995 : :
996 : : case SID_NOTES_MASTERPAGE:
997 : 0 : sRequestedView = framework::FrameworkHelper::msNotesViewURL;
998 : 0 : ePageKind = PK_NOTES;
999 : 0 : break;
1000 : :
1001 : : case SID_HANDOUT_MASTERPAGE:
1002 : 0 : sRequestedView = framework::FrameworkHelper::msHandoutViewURL;
1003 : 0 : ePageKind = PK_HANDOUT;
1004 : 0 : break;
1005 : : }
1006 : :
1007 [ # # ]: 0 : mpFrameView->SetViewShEditMode(EM_MASTERPAGE, ePageKind);
1008 : 0 : mpFrameView->SetLayerMode(mbIsLayerModeActive);
1009 [ # # ]: 0 : framework::FrameworkHelper::Instance(GetViewShellBase())->RequestView(
1010 : : sRequestedView,
1011 [ # # ][ # # ]: 0 : framework::FrameworkHelper::msCenterPaneURL);
[ # # ]
1012 : : }
1013 : : Broadcast (
1014 [ # # ]: 0 : ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
1015 : :
1016 : 0 : InvalidateWindows();
1017 : 0 : Invalidate();
1018 : :
1019 : 0 : rReq.Done();
1020 : : }
1021 : 0 : break;
1022 : :
1023 : :
1024 : : case SID_CLOSE_MASTER_VIEW:
1025 : : {
1026 : : Broadcast (
1027 [ # # ]: 0 : ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
1028 : :
1029 : : // Switch page back to the first one. Not doing so leads to a
1030 : : // crash. This seems to be some bug in the edit mode switching
1031 : : // and page switching methods.
1032 : 0 : SwitchPage (0);
1033 : 0 : ChangeEditMode(EM_PAGE, IsLayerModeActive());
1034 : : Broadcast (
1035 [ # # ]: 0 : ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
1036 : :
1037 [ # # ]: 0 : if(HasCurrentFunction(SID_BEZIER_EDIT))
1038 : : {
1039 : : GetViewFrame()->GetDispatcher()->Execute(
1040 : : SID_OBJECT_SELECT,
1041 : 0 : SFX_CALLMODE_ASYNCHRON);
1042 : : }
1043 : :
1044 : :
1045 : 0 : rReq.Done();
1046 : : }
1047 : 0 : break;
1048 : :
1049 : :
1050 : : case SID_RULER:
1051 : : {
1052 : 0 : const SfxItemSet* pReqArgs = rReq.GetArgs();
1053 : :
1054 : : // Remember old ruler state
1055 : 0 : sal_Bool bOldHasRuler(HasRuler());
1056 : :
1057 [ # # ]: 0 : if ( pReqArgs )
1058 : : {
1059 : 0 : SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_RULER, sal_False);
1060 : 0 : SetRuler (pIsActive->GetValue ());
1061 : : }
1062 : 0 : else SetRuler (!HasRuler());
1063 : :
1064 : : // Did ruler state change? Tell that to SdOptions, too.
1065 : 0 : sal_Bool bHasRuler(HasRuler());
1066 : :
1067 [ # # ]: 0 : if(bOldHasRuler != bHasRuler)
1068 : : {
1069 : 0 : SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
1070 : :
1071 [ # # ][ # # ]: 0 : if(pOptions && pOptions->IsRulerVisible() != bHasRuler)
[ # # ]
1072 : : {
1073 : 0 : pOptions->SetRulerVisible(bHasRuler);
1074 : : }
1075 : : }
1076 : :
1077 : 0 : Invalidate (SID_RULER);
1078 : 0 : Resize();
1079 : 0 : rReq.Done ();
1080 : : }
1081 : 0 : break;
1082 : :
1083 : : case SID_SIZE_PAGE:
1084 : : case SID_SIZE_PAGE_WIDTH: // BASIC
1085 : : {
1086 : 447 : mbZoomOnPage = ( rReq.GetSlot() == SID_SIZE_PAGE );
1087 : :
1088 : 447 : SdrPageView* pPageView = mpDrawView->GetSdrPageView();
1089 : :
1090 [ + - ]: 447 : if ( pPageView )
1091 : : {
1092 : 447 : Point aPagePos(0, 0); // = pPageView->GetOffset();
1093 [ + - ]: 447 : Size aPageSize = pPageView->GetPage()->GetSize();
1094 : :
1095 : 447 : aPagePos.X() += aPageSize.Width() / 2;
1096 : 447 : aPageSize.Width() = (long) (aPageSize.Width() * 1.03);
1097 : :
1098 [ + - ]: 447 : if( rReq.GetSlot() == SID_SIZE_PAGE )
1099 : : {
1100 : 447 : aPagePos.Y() += aPageSize.Height() / 2;
1101 : 447 : aPageSize.Height() = (long) (aPageSize.Height() * 1.03);
1102 : 447 : aPagePos.Y() -= aPageSize.Height() / 2;
1103 : : }
1104 : : else
1105 : : {
1106 [ # # ][ # # ]: 0 : Point aPt = GetActiveWindow()->PixelToLogic( Point( 0, GetActiveWindow()->GetSizePixel().Height() / 2 ) );
[ # # ][ # # ]
1107 : 0 : aPagePos.Y() += aPt.Y();
1108 : 0 : aPageSize.Height() = 2;
1109 : : }
1110 : :
1111 : 447 : aPagePos.X() -= aPageSize.Width() / 2;
1112 : :
1113 [ + - ][ + - ]: 447 : SetZoomRect( Rectangle( aPagePos, aPageSize ) );
1114 : :
1115 [ + - ]: 447 : Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1116 [ + - ][ + - ]: 894 : GetActiveWindow()->GetOutputSizePixel()) );
[ + - ]
1117 [ + - ]: 447 : mpZoomList->InsertZoomRect(aVisAreaWin);
1118 : : }
1119 : 447 : Invalidate( SID_ZOOM_IN );
1120 : 447 : Invalidate( SID_ZOOM_OUT );
1121 : 447 : Invalidate( SID_ZOOM_PANNING );
1122 : 447 : Invalidate( SID_ZOOM_TOOLBOX );
1123 : 447 : rReq.Done ();
1124 : : }
1125 : 447 : break;
1126 : :
1127 : : case SID_SIZE_REAL: // BASIC
1128 : : {
1129 : 0 : mbZoomOnPage = sal_False;
1130 [ # # ]: 0 : SetZoom( 100 );
1131 [ # # ]: 0 : Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1132 [ # # ][ # # ]: 0 : GetActiveWindow()->GetOutputSizePixel()) );
[ # # ]
1133 [ # # ]: 0 : mpZoomList->InsertZoomRect(aVisAreaWin);
1134 [ # # ]: 0 : Invalidate( SID_ZOOM_IN );
1135 [ # # ]: 0 : Invalidate( SID_ZOOM_OUT );
1136 [ # # ]: 0 : Invalidate( SID_ZOOM_PANNING );
1137 [ # # ]: 0 : Invalidate( SID_ZOOM_TOOLBOX );
1138 [ # # ]: 0 : rReq.Done ();
1139 : : }
1140 : 0 : break;
1141 : :
1142 : : case SID_ZOOM_IN: // BASIC
1143 : : {
1144 : 0 : mbZoomOnPage = sal_False;
1145 [ # # ][ # # ]: 0 : SetZoom( Max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) );
[ # # ][ # # ]
[ # # ]
1146 [ # # ]: 0 : Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1147 [ # # ][ # # ]: 0 : GetActiveWindow()->GetOutputSizePixel()) );
[ # # ]
1148 [ # # ]: 0 : mpZoomList->InsertZoomRect(aVisAreaWin);
1149 [ # # ]: 0 : Invalidate( SID_ZOOM_IN );
1150 [ # # ]: 0 : Invalidate( SID_ZOOM_OUT );
1151 [ # # ]: 0 : Invalidate( SID_ZOOM_PANNING );
1152 [ # # ]: 0 : Invalidate( SID_ZOOM_TOOLBOX );
1153 [ # # ]: 0 : rReq.Done ();
1154 : : }
1155 : 0 : break;
1156 : :
1157 : : case SID_SIZE_VISAREA:
1158 : : {
1159 : 0 : Rectangle aVisArea = mpFrameView->GetVisArea();
1160 [ # # ]: 0 : Size aVisAreaSize = aVisArea.GetSize();
1161 : :
1162 [ # # ][ # # ]: 0 : if (aVisAreaSize.Height()!=0 && aVisAreaSize.Width()!=0)
[ # # ]
1163 : : {
1164 : 0 : mbZoomOnPage = sal_False;
1165 [ # # ]: 0 : SetZoomRect(aVisArea);
1166 [ # # ]: 0 : Invalidate( SID_ZOOM_IN );
1167 [ # # ]: 0 : Invalidate( SID_ZOOM_OUT );
1168 [ # # ]: 0 : Invalidate( SID_ZOOM_PANNING );
1169 [ # # ]: 0 : Invalidate( SID_ZOOM_TOOLBOX );
1170 : : }
1171 [ # # ]: 0 : rReq.Done ();
1172 : : }
1173 : 0 : break;
1174 : :
1175 : : // Namensverwirrung: SID_SIZE_OPTIMAL -> Zoom auf selektierte Objekte
1176 : : // --> Wird als Objektzoom im Programm angeboten
1177 : : case SID_SIZE_OPTIMAL: // BASIC
1178 : : {
1179 : 0 : mbZoomOnPage = sal_False;
1180 [ # # ]: 0 : if ( mpDrawView->AreObjectsMarked() )
1181 : : {
1182 [ # # ]: 0 : maMarkRect = mpDrawView->GetAllMarkedRect();
1183 [ # # ]: 0 : long nW = (long) (maMarkRect.GetWidth() * 1.03);
1184 [ # # ]: 0 : long nH = (long) (maMarkRect.GetHeight() * 1.03);
1185 [ # # ]: 0 : Point aPos = maMarkRect.Center();
1186 : 0 : aPos.X() -= nW / 2;
1187 : 0 : aPos.Y() -= nH / 2;
1188 [ # # ][ # # ]: 0 : if ( nW && nH )
1189 : : {
1190 [ # # ][ # # ]: 0 : SetZoomRect(Rectangle(aPos, Size(nW, nH)));
1191 : :
1192 [ # # ]: 0 : Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1193 [ # # ][ # # ]: 0 : GetActiveWindow()->GetOutputSizePixel()) );
[ # # ]
1194 [ # # ]: 0 : mpZoomList->InsertZoomRect(aVisAreaWin);
1195 : : }
1196 : : }
1197 : 0 : Invalidate( SID_ZOOM_IN );
1198 : 0 : Invalidate( SID_ZOOM_OUT );
1199 : 0 : Invalidate( SID_ZOOM_PANNING );
1200 : 0 : Invalidate( SID_ZOOM_TOOLBOX );
1201 : 0 : rReq.Done ();
1202 : : }
1203 : 0 : break;
1204 : :
1205 : : // Namensverwirrung: SID_SIZE_ALL -> Zoom auf alle Objekte
1206 : : // --> Wird als Optimal im Programm angeboten
1207 : : case SID_SIZE_ALL: // BASIC
1208 : : {
1209 : 0 : mbZoomOnPage = sal_False;
1210 : 0 : SdrPageView* pPageView = mpDrawView->GetSdrPageView();
1211 : :
1212 [ # # ]: 0 : if( pPageView )
1213 : : {
1214 [ # # ]: 0 : Rectangle aBoundRect( pPageView->GetObjList()->GetAllObjBoundRect() );
1215 : :
1216 [ # # ]: 0 : long nW = (long) (aBoundRect.GetWidth() * 1.03);
1217 [ # # ]: 0 : long nH = (long) (aBoundRect.GetHeight() * 1.03);
1218 [ # # ]: 0 : Point aPos = aBoundRect.Center();
1219 : 0 : aPos.X() -= nW / 2;
1220 : 0 : aPos.Y() -= nH / 2;
1221 [ # # ][ # # ]: 0 : if ( nW && nH )
1222 : : {
1223 [ # # ][ # # ]: 0 : SetZoomRect( Rectangle( aPos, Size( nW, nH ) ) );
1224 : :
1225 [ # # ]: 0 : Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
1226 [ # # ][ # # ]: 0 : GetActiveWindow()->GetOutputSizePixel()) );
[ # # ]
1227 [ # # ]: 0 : mpZoomList->InsertZoomRect(aVisAreaWin);
1228 : : }
1229 : :
1230 [ # # ]: 0 : Invalidate( SID_ZOOM_IN );
1231 [ # # ]: 0 : Invalidate( SID_ZOOM_OUT );
1232 [ # # ]: 0 : Invalidate( SID_ZOOM_PANNING );
1233 [ # # ]: 0 : Invalidate( SID_ZOOM_TOOLBOX );
1234 : : }
1235 : 0 : rReq.Done ();
1236 : : }
1237 : 0 : break;
1238 : :
1239 : : case SID_ZOOM_PREV:
1240 : : {
1241 [ # # ]: 0 : if (mpDrawView->IsTextEdit())
1242 : : {
1243 : 0 : mpDrawView->SdrEndTextEdit();
1244 : : }
1245 : :
1246 [ # # ]: 0 : if (mpZoomList->IsPreviousPossible())
1247 : : {
1248 : : // Vorheriges ZoomRect einstellen
1249 [ # # ]: 0 : SetZoomRect(mpZoomList->GetPreviousZoomRect());
1250 : : }
1251 : 0 : rReq.Done ();
1252 : 0 : Invalidate( SID_ZOOM_TOOLBOX );
1253 : : }
1254 : 0 : break;
1255 : :
1256 : : case SID_ZOOM_NEXT:
1257 : : {
1258 [ # # ]: 0 : if (mpDrawView->IsTextEdit())
1259 : : {
1260 : 0 : mpDrawView->SdrEndTextEdit();
1261 : : }
1262 : :
1263 [ # # ]: 0 : if (mpZoomList->IsNextPossible())
1264 : : {
1265 : : // Naechstes ZoomRect einstellen
1266 [ # # ]: 0 : SetZoomRect(mpZoomList->GetNextZoomRect());
1267 : : }
1268 : 0 : rReq.Done ();
1269 : 0 : Invalidate( SID_ZOOM_TOOLBOX );
1270 : : }
1271 : 0 : break;
1272 : :
1273 : : case SID_GLUE_INSERT_POINT:
1274 : : case SID_GLUE_PERCENT:
1275 : : case SID_GLUE_ESCDIR:
1276 : : case SID_GLUE_ESCDIR_LEFT:
1277 : : case SID_GLUE_ESCDIR_RIGHT:
1278 : : case SID_GLUE_ESCDIR_TOP:
1279 : : case SID_GLUE_ESCDIR_BOTTOM:
1280 : : case SID_GLUE_HORZALIGN_CENTER:
1281 : : case SID_GLUE_HORZALIGN_LEFT:
1282 : : case SID_GLUE_HORZALIGN_RIGHT:
1283 : : case SID_GLUE_VERTALIGN_CENTER:
1284 : : case SID_GLUE_VERTALIGN_TOP:
1285 : : case SID_GLUE_VERTALIGN_BOTTOM:
1286 : : {
1287 [ # # ]: 0 : FunctionReference xFunc( GetCurrentFunction() );
1288 [ # # ]: 0 : FuEditGluePoints* pFunc = dynamic_cast< FuEditGluePoints* >( xFunc.get() );
1289 : :
1290 [ # # ]: 0 : if(pFunc)
1291 [ # # ]: 0 : pFunc->ReceiveRequest(rReq);
1292 : :
1293 [ # # ][ # # ]: 0 : rReq.Done();
1294 : : }
1295 : 0 : break;
1296 : :
1297 : : #ifdef DBG_UTIL
1298 : : case SID_SHOW_ITEMBROWSER:
1299 : : {
1300 : : mpDrawView->ShowItemBrowser( !mpDrawView->IsItemBrowserVisible() );
1301 : : rReq.Done ();
1302 : : }
1303 : : break;
1304 : : #endif
1305 : :
1306 : : case SID_AUTOSPELL_CHECK:
1307 : : {
1308 : 0 : sal_Bool bOnlineSpell = !GetDoc()->GetOnlineSpell();
1309 : 0 : GetDoc()->SetOnlineSpell(bOnlineSpell);
1310 : :
1311 : 0 : ::Outliner* pOL = mpDrawView->GetTextEditOutliner();
1312 : :
1313 [ # # ]: 0 : if (pOL)
1314 : : {
1315 : 0 : sal_uLong nCntrl = pOL->GetControlWord();
1316 : :
1317 [ # # ]: 0 : if (bOnlineSpell)
1318 : 0 : nCntrl |= EE_CNTRL_ONLINESPELLING;
1319 : : else
1320 : 0 : nCntrl &= ~EE_CNTRL_ONLINESPELLING;
1321 : :
1322 : 0 : pOL->SetControlWord(nCntrl);
1323 : : }
1324 : :
1325 : 0 : GetActiveWindow()->Invalidate();
1326 : 0 : rReq.Done ();
1327 : : }
1328 : 0 : break;
1329 : :
1330 : : case SID_CONVERT_TO_1BIT_THRESHOLD:
1331 : : case SID_CONVERT_TO_1BIT_MATRIX:
1332 : : case SID_CONVERT_TO_4BIT_GRAYS:
1333 : : case SID_CONVERT_TO_4BIT_COLORS:
1334 : : case SID_CONVERT_TO_8BIT_GRAYS:
1335 : : case SID_CONVERT_TO_8BIT_COLORS:
1336 : : case SID_CONVERT_TO_24BIT:
1337 : : {
1338 : 0 : BmpConversion eBmpConvert = BMP_CONVERSION_NONE;
1339 : :
1340 [ # # # # : 0 : switch( nSId )
# # # # ]
1341 : : {
1342 : : case SID_CONVERT_TO_1BIT_THRESHOLD:
1343 : 0 : eBmpConvert = BMP_CONVERSION_1BIT_THRESHOLD;
1344 : 0 : break;
1345 : :
1346 : : case SID_CONVERT_TO_1BIT_MATRIX:
1347 : 0 : eBmpConvert = BMP_CONVERSION_1BIT_MATRIX;
1348 : 0 : break;
1349 : :
1350 : : case SID_CONVERT_TO_4BIT_GRAYS:
1351 : 0 : eBmpConvert = BMP_CONVERSION_4BIT_GREYS;
1352 : 0 : break;
1353 : :
1354 : : case SID_CONVERT_TO_4BIT_COLORS:
1355 : 0 : eBmpConvert = BMP_CONVERSION_4BIT_COLORS;
1356 : 0 : break;
1357 : :
1358 : : case SID_CONVERT_TO_8BIT_GRAYS:
1359 : 0 : eBmpConvert = BMP_CONVERSION_8BIT_GREYS;
1360 : 0 : break;
1361 : :
1362 : : case SID_CONVERT_TO_8BIT_COLORS:
1363 : 0 : eBmpConvert = BMP_CONVERSION_8BIT_COLORS;
1364 : 0 : break;
1365 : :
1366 : : case SID_CONVERT_TO_24BIT:
1367 : 0 : eBmpConvert = BMP_CONVERSION_24BIT;
1368 : 0 : break;
1369 : : }
1370 : :
1371 [ # # ][ # # ]: 0 : mpDrawView->BegUndo(String(SdResId(STR_UNDO_COLORRESOLUTION)));
[ # # ]
1372 : 0 : const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
1373 : :
1374 [ # # ]: 0 : for (sal_uLong i=0; i<rMarkList.GetMarkCount(); i++)
1375 : : {
1376 : 0 : SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
1377 : :
1378 [ # # ]: 0 : if (pObj->GetObjInventor() == SdrInventor)
1379 : : {
1380 [ # # ][ # # ]: 0 : if (pObj->GetObjIdentifier() == OBJ_GRAF && !((SdrGrafObj*) pObj)->IsLinkedGraphic())
[ # # ]
1381 : : {
1382 : 0 : const Graphic& rGraphic = ((SdrGrafObj*) pObj)->GetGraphic();
1383 : :
1384 [ # # ]: 0 : if( rGraphic.GetType() == GRAPHIC_BITMAP )
1385 : : {
1386 : 0 : SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->Clone();
1387 : :
1388 [ # # ]: 0 : if( rGraphic.IsAnimated() )
1389 : : {
1390 [ # # ]: 0 : Animation aAnim( rGraphic.GetAnimation() );
1391 [ # # ]: 0 : aAnim.Convert( eBmpConvert );
1392 [ # # ][ # # ]: 0 : pNewObj->SetGraphic( aAnim );
[ # # ][ # # ]
1393 : : }
1394 : : else
1395 : : {
1396 [ # # ]: 0 : BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
1397 [ # # ]: 0 : aBmpEx.Convert( eBmpConvert );
1398 [ # # ][ # # ]: 0 : pNewObj->SetGraphic( aBmpEx );
[ # # ][ # # ]
1399 : : }
1400 : :
1401 : 0 : mpDrawView->ReplaceObjectAtView( pObj, *mpDrawView->GetSdrPageView(), pNewObj );
1402 : : }
1403 : : }
1404 : : }
1405 : : }
1406 : :
1407 : 0 : mpDrawView->EndUndo();
1408 : 0 : rReq.Done ();
1409 : : }
1410 : 0 : break;
1411 : :
1412 : : case SID_TRANSLITERATE_SENTENCE_CASE:
1413 : : case SID_TRANSLITERATE_TITLE_CASE:
1414 : : case SID_TRANSLITERATE_TOGGLE_CASE:
1415 : : case SID_TRANSLITERATE_UPPER:
1416 : : case SID_TRANSLITERATE_LOWER:
1417 : : case SID_TRANSLITERATE_HALFWIDTH:
1418 : : case SID_TRANSLITERATE_FULLWIDTH:
1419 : : case SID_TRANSLITERATE_HIRAGANA:
1420 : : case SID_TRANSLITERATE_KATAGANA:
1421 : : {
1422 : 0 : OutlinerView* pOLV = GetView()->GetTextEditOutlinerView();
1423 [ # # ]: 0 : if( pOLV )
1424 : : {
1425 : : using namespace ::com::sun::star::i18n;
1426 : 0 : sal_Int32 nType = 0;
1427 : :
1428 [ # # # # : 0 : switch( nSId )
# # # # #
# ]
1429 : : {
1430 : : case SID_TRANSLITERATE_SENTENCE_CASE:
1431 : 0 : nType = TransliterationModulesExtra::SENTENCE_CASE;
1432 : 0 : break;
1433 : : case SID_TRANSLITERATE_TITLE_CASE:
1434 : 0 : nType = TransliterationModulesExtra::TITLE_CASE;
1435 : 0 : break;
1436 : : case SID_TRANSLITERATE_TOGGLE_CASE:
1437 : 0 : nType = TransliterationModulesExtra::TOGGLE_CASE;
1438 : 0 : break;
1439 : : case SID_TRANSLITERATE_UPPER:
1440 : 0 : nType = TransliterationModules_LOWERCASE_UPPERCASE;
1441 : 0 : break;
1442 : : case SID_TRANSLITERATE_LOWER:
1443 : 0 : nType = TransliterationModules_UPPERCASE_LOWERCASE;
1444 : 0 : break;
1445 : : case SID_TRANSLITERATE_HALFWIDTH:
1446 : 0 : nType = TransliterationModules_FULLWIDTH_HALFWIDTH;
1447 : 0 : break;
1448 : : case SID_TRANSLITERATE_FULLWIDTH:
1449 : 0 : nType = TransliterationModules_HALFWIDTH_FULLWIDTH;
1450 : 0 : break;
1451 : : case SID_TRANSLITERATE_HIRAGANA:
1452 : 0 : nType = TransliterationModules_KATAKANA_HIRAGANA;
1453 : 0 : break;
1454 : : case SID_TRANSLITERATE_KATAGANA:
1455 : 0 : nType = TransliterationModules_HIRAGANA_KATAKANA;
1456 : 0 : break;
1457 : : }
1458 : :
1459 : 0 : pOLV->TransliterateText( nType );
1460 : : }
1461 : :
1462 : 0 : rReq.Done();
1463 : : }
1464 : 0 : break;
1465 : :
1466 : : // #UndoRedo#
1467 : : case SID_UNDO :
1468 : : {
1469 : : // moved implementation to BaseClass
1470 : 12 : ImpSidUndo(sal_True, rReq);
1471 : : }
1472 : 12 : break;
1473 : : case SID_REDO :
1474 : : {
1475 : : // moved implementation to BaseClass
1476 : 4 : ImpSidRedo(sal_True, rReq);
1477 : : }
1478 : 4 : break;
1479 : :
1480 : : default:
1481 : 463 : break;
1482 : : }
1483 : : }
1484 : :
1485 : 0 : void DrawViewShell::FuSupportRotate(SfxRequest &rReq)
1486 : : {
1487 [ # # ]: 0 : if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
1488 : : {
1489 : 0 : ::sd::View* pView = GetView();
1490 : :
1491 [ # # ]: 0 : if (!pView)
1492 : 0 : return;
1493 : :
1494 : 0 : OutlinerView* pOLV = pView->GetTextEditOutlinerView();
1495 : :
1496 [ # # ]: 0 : if (!pOLV)
1497 : 0 : return;
1498 : :
1499 : 0 : pOLV->TransliterateText( m_aRotateCase.getNextMode() );
1500 : : }
1501 : : }
1502 : :
1503 : : /*************************************************************************
1504 : : |*
1505 : : |* URL-Feld einfuegen
1506 : : |*
1507 : : \************************************************************************/
1508 : :
1509 : 0 : void DrawViewShell::InsertURLField(const String& rURL, const String& rText,
1510 : : const String& rTarget, const Point* pPos)
1511 : : {
1512 : 0 : OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
1513 : :
1514 [ # # ]: 0 : if (pOLV)
1515 : : {
1516 [ # # ]: 0 : ESelection aSel( pOLV->GetSelection() );
1517 [ # # ][ # # ]: 0 : SvxFieldItem aURLItem( SvxURLField( rURL, rText, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
[ # # ][ # # ]
[ # # ]
1518 [ # # ]: 0 : pOLV->InsertField( aURLItem );
1519 [ # # ]: 0 : if ( aSel.nStartPos <= aSel.nEndPos )
1520 : 0 : aSel.nEndPos = aSel.nStartPos + 1;
1521 : : else
1522 : 0 : aSel.nStartPos = aSel.nEndPos + 1;
1523 [ # # ][ # # ]: 0 : pOLV->SetSelection( aSel );
1524 : : }
1525 : : else
1526 : : {
1527 [ # # ][ # # ]: 0 : Outliner* pOutl = GetDoc()->GetInternalOutliner();
1528 [ # # ]: 0 : pOutl->Init( OUTLINERMODE_TEXTOBJECT );
1529 : 0 : sal_uInt16 nOutlMode = pOutl->GetMode();
1530 : :
1531 [ # # ][ # # ]: 0 : SvxURLField aURLField(rURL, rText, SVXURLFORMAT_REPR);
[ # # ]
1532 [ # # ]: 0 : aURLField.SetTargetFrame(rTarget);
1533 [ # # ]: 0 : SvxFieldItem aURLItem(aURLField, EE_FEATURE_FIELD);
1534 [ # # ]: 0 : pOutl->QuickInsertField( aURLItem, ESelection() );
1535 [ # # ]: 0 : OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
1536 : :
1537 [ # # ][ # # ]: 0 : SdrRectObj* pRectObj = new SdrRectObj(OBJ_TEXT);
1538 : :
1539 [ # # ]: 0 : pOutl->UpdateFields();
1540 [ # # ]: 0 : pOutl->SetUpdateMode( sal_True );
1541 [ # # ]: 0 : Size aSize(pOutl->CalcTextSize());
1542 [ # # ]: 0 : pOutl->SetUpdateMode( sal_False );
1543 : :
1544 : 0 : Point aPos;
1545 : :
1546 [ # # ]: 0 : if (pPos)
1547 : : {
1548 : 0 : aPos = *pPos;
1549 : : }
1550 : : else
1551 : : {
1552 [ # # ][ # # ]: 0 : Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
1553 [ # # ]: 0 : aPos = aRect.Center();
1554 [ # # ][ # # ]: 0 : aPos = GetActiveWindow()->PixelToLogic(aPos);
1555 : 0 : aPos.X() -= aSize.Width() / 2;
1556 : 0 : aPos.Y() -= aSize.Height() / 2;
1557 : : }
1558 : :
1559 [ # # ]: 0 : Rectangle aLogicRect(aPos, aSize);
1560 [ # # ]: 0 : pRectObj->SetLogicRect(aLogicRect);
1561 [ # # ]: 0 : pRectObj->SetOutlinerParaObject( pOutlParaObject );
1562 [ # # ]: 0 : mpDrawView->InsertObjectAtView(pRectObj, *mpDrawView->GetSdrPageView());
1563 [ # # ][ # # ]: 0 : pOutl->Init( nOutlMode );
[ # # ]
1564 : : }
1565 : 0 : }
1566 : :
1567 : : /*************************************************************************
1568 : : |*
1569 : : |* URL-Button einfuegen
1570 : : |*
1571 : : \************************************************************************/
1572 : :
1573 : 0 : void DrawViewShell::InsertURLButton(const String& rURL, const String& rText,
1574 : : const String& rTarget, const Point* pPos)
1575 : : {
1576 : 0 : sal_Bool bNewObj = sal_True;
1577 : :
1578 [ # # ]: 0 : const OUString sTargetURL( ::URIHelper::SmartRel2Abs( INetURLObject( GetDocSh()->GetMedium()->GetBaseURL() ), rURL, URIHelper::GetMaybeFileHdl(), true, false,
1579 : : INetURLObject::WAS_ENCODED,
1580 [ # # ][ # # ]: 0 : INetURLObject::DECODE_UNAMBIGUOUS ) );
[ # # ][ # # ]
[ # # ][ # # ]
1581 [ # # ]: 0 : if (mpDrawView->GetMarkedObjectList().GetMarkCount() > 0)
1582 : : {
1583 [ # # ][ # # ]: 0 : SdrObject* pMarkedObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
1584 [ # # ]: 0 : if( pMarkedObj ) try
1585 : : {
1586 : : // change first marked object
1587 [ # # ][ # # ]: 0 : if( (FmFormInventor == pMarkedObj->GetObjInventor() && pMarkedObj->GetObjIdentifier() == OBJ_FM_BUTTON) )
[ # # ][ # # ]
[ # # ]
1588 : : {
1589 : 0 : bNewObj = sal_False;
1590 : :
1591 : 0 : SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pMarkedObj );
1592 : :
1593 [ # # ][ # # ]: 0 : Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), UNO_QUERY_THROW );
1594 [ # # ]: 0 : Reference< beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY_THROW );
1595 : :
1596 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue("Label" , Any( OUString( rText ) ) );
[ # # ][ # # ]
1597 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue("TargetURL" , Any( sTargetURL ) );
[ # # ]
1598 : :
1599 [ # # ]: 0 : if( rTarget.Len() )
1600 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue("TargetFrame" , Any( OUString( rTarget ) ) );
[ # # ][ # # ]
1601 : :
1602 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue( "ButtonType" , Any( form::FormButtonType_URL ) );
[ # # ]
1603 [ # # ][ # # ]: 0 : if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
[ # # ]
1604 : : {
1605 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue( "DispatchURLInternal" , Any( sal_True ) );
[ # # ]
1606 : 0 : }
1607 : : }
1608 : : else
1609 : : {
1610 : : // add url as interaction for first selected shape
1611 : 0 : bNewObj = sal_False;
1612 : :
1613 [ # # ]: 0 : SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pMarkedObj, true);
1614 : 0 : pInfo->meClickAction = presentation::ClickAction_DOCUMENT;
1615 [ # # ][ # # ]: 0 : pInfo->SetBookmark( sTargetURL );
[ # # ][ # # ]
1616 : : }
1617 : : }
1618 [ # # ]: 0 : catch( uno::Exception& )
1619 : : {
1620 : : }
1621 : : }
1622 : :
1623 [ # # ]: 0 : if (bNewObj) try
1624 : : {
1625 : : SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( SdrObjFactory::MakeNewObject(FmFormInventor, OBJ_FM_BUTTON,
1626 [ # # ][ # # ]: 0 : mpDrawView->GetSdrPageView()->GetPage(), GetDoc()) );
1627 : :
1628 [ # # ][ # # ]: 0 : Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), uno::UNO_QUERY_THROW );
1629 [ # # ]: 0 : Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW );
1630 : :
1631 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue( "Label" , Any( OUString( rText ) ) );
[ # # ][ # # ]
1632 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue( "TargetURL" , Any( sTargetURL ) );
[ # # ]
1633 : :
1634 [ # # ]: 0 : if( rTarget.Len() )
1635 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue( "TargetFrame" , Any( OUString( rTarget ) ) );
[ # # ][ # # ]
1636 : :
1637 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue( "ButtonType" , Any( form::FormButtonType_URL ) );
[ # # ]
1638 [ # # ][ # # ]: 0 : if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
[ # # ]
1639 [ # # ][ # # ]: 0 : xPropSet->setPropertyValue( "DispatchURLInternal" , Any( sal_True ) );
[ # # ]
1640 : :
1641 : 0 : Point aPos;
1642 : :
1643 [ # # ]: 0 : if (pPos)
1644 : : {
1645 : 0 : aPos = *pPos;
1646 : : }
1647 : : else
1648 : : {
1649 [ # # ][ # # ]: 0 : aPos = Rectangle(aPos, GetActiveWindow()->GetOutputSizePixel()).Center();
[ # # ]
1650 [ # # ][ # # ]: 0 : aPos = GetActiveWindow()->PixelToLogic(aPos);
1651 : : }
1652 : :
1653 : 0 : Size aSize(4000, 1000);
1654 : 0 : aPos.X() -= aSize.Width() / 2;
1655 : 0 : aPos.Y() -= aSize.Height() / 2;
1656 [ # # ][ # # ]: 0 : pUnoCtrl->SetLogicRect(Rectangle(aPos, aSize));
1657 : :
1658 : 0 : sal_uLong nOptions = SDRINSERT_SETDEFLAYER;
1659 : :
1660 : : OSL_ASSERT (GetViewShell()!=NULL);
1661 [ # # ][ # # ]: 0 : SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient();
1662 [ # # ][ # # ]: 0 : if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())
[ # # ][ # # ]
1663 : : {
1664 : 0 : nOptions |= SDRINSERT_DONTMARK;
1665 : : }
1666 : :
1667 [ # # ][ # # ]: 0 : mpDrawView->InsertObjectAtView(pUnoCtrl, *mpDrawView->GetSdrPageView(), nOptions);
1668 : : }
1669 [ # # ]: 0 : catch( Exception& )
1670 : : {
1671 : 0 : }
1672 : 0 : }
1673 : :
1674 : 0 : void DrawViewShell::ShowUIControls (bool bVisible)
1675 : : {
1676 : 0 : ViewShell::ShowUIControls (bVisible);
1677 : :
1678 : : //AF: The LayerDialogChildWindow is not used anymore (I hope).
1679 : : // GetViewFrame()->SetChildWindow(
1680 : : // LayerDialogChildWindow::GetChildWindowId(),
1681 : : // IsLayerModeActive() && bVisible);
1682 : 0 : maTabControl.Show (bVisible);
1683 : 0 : }
1684 : :
1685 : 0 : void DrawViewShell::StopSlideShow (bool /*bCloseFrame*/)
1686 : : {
1687 [ # # ][ # # ]: 0 : Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
1688 [ # # ][ # # ]: 0 : if(xPresentation.is() && xPresentation->isRunning())
[ # # ][ # # ]
[ # # ]
1689 : : {
1690 [ # # ][ # # ]: 0 : if( mpDrawView->IsTextEdit() )
1691 [ # # ]: 0 : mpDrawView->SdrEndTextEdit();
1692 : :
1693 [ # # ][ # # ]: 0 : xPresentation->end();
1694 : 0 : }
1695 : 0 : }
1696 : :
1697 : : #ifdef _MSC_VER
1698 : : #pragma optimize ( "", on )
1699 : : #endif
1700 : :
1701 : : } // end of namespace sd
1702 : :
1703 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|