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 "DrawViewShell.hxx"
31 : :
32 : : #include <sfx2/viewfrm.hxx>
33 : : #include <editeng/eeitem.hxx>
34 : : #include <editeng/tstpitem.hxx>
35 : : #include <editeng/lrspitem.hxx>
36 : : #include <editeng/protitem.hxx>
37 : : #include <editeng/frmdiritem.hxx>
38 : : #include <svx/ruler.hxx>
39 : : #include <editeng/numitem.hxx>
40 : : #include <svx/rulritem.hxx>
41 : : #include <sfx2/zoomitem.hxx>
42 : : #include <svx/svxids.hrc>
43 : : #include <svx/svdpagv.hxx>
44 : : #include <sfx2/request.hxx>
45 : : #include <sfx2/dispatch.hxx>
46 : : #include <tools/urlobj.hxx>
47 : : #include <svl/aeitem.hxx>
48 : : #include <svl/eitem.hxx>
49 : : #include <svl/rectitem.hxx>
50 : : #include <svl/stritem.hxx>
51 : : #include <svx/svdoole2.hxx>
52 : : #include <svl/itempool.hxx>
53 : : #include <svl/ptitem.hxx>
54 : : #include <basic/sbstar.hxx>
55 : : #include <basic/sberrors.hxx>
56 : : #include <svx/fmshell.hxx>
57 : : #include <svx/f3dchild.hxx>
58 : : #include <svx/float3d.hxx>
59 : : #include "optsitem.hxx"
60 : :
61 : : #include "app.hrc"
62 : : #include "glob.hrc"
63 : : #include "strings.hrc"
64 : : #include "res_bmp.hrc"
65 : :
66 : : #include "sdundogr.hxx"
67 : : #include "undopage.hxx"
68 : : #include "glob.hxx"
69 : : #include "app.hxx"
70 : : #include "fupoor.hxx"
71 : : #include "slideshow.hxx"
72 : : #ifndef SD_FRAME_VIEW
73 : : #include "FrameView.hxx"
74 : : #endif
75 : : #include "sdpage.hxx"
76 : : #include "Window.hxx"
77 : : #include "sdresid.hxx"
78 : : #include "drawview.hxx"
79 : : #include "drawdoc.hxx"
80 : : #include "Ruler.hxx"
81 : : #include "DrawDocShell.hxx"
82 : : #include "headerfooterdlg.hxx"
83 : : #include "masterlayoutdlg.hxx"
84 : : #include "sdabstdlg.hxx"
85 : : #include <sfx2/ipclient.hxx>
86 : : #include <tools/diagnose_ex.h>
87 : : #include "ViewShellBase.hxx"
88 : : #include "FormShellManager.hxx"
89 : : #include "LayerTabBar.hxx"
90 : : #include <com/sun/star/drawing/framework/XControllerManager.hpp>
91 : : #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
92 : : #include <com/sun/star/drawing/framework/XConfiguration.hpp>
93 : : #include <com/sun/star/frame/XFrame.hpp>
94 : :
95 : : using namespace ::com::sun::star::uno;
96 : : using namespace ::com::sun::star::drawing::framework;
97 : : using ::com::sun::star::frame::XFrame;
98 : : using ::com::sun::star::frame::XController;
99 : :
100 : : namespace sd {
101 : :
102 : : #ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED
103 : : #define SO2_DECL_SVINPLACEOBJECT_DEFINED
104 : : SO2_DECL_REF(SvInPlaceObject)
105 : : #endif
106 : :
107 : :
108 : :
109 : : /*************************************************************************
110 : : |*
111 : : |* SfxRequests fuer Controller bearbeiten
112 : : |*
113 : : \************************************************************************/
114 : :
115 : 142 : void DrawViewShell::ExecCtrl(SfxRequest& rReq)
116 : : {
117 : : // waehrend einer Diashow wird nichts ausser dem Seitenwechsel und dem
118 : : // Sprung zur Bookmark ausgefuehrt!
119 [ - + # # : 142 : if( HasCurrentFunction(SID_PRESENTATION) &&
# # ][ - + ]
120 : 0 : rReq.GetSlot() != SID_SWITCHPAGE &&
121 : 0 : rReq.GetSlot() != SID_JUMPTOMARK)
122 : 0 : return;
123 : :
124 : 142 : CheckLineTo (rReq);
125 : :
126 : : // End text edit mode for some requests.
127 : 142 : sal_uInt16 nSlot = rReq.GetSlot();
128 [ - + ]: 142 : switch (nSlot)
129 : : {
130 : : case SID_OUTPUT_QUALITY_COLOR:
131 : : case SID_OUTPUT_QUALITY_GRAYSCALE:
132 : : case SID_OUTPUT_QUALITY_BLACKWHITE:
133 : : case SID_OUTPUT_QUALITY_CONTRAST:
134 : : // Do nothing.
135 : 0 : break;
136 : : default:
137 [ - + ]: 142 : if ( mpDrawView->IsTextEdit() )
138 : : {
139 : 0 : mpDrawView->SdrEndTextEdit();
140 : : }
141 : : }
142 : :
143 : : // sal_uInt16 nSlot = rReq.GetSlot();
144 [ + - - - : 142 : switch (nSlot)
- - - - -
- - - -
- ]
145 : : {
146 : : case SID_SWITCHPAGE: // BASIC
147 : : {
148 : : // switch page in running slide show
149 [ - + ][ # # ]: 142 : if(SlideShow::IsRunning(GetViewShellBase()) && rReq.GetArgs())
[ - + ]
150 : : {
151 : 0 : SFX_REQUEST_ARG(rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE, sal_False);
152 [ # # ]: 0 : SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber((sal_Int32)((pWhatPage->GetValue()-1)>>1));
153 : : }
154 : : else
155 : : {
156 : 142 : const SfxItemSet *pArgs = rReq.GetArgs ();
157 : 142 : sal_uInt16 nSelectedPage = 0;
158 : :
159 [ + - ]: 142 : if (! pArgs)
160 : : {
161 : 142 : nSelectedPage = maTabControl.GetCurPageId() - 1;
162 : : }
163 [ # # ]: 0 : else if (pArgs->Count () == 2)
164 : : {
165 : 0 : SFX_REQUEST_ARG (rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE, sal_False);
166 : 0 : SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND, sal_False);
167 : :
168 : 0 : sal_Int32 nWhatPage = (sal_Int32)pWhatPage->GetValue ();
169 : 0 : sal_Int32 nWhatKind = (sal_Int32)pWhatKind->GetValue ();
170 [ # # ][ # # ]: 0 : if (! CHECK_RANGE (PK_STANDARD, nWhatKind, PK_HANDOUT))
171 : : {
172 : : #ifndef DISABLE_SCRIPTING
173 : 0 : StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
174 : : #endif
175 : 0 : rReq.Ignore ();
176 : 0 : break;
177 : : }
178 [ # # ]: 0 : else if (meEditMode != EM_MASTERPAGE)
179 : : {
180 [ # # ][ # # ]: 0 : if (! CHECK_RANGE (0, nWhatPage, GetDoc()->GetSdPageCount((PageKind)nWhatKind)))
[ # # ]
181 : : {
182 : : #ifndef DISABLE_SCRIPTING
183 : 0 : StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
184 : : #endif
185 : 0 : rReq.Ignore ();
186 : 0 : break;
187 : : }
188 : :
189 : 0 : nSelectedPage = (short) nWhatPage;
190 : 0 : mePageKind = (PageKind) nWhatKind;
191 : : }
192 : : }
193 : : else
194 : : {
195 : : #ifndef DISABLE_SCRIPTING
196 : 0 : StarBASIC::FatalError (SbERR_WRONG_ARGS);
197 : : #endif
198 : 0 : rReq.Ignore ();
199 : 0 : break;
200 : : }
201 : :
202 : :
203 [ + - ][ - + ]: 142 : if( GetDocSh() && (GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED))
[ - + ]
204 : 0 : GetDocSh()->SetModified();
205 : :
206 : 142 : SwitchPage(nSelectedPage);
207 : :
208 [ - + ]: 142 : if(HasCurrentFunction(SID_BEZIER_EDIT))
209 : 0 : GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
210 : :
211 : 142 : Invalidate();
212 : 142 : InvalidateWindows();
213 : 142 : rReq.Done ();
214 : : }
215 : 142 : break;
216 : : }
217 : :
218 : : case SID_SWITCHLAYER: // BASIC
219 : : {
220 : 0 : const SfxItemSet *pArgs = rReq.GetArgs ();
221 : 0 : sal_uInt16 nCurPage = GetLayerTabControl()->GetCurPageId ();
222 : :
223 [ # # ][ # # ]: 0 : if( pArgs && pArgs->Count () == 1)
[ # # ]
224 : : {
225 : 0 : SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
226 [ # # ]: 0 : if( pWhatLayer )
227 : 0 : nCurPage = (short) pWhatLayer->GetValue ();
228 : : }
229 : :
230 [ # # ]: 0 : mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) );
231 : 0 : Invalidate();
232 : 0 : rReq.Done ();
233 : :
234 : 0 : break;
235 : : }
236 : :
237 : : case SID_PAGEMODE: // BASIC
238 : : {
239 : :
240 : 0 : const SfxItemSet *pArgs = rReq.GetArgs ();
241 : :
242 [ # # ][ # # ]: 0 : if ( pArgs && pArgs->Count () == 2)
[ # # ]
243 : : {
244 : 0 : SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, ID_VAL_ISACTIVE, sal_False);
245 : 0 : SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND, sal_False);
246 : :
247 : 0 : sal_Int32 nWhatKind = (sal_Int32)pWhatKind->GetValue ();
248 [ # # ][ # # ]: 0 : if (CHECK_RANGE (PK_STANDARD, nWhatKind, PK_HANDOUT))
249 : : {
250 : 0 : mbIsLayerModeActive = pIsActive->GetValue ();
251 : 0 : mePageKind = (PageKind) nWhatKind;
252 : : }
253 : : }
254 : :
255 : : // Default-Layer der Page einschalten
256 [ # # ][ # # ]: 0 : mpDrawView->SetActiveLayer( String( SdResId(STR_LAYER_LAYOUT) ) );
[ # # ]
257 : :
258 : 0 : ChangeEditMode(EM_PAGE, mbIsLayerModeActive);
259 : :
260 : 0 : Invalidate();
261 : 0 : rReq.Done ();
262 : :
263 : 0 : break;
264 : : }
265 : :
266 : : case SID_LAYERMODE: // BASIC
267 : : {
268 : 0 : const SfxItemSet *pArgs = rReq.GetArgs ();
269 : :
270 [ # # ][ # # ]: 0 : if ( pArgs && pArgs->Count () == 2)
[ # # ]
271 : : {
272 : 0 : SFX_REQUEST_ARG (rReq, pWhatLayerMode, SfxBoolItem, ID_VAL_ISACTIVE, sal_False);
273 : 0 : SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
274 : :
275 : 0 : sal_Int32 nWhatLayer = (sal_Int32)pWhatLayer->GetValue ();
276 [ # # ][ # # ]: 0 : if (CHECK_RANGE (EM_PAGE, nWhatLayer, EM_MASTERPAGE))
277 : : {
278 : 0 : mbIsLayerModeActive = pWhatLayerMode->GetValue ();
279 : 0 : meEditMode = (EditMode) nWhatLayer;
280 : : }
281 : : }
282 : :
283 : 0 : ChangeEditMode(meEditMode, !mbIsLayerModeActive);
284 : :
285 : 0 : Invalidate();
286 : 0 : rReq.Done ();
287 : :
288 : 0 : break;
289 : : }
290 : :
291 : : case SID_HEADER_AND_FOOTER:
292 : : case SID_INSERT_PAGE_NUMBER:
293 : : case SID_INSERT_DATE_TIME:
294 : : {
295 : 0 : SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
296 [ # # ]: 0 : AbstractHeaderFooterDialog* pDlg = pFact ? pFact->CreateHeaderFooterDialog( (::ViewShell*)this, GetActiveWindow(), GetDoc(), mpActualPage ) : 0;
297 [ # # ]: 0 : if( pDlg )
298 : : {
299 : 0 : pDlg->Execute();
300 [ # # ]: 0 : delete pDlg;
301 : :
302 : 0 : GetActiveWindow()->Invalidate();
303 : 0 : UpdatePreview( mpActualPage );
304 : : }
305 : :
306 : 0 : Invalidate();
307 : 0 : rReq.Done ();
308 : :
309 : 0 : break;
310 : : }
311 : :
312 : : case SID_MASTER_LAYOUTS:
313 : : {
314 : 0 : SdPage* pPage = GetActualPage();
315 [ # # ]: 0 : if (meEditMode == EM_MASTERPAGE)
316 : : // Use the master page of the current page.
317 : 0 : pPage = static_cast<SdPage*>(&pPage->TRG_GetMasterPage());
318 : :
319 : 0 : SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
320 [ # # ]: 0 : VclAbstractDialog* pDlg = pFact ? pFact->CreateMasterLayoutDialog( GetActiveWindow(), GetDoc(), pPage ) : 0;
321 [ # # ]: 0 : if( pDlg )
322 : : {
323 : 0 : pDlg->Execute();
324 [ # # ]: 0 : delete pDlg;
325 : 0 : Invalidate();
326 : : }
327 : 0 : rReq.Done ();
328 : 0 : break;
329 : : }
330 : : case SID_OBJECTRESIZE:
331 : : {
332 : : /******************************************************************
333 : : * Der Server moechte die Clientgrosse verandern
334 : : ******************************************************************/
335 : : OSL_ASSERT (GetViewShell()!=NULL);
336 : 0 : SfxInPlaceClient* pIPClient = GetViewShell()->GetIPClient();
337 : :
338 [ # # ][ # # ]: 0 : if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
[ # # ]
339 : : {
340 : : const SfxRectangleItem& rRect =
341 [ # # ]: 0 : (SfxRectangleItem&)rReq.GetArgs()->Get(SID_OBJECTRESIZE);
342 [ # # ][ # # ]: 0 : Rectangle aRect( GetActiveWindow()->PixelToLogic( rRect.GetValue() ) );
343 : :
344 [ # # ]: 0 : if ( mpDrawView->AreObjectsMarked() )
345 : : {
346 : 0 : const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
347 : :
348 [ # # ]: 0 : if (rMarkList.GetMarkCount() == 1)
349 : : {
350 [ # # ]: 0 : SdrMark* pMark = rMarkList.GetMark(0);
351 [ # # ]: 0 : SdrObject* pObj = pMark->GetMarkedSdrObj();
352 : :
353 [ # # ]: 0 : SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( pObj );
354 [ # # ]: 0 : if(pOle2Obj)
355 : : {
356 [ # # ][ # # ]: 0 : if( pOle2Obj->GetObjRef().is() )
357 : : {
358 [ # # ]: 0 : pOle2Obj->SetLogicRect(aRect);
359 : : }
360 : : }
361 : : }
362 : : }
363 : : }
364 : 0 : rReq.Ignore ();
365 : 0 : break;
366 : : }
367 : :
368 : : case SID_RELOAD:
369 : : {
370 : 0 : sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId();
371 : 0 : SfxViewFrame* pFrame = GetViewFrame();
372 : :
373 : : try
374 : : {
375 [ # # ][ # # ]: 0 : Reference< XFrame > xFrame( pFrame->GetFrame().GetFrameInterface(), UNO_SET_THROW );
[ # # ]
376 : :
377 : : // Save the current configuration of panes and views.
378 : : Reference<XControllerManager> xControllerManager (
379 [ # # ][ # # ]: 0 : GetViewShellBase().GetController(), UNO_QUERY_THROW);
[ # # ]
380 : : Reference<XConfigurationController> xConfigurationController (
381 [ # # ][ # # ]: 0 : xControllerManager->getConfigurationController(), UNO_QUERY_THROW );
[ # # ]
382 : : Reference<XConfiguration> xConfiguration (
383 [ # # ][ # # ]: 0 : xConfigurationController->getRequestedConfiguration(), UNO_SET_THROW );
[ # # ]
384 : :
385 [ # # ]: 0 : SfxChildWindow* pWindow = pFrame->GetChildWindow(nId);
386 [ # # ]: 0 : if(pWindow)
387 : : {
388 : 0 : Svx3DWin* p3DWin = (Svx3DWin*)(pWindow->GetWindow());
389 [ # # ]: 0 : if(p3DWin)
390 [ # # ]: 0 : p3DWin->DocumentReload();
391 : : }
392 : :
393 : : // Normale Weiterleitung an ViewFrame zur Ausfuehrung
394 [ # # ][ # # ]: 0 : GetViewFrame()->ExecuteSlot(rReq);
395 : :
396 : : // From here on we must cope with this object and the frame already being
397 : : // deleted. Do not call any methods or use data members.
398 [ # # ][ # # ]: 0 : Reference<XController> xController( xFrame->getController(), UNO_SET_THROW );
[ # # ]
399 : :
400 : : // Restore the configuration.
401 [ # # ][ # # ]: 0 : xControllerManager = Reference<XControllerManager>( xController, UNO_QUERY_THROW);
402 : : xConfigurationController = Reference<XConfigurationController>(
403 [ # # ][ # # ]: 0 : xControllerManager->getConfigurationController());
[ # # ]
404 [ # # ]: 0 : if ( ! xConfigurationController.is())
405 [ # # ]: 0 : throw RuntimeException();
406 [ # # ][ # # ]: 0 : xConfigurationController->restoreConfiguration(xConfiguration);
[ # # ]
407 : : }
408 : 0 : catch (RuntimeException&)
409 : : {
410 : : DBG_UNHANDLED_EXCEPTION();
411 : : }
412 : :
413 : : // We have to return immediately to avoid accessing this object.
414 : 0 : return;
415 : : }
416 : :
417 : : case SID_JUMPTOMARK:
418 : : {
419 [ # # ]: 0 : if( rReq.GetArgs() )
420 : : {
421 : 0 : SFX_REQUEST_ARG(rReq, pBookmark, SfxStringItem, SID_JUMPTOMARK, sal_False);
422 : :
423 [ # # ]: 0 : if (pBookmark)
424 : : {
425 [ # # ][ # # ]: 0 : rtl::OUString sBookmark(INetURLObject::decode(pBookmark->GetValue(), '%', INetURLObject::DECODE_WITH_CHARSET));
426 : :
427 [ # # ][ # # ]: 0 : rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
428 [ # # ][ # # ]: 0 : if(xSlideshow.is() && xSlideshow->isRunning())
[ # # ][ # # ]
429 : : {
430 [ # # ]: 0 : xSlideshow->jumpToBookmark(sBookmark);
431 : : }
432 : : else
433 : : {
434 [ # # ][ # # ]: 0 : GotoBookmark(sBookmark);
[ # # ]
435 : 0 : }
436 : : }
437 : : }
438 : 0 : rReq.Done();
439 : 0 : break;
440 : : }
441 : :
442 : : case SID_OUTPUT_QUALITY_COLOR:
443 : : case SID_OUTPUT_QUALITY_GRAYSCALE:
444 : : case SID_OUTPUT_QUALITY_BLACKWHITE:
445 : : case SID_OUTPUT_QUALITY_CONTRAST:
446 : : {
447 : 0 : ExecReq( rReq );
448 : 0 : break;
449 : : }
450 : :
451 : : case SID_MAIL_SCROLLBODY_PAGEDOWN:
452 : : {
453 : 0 : ExecReq( rReq );
454 : 0 : break;
455 : : }
456 : :
457 : : case SID_ATTR_YEAR2000:
458 : : {
459 [ # # ]: 0 : FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
460 [ # # ]: 0 : if (pFormShell != NULL)
461 : : {
462 : : const SfxPoolItem* pItem;
463 [ # # ]: 0 : if (rReq.GetArgs()->GetItemState(
464 [ # # ]: 0 : SID_ATTR_YEAR2000, sal_True, &pItem) == SFX_ITEM_SET)
465 : : pFormShell->SetY2KState (
466 [ # # ]: 0 : static_cast<const SfxUInt16Item*>(pItem)->GetValue());
467 : : }
468 : :
469 : 0 : rReq.Done();
470 : : }
471 : 0 : break;
472 : :
473 : : case SID_OPT_LOCALE_CHANGED:
474 : : {
475 : 0 : GetActiveWindow()->Invalidate();
476 : 0 : UpdatePreview( mpActualPage );
477 : 0 : rReq.Done();
478 : : }
479 : :
480 : : default:
481 : 142 : break;
482 : : }
483 : : }
484 : :
485 : : /*************************************************************************
486 : : |*
487 : : |* SfxRequests fuer Lineale bearbeiten
488 : : |*
489 : : \************************************************************************/
490 : :
491 : 0 : void DrawViewShell::ExecRuler(SfxRequest& rReq)
492 : : {
493 : : // waehrend einer Diashow wird nichts ausgefuehrt!
494 [ # # ][ # # ]: 0 : if(HasCurrentFunction(SID_PRESENTATION))
495 : 0 : return;
496 : :
497 [ # # ]: 0 : CheckLineTo (rReq);
498 : :
499 : 0 : const SfxItemSet* pArgs = rReq.GetArgs();
500 [ # # ][ # # ]: 0 : const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
501 [ # # ]: 0 : Size aPageSize = mpActualPage->GetSize();
502 [ # # ][ # # ]: 0 : Size aViewSize = GetActiveWindow()->GetViewSize();
503 : 0 : SdUndoGroup* pUndoGroup = NULL;
504 : :
505 [ # # # # ]: 0 : if ( rReq.GetSlot() == SID_ATTR_LONG_LRSPACE ||
[ # # ]
506 : 0 : rReq.GetSlot() == SID_ATTR_LONG_ULSPACE )
507 : : {
508 [ # # ][ # # ]: 0 : pUndoGroup = new SdUndoGroup(GetDoc());
[ # # ]
509 [ # # ][ # # ]: 0 : String aString(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
510 [ # # ][ # # ]: 0 : pUndoGroup->SetComment(aString);
511 : : }
512 : :
513 [ # # # # : 0 : switch ( rReq.GetSlot() )
# # ]
514 : : {
515 : : case SID_ATTR_LONG_LRSPACE:
516 : : {
517 : : const SvxLongLRSpaceItem& rLRSpace = (const SvxLongLRSpaceItem&)
518 [ # # ][ # # ]: 0 : pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_LRSPACE));
519 : :
520 [ # # ][ # # ]: 0 : if( mpDrawView->IsTextEdit() )
521 : : {
522 : 0 : Rectangle aRect = maMarkRect;
523 : 0 : aRect.SetPos(aRect.TopLeft() + aPagePos);
524 : 0 : aRect.Left() = rLRSpace.GetLeft();
525 : 0 : aRect.Right() = aViewSize.Width() - rLRSpace.GetRight();
526 : 0 : aRect.SetPos(aRect.TopLeft() - aPagePos);
527 [ # # ][ # # ]: 0 : if ( aRect != maMarkRect)
528 : : {
529 [ # # ]: 0 : mpDrawView->SetAllMarkedRect(aRect);
530 [ # # ]: 0 : maMarkRect = mpDrawView->GetAllMarkedRect();
531 [ # # ]: 0 : Invalidate( SID_RULER_OBJECT );
532 : : }
533 : : }
534 : : else
535 : : {
536 : 0 : long nLeft = Max(0L, rLRSpace.GetLeft() - aPagePos.X());
537 : 0 : long nRight = Max(0L, rLRSpace.GetRight() + aPagePos.X() +
538 : 0 : aPageSize.Width() - aViewSize.Width());
539 : :
540 [ # # ][ # # ]: 0 : sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
541 : : sal_uInt16 i;
542 [ # # ]: 0 : for ( i = 0; i < nPageCnt; i++)
543 : : {
544 [ # # ][ # # ]: 0 : SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
545 : 0 : SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
546 : : pPage,
547 : 0 : pPage->GetLftBorder(),
548 : 0 : pPage->GetRgtBorder(),
549 [ # # ][ # # ]: 0 : nLeft, nRight);
[ # # ][ # # ]
[ # # ]
550 [ # # ]: 0 : pUndoGroup->AddAction(pUndo);
551 [ # # ]: 0 : pPage->SetLftBorder(nLeft);
552 [ # # ]: 0 : pPage->SetRgtBorder(nRight);
553 : : }
554 [ # # ][ # # ]: 0 : nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
555 : :
556 [ # # ]: 0 : for (i = 0; i < nPageCnt; i++)
557 : : {
558 [ # # ][ # # ]: 0 : SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
559 : 0 : SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
560 : : pPage,
561 : 0 : pPage->GetLftBorder(),
562 : 0 : pPage->GetRgtBorder(),
563 [ # # ][ # # ]: 0 : nLeft, nRight);
[ # # ][ # # ]
[ # # ]
564 [ # # ]: 0 : pUndoGroup->AddAction(pUndo);
565 [ # # ]: 0 : pPage->SetLftBorder(nLeft);
566 [ # # ]: 0 : pPage->SetRgtBorder(nRight);
567 : : }
568 [ # # ]: 0 : InvalidateWindows();
569 : : }
570 : 0 : break;
571 : : }
572 : : case SID_ATTR_LONG_ULSPACE:
573 : : {
574 : : const SvxLongULSpaceItem& rULSpace = (const SvxLongULSpaceItem&)
575 [ # # ][ # # ]: 0 : pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_ULSPACE));
576 : :
577 [ # # ][ # # ]: 0 : if( mpDrawView->IsTextEdit() )
578 : : {
579 : 0 : Rectangle aRect = maMarkRect;
580 : 0 : aRect.SetPos(aRect.TopLeft() + aPagePos);
581 : 0 : aRect.Top() = rULSpace.GetUpper();
582 : 0 : aRect.Bottom() = aViewSize.Height() - rULSpace.GetLower();
583 : 0 : aRect.SetPos(aRect.TopLeft() - aPagePos);
584 : :
585 [ # # ][ # # ]: 0 : if ( aRect != maMarkRect)
586 : : {
587 [ # # ]: 0 : mpDrawView->SetAllMarkedRect(aRect);
588 [ # # ]: 0 : maMarkRect = mpDrawView->GetAllMarkedRect();
589 [ # # ]: 0 : Invalidate( SID_RULER_OBJECT );
590 : : }
591 : : }
592 : : else
593 : : {
594 : 0 : long nUpper = Max(0L, rULSpace.GetUpper() - aPagePos.Y());
595 : 0 : long nLower = Max(0L, rULSpace.GetLower() + aPagePos.Y() +
596 : 0 : aPageSize.Height() - aViewSize.Height());
597 : :
598 [ # # ][ # # ]: 0 : sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
599 : : sal_uInt16 i;
600 [ # # ]: 0 : for ( i = 0; i < nPageCnt; i++)
601 : : {
602 [ # # ][ # # ]: 0 : SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
603 : 0 : SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
604 : : pPage,
605 : 0 : pPage->GetUppBorder(),
606 : 0 : pPage->GetLwrBorder(),
607 [ # # ][ # # ]: 0 : nUpper, nLower);
[ # # ][ # # ]
[ # # ]
608 [ # # ]: 0 : pUndoGroup->AddAction(pUndo);
609 [ # # ]: 0 : pPage->SetUppBorder(nUpper);
610 [ # # ]: 0 : pPage->SetLwrBorder(nLower);
611 : : }
612 [ # # ][ # # ]: 0 : nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
613 : :
614 [ # # ]: 0 : for (i = 0; i < nPageCnt; i++)
615 : : {
616 [ # # ][ # # ]: 0 : SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
617 : 0 : SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
618 : : pPage,
619 : 0 : pPage->GetUppBorder(),
620 : 0 : pPage->GetLwrBorder(),
621 [ # # ][ # # ]: 0 : nUpper, nLower);
[ # # ][ # # ]
[ # # ]
622 [ # # ]: 0 : pUndoGroup->AddAction(pUndo);
623 [ # # ]: 0 : pPage->SetUppBorder(nUpper);
624 [ # # ]: 0 : pPage->SetLwrBorder(nLower);
625 : : }
626 [ # # ]: 0 : InvalidateWindows();
627 : : }
628 : 0 : break;
629 : : }
630 : :
631 : : case SID_RULER_OBJECT:
632 : : {
633 : 0 : Rectangle aRect = maMarkRect;
634 : 0 : aRect.SetPos(aRect.TopLeft() + aPagePos);
635 : :
636 : : const SvxObjectItem& rOI = (const SvxObjectItem&)
637 [ # # ][ # # ]: 0 : pArgs->Get(GetPool().GetWhich(SID_RULER_OBJECT));
638 : :
639 [ # # ]: 0 : if ( rOI.GetStartX() != rOI.GetEndX() )
640 : : {
641 : 0 : aRect.Left() = rOI.GetStartX();
642 : 0 : aRect.Right() = rOI.GetEndX();
643 : : }
644 [ # # ]: 0 : if ( rOI.GetStartY() != rOI.GetEndY() )
645 : : {
646 : 0 : aRect.Top() = rOI.GetStartY();
647 : 0 : aRect.Bottom() = rOI.GetEndY();
648 : : }
649 : 0 : aRect.SetPos(aRect.TopLeft() - aPagePos);
650 [ # # ][ # # ]: 0 : if ( aRect != maMarkRect)
651 : : {
652 [ # # ]: 0 : mpDrawView->SetAllMarkedRect(aRect);
653 [ # # ]: 0 : maMarkRect = mpDrawView->GetAllMarkedRect();
654 [ # # ]: 0 : Invalidate( SID_RULER_OBJECT );
655 : : }
656 : : break;
657 : : }
658 : :
659 : : case SID_ATTR_TABSTOP:
660 : : {
661 [ # # ][ # # ]: 0 : if( mpDrawView->IsTextEdit() )
662 : : {
663 : : const SvxTabStopItem& rItem = (const SvxTabStopItem&)
664 [ # # ]: 0 : pArgs->Get( EE_PARA_TABS );
665 : :
666 [ # # ]: 0 : SfxItemSet aEditAttr( GetPool(), EE_PARA_TABS, EE_PARA_TABS );
667 : :
668 [ # # ]: 0 : aEditAttr.Put( rItem );
669 [ # # ]: 0 : mpDrawView->SetAttributes( aEditAttr );
670 : :
671 [ # # ][ # # ]: 0 : Invalidate(SID_ATTR_TABSTOP);
672 : : }
673 : 0 : break;
674 : : }
675 : :
676 : : case SID_ATTR_PARA_LRSPACE:
677 : : {
678 [ # # ][ # # ]: 0 : if( mpDrawView->IsTextEdit() )
679 : : {
680 : 0 : sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
681 : : const SvxLRSpaceItem& rItem = (const SvxLRSpaceItem&)
682 [ # # ]: 0 : pArgs->Get( nId );
683 : :
684 : : static const sal_uInt16 aWhichTable[]=
685 : : {
686 : : EE_PARA_OUTLLEVEL, EE_PARA_OUTLLEVEL,
687 : : EE_PARA_LRSPACE, EE_PARA_LRSPACE,
688 : : EE_PARA_NUMBULLET, EE_PARA_NUMBULLET,
689 : : 0, 0
690 : : };
691 : :
692 [ # # ]: 0 : SfxItemSet aEditAttr( GetDoc()->GetPool(),
693 [ # # ]: 0 : aWhichTable );
694 [ # # ]: 0 : mpDrawView->GetAttributes( aEditAttr );
695 : :
696 : 0 : nId = EE_PARA_LRSPACE;
697 : : SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
698 : : rItem.GetRight(), rItem.GetTxtLeft(),
699 [ # # ]: 0 : rItem.GetTxtFirstLineOfst(), nId );
700 : :
701 [ # # ]: 0 : const sal_Int16 nOutlineLevel = ((const SfxInt16Item&)aEditAttr.Get( EE_PARA_OUTLLEVEL )).GetValue();
702 [ # # ]: 0 : const SvxLRSpaceItem& rOrigLRSpaceItem = (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE );
703 [ # # ]: 0 : const SvxNumBulletItem& rNumBulletItem = (const SvxNumBulletItem&) aEditAttr.Get( EE_PARA_NUMBULLET );
704 [ # # # # : 0 : if( nOutlineLevel != -1 &&
# # ][ # # ]
705 : 0 : rNumBulletItem.GetNumRule() &&
706 : 0 : rNumBulletItem.GetNumRule()->GetLevelCount() > nOutlineLevel )
707 : : {
708 [ # # ]: 0 : const SvxNumberFormat& rFormat = rNumBulletItem.GetNumRule()->GetLevel(nOutlineLevel);
709 [ # # ]: 0 : SvxNumberFormat aFormat(rFormat);
710 : :
711 : : // left margin gets distributed onto LRSpace item
712 : : // and number format AbsLSpace - this fixes
713 : : // n#707779 (previously, LRSpace left indent could
714 : : // become negative - EditEngine really does not
715 : : // like that.
716 [ # # ]: 0 : const short nAbsLSpace=aFormat.GetAbsLSpace();
717 : 0 : const long nTxtLeft=rItem.GetTxtLeft();
718 [ # # ]: 0 : const long nLeftIndent=std::max(0L,nTxtLeft - nAbsLSpace);
719 [ # # ]: 0 : aLRSpaceItem.SetTxtLeft(nLeftIndent);
720 : : // control for clipped left indent - remainder
721 : : // reduces number format first line indent
722 : 0 : aFormat.SetAbsLSpace(nTxtLeft - nLeftIndent);
723 : :
724 : : // negative first line indent goes to the number
725 : : // format, positive to the lrSpace item
726 [ # # ]: 0 : if( rItem.GetTxtFirstLineOfst() < 0 )
727 : : {
728 : : aFormat.SetFirstLineOffset(
729 : 0 : rItem.GetTxtFirstLineOfst()
730 : 0 : - rOrigLRSpaceItem.GetTxtFirstLineOfst()
731 [ # # ]: 0 : + aFormat.GetCharTextDistance());
732 [ # # ]: 0 : aLRSpaceItem.SetTxtFirstLineOfst(0);
733 : : }
734 : : else
735 : : {
736 : 0 : aFormat.SetFirstLineOffset(0);
737 : : aLRSpaceItem.SetTxtFirstLineOfst(
738 : 0 : rItem.GetTxtFirstLineOfst()
739 [ # # ]: 0 : - aFormat.GetFirstLineOffset()
740 [ # # ][ # # ]: 0 : + aFormat.GetCharTextDistance());
741 : : }
742 : :
743 [ # # ][ # # ]: 0 : if( rFormat != aFormat )
744 : : {
745 : : // put all items
746 [ # # ]: 0 : SvxNumBulletItem aNumBulletItem(rNumBulletItem);
747 [ # # ]: 0 : aNumBulletItem.GetNumRule()->SetLevel(nOutlineLevel,aFormat);
748 [ # # ]: 0 : aEditAttr.Put( aNumBulletItem );
749 [ # # ]: 0 : aEditAttr.Put( aLRSpaceItem );
750 [ # # ]: 0 : mpDrawView->SetAttributes( aEditAttr );
751 : :
752 [ # # ]: 0 : Invalidate(SID_ATTR_PARA_LRSPACE);
753 [ # # ]: 0 : break;
754 [ # # ][ # # ]: 0 : }
755 : : }
756 : :
757 : : // only put lrSpace item
758 [ # # ]: 0 : SfxItemSet aEditAttrReduced( GetDoc()->GetPool(),
759 [ # # ]: 0 : EE_PARA_LRSPACE, EE_PARA_LRSPACE );
760 [ # # ]: 0 : aEditAttrReduced.Put( aLRSpaceItem );
761 [ # # ]: 0 : mpDrawView->SetAttributes( aEditAttrReduced );
762 : :
763 [ # # ][ # # ]: 0 : Invalidate(SID_ATTR_PARA_LRSPACE);
[ # # ][ # # ]
[ # # ][ # # ]
764 : : }
765 : 0 : break;
766 : : }
767 : : }
768 [ # # ]: 0 : if ( pUndoGroup )
769 : : // Undo Gruppe dem Undo Manager uebergeben
770 [ # # ][ # # ]: 0 : GetViewFrame()->GetObjectShell()->GetUndoManager()->
[ # # ]
771 [ # # ]: 0 : AddUndoAction(pUndoGroup);
772 : : }
773 : :
774 : : /*************************************************************************
775 : : |*
776 : : |* Statuswerte der Lineale bestimmen
777 : : |*
778 : : \************************************************************************/
779 : 72 : void DrawViewShell::GetRulerState(SfxItemSet& rSet)
780 : : {
781 : 72 : Point aOrigin;
782 : :
783 [ + - ]: 72 : if (mpDrawView->GetSdrPageView())
784 : : {
785 : 72 : aOrigin = mpDrawView->GetSdrPageView()->GetPageOrigin();
786 : : }
787 : :
788 [ + - ][ + - ]: 72 : Size aViewSize = GetActiveWindow()->GetViewSize();
789 : :
790 [ + - ][ + - ]: 72 : const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
791 [ + - ]: 72 : Size aPageSize = mpActualPage->GetSize();
792 : :
793 : 72 : Rectangle aRect(aPagePos, Point( aViewSize.Width() - (aPagePos.X() + aPageSize.Width()),
794 [ + - ]: 144 : aViewSize.Height() - (aPagePos.Y() + aPageSize.Height())));
795 : :
796 [ + - ][ - + ]: 72 : if( mpDrawView->IsTextEdit() )
797 : : {
798 [ # # ][ # # ]: 0 : Point aPnt1 = GetActiveWindow()->GetWinViewPos();
799 [ # # ]: 0 : Rectangle aMinMaxRect = Rectangle( aPnt1, Size(ULONG_MAX, ULONG_MAX) );
800 [ # # ][ # # ]: 0 : rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aMinMaxRect) );
[ # # ]
801 : : }
802 : : else
803 : : {
804 [ + - ][ + - ]: 72 : rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aRect) );
[ + - ]
805 : : }
806 : :
807 [ + - ]: 72 : SvxLongLRSpaceItem aLRSpace(aPagePos.X() + mpActualPage->GetLftBorder(),
808 [ + - ]: 72 : aRect.Right() + mpActualPage->GetRgtBorder(),
809 [ + - ][ + - ]: 144 : GetPool().GetWhich(SID_ATTR_LONG_LRSPACE));
810 [ + - ]: 72 : SvxLongULSpaceItem aULSpace(aPagePos.Y() + mpActualPage->GetUppBorder(),
811 [ + - ]: 72 : aRect.Bottom() + mpActualPage->GetLwrBorder(),
812 [ + - ][ + - ]: 144 : GetPool().GetWhich(SID_ATTR_LONG_ULSPACE));
813 : 72 : rSet.Put(SvxPagePosSizeItem(Point(0,0) - aPagePos, aViewSize.Width(),
814 [ + - ][ + - ]: 144 : aViewSize.Height()));
[ + - ]
815 [ + - ]: 72 : SfxPointItem aPointItem( SID_RULER_NULL_OFFSET, aPagePos + aOrigin );
816 : :
817 [ + - ]: 72 : SvxProtectItem aProtect( SID_RULER_PROTECT );
818 : :
819 [ + - ]: 72 : maMarkRect = mpDrawView->GetAllMarkedRect();
820 : :
821 [ + - ][ + - ]: 72 : const sal_Bool bRTL = GetDoc() && GetDoc()->GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB;
[ + - ][ + - ]
[ - + ]
822 [ + - ][ + - ]: 72 : rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, bRTL));
[ + - ]
823 : :
824 [ + + ]: 72 : if( mpDrawView->AreObjectsMarked() )
825 : : {
826 [ + - ][ - + ]: 1 : if( mpDrawView->IsTextEdit() )
827 : : {
828 [ # # ][ # # ]: 0 : SdrObject* pObj = mpDrawView->GetMarkedObjectList().GetMark( 0 )->GetMarkedSdrObj();
829 [ # # ][ # # ]: 0 : if( pObj->GetObjInventor() == SdrInventor)
830 : : {
831 [ # # ][ # # ]: 0 : SfxItemSet aEditAttr( GetDoc()->GetPool() );
832 [ # # ]: 0 : mpDrawView->GetAttributes( aEditAttr );
833 [ # # ][ # # ]: 0 : if( aEditAttr.GetItemState( EE_PARA_TABS ) >= SFX_ITEM_AVAILABLE )
834 : : {
835 [ # # ]: 0 : const SvxTabStopItem& rItem = (const SvxTabStopItem&) aEditAttr.Get( EE_PARA_TABS );
836 [ # # ]: 0 : rSet.Put( rItem );
837 : :
838 [ # # ]: 0 : const SvxLRSpaceItem& rLRSpaceItem = (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE );
839 : 0 : sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
840 : : SvxLRSpaceItem aLRSpaceItem( rLRSpaceItem.GetLeft(),
841 : : rLRSpaceItem.GetRight(), rLRSpaceItem.GetTxtLeft(),
842 [ # # ]: 0 : rLRSpaceItem.GetTxtFirstLineOfst(), nId );
843 : :
844 [ # # ]: 0 : const sal_Int16 nOutlineLevel = ((const SfxInt16Item&)aEditAttr.Get( EE_PARA_OUTLLEVEL )).GetValue();
845 [ # # ]: 0 : const SvxNumBulletItem& rNumBulletItem = (const SvxNumBulletItem&) aEditAttr.Get( EE_PARA_NUMBULLET );
846 [ # # # # : 0 : if( nOutlineLevel != -1 &&
# # ][ # # ]
847 : 0 : rNumBulletItem.GetNumRule() &&
848 : 0 : rNumBulletItem.GetNumRule()->GetLevelCount() > nOutlineLevel )
849 : : {
850 [ # # ]: 0 : const SvxNumberFormat& rFormat = rNumBulletItem.GetNumRule()->GetLevel(nOutlineLevel);
851 [ # # ][ # # ]: 0 : aLRSpaceItem.SetTxtLeft(rFormat.GetAbsLSpace() + rLRSpaceItem.GetTxtLeft());
852 : : aLRSpaceItem.SetTxtFirstLineOfst(
853 [ # # ]: 0 : rLRSpaceItem.GetTxtFirstLineOfst() + rFormat.GetFirstLineOffset()
854 [ # # ][ # # ]: 0 : - rFormat.GetCharTextDistance());
855 : : }
856 : :
857 [ # # ]: 0 : rSet.Put( aLRSpaceItem );
858 : :
859 : 0 : Point aPos( aPagePos + maMarkRect.TopLeft() );
860 : :
861 [ # # ][ # # ]: 0 : if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SFX_ITEM_ON )
862 : : {
863 : : const SdrTextLeftDistItem& rTLDItem = (const SdrTextLeftDistItem&)
864 [ # # ]: 0 : aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
865 : 0 : long nLD = rTLDItem.GetValue();
866 : 0 : aPos.X() += nLD;
867 : : }
868 : :
869 : 0 : aPointItem.SetValue( aPos );
870 : :
871 : 0 : aLRSpace.SetLeft( aPagePos.X() + maMarkRect.Left() );
872 : :
873 [ # # ][ # # ]: 0 : if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SFX_ITEM_ON )
874 : : {
875 : : const SdrTextLeftDistItem& rTLDItem = (const SdrTextLeftDistItem&)
876 [ # # ]: 0 : aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
877 : 0 : long nLD = rTLDItem.GetValue();
878 : 0 : aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD );
879 : : }
880 : :
881 : 0 : aLRSpace.SetRight( aRect.Right() + aPageSize.Width() - maMarkRect.Right() );
882 : 0 : aULSpace.SetUpper( aPagePos.Y() + maMarkRect.Top() );
883 : 0 : aULSpace.SetLower( aRect.Bottom() + aPageSize.Height() - maMarkRect.Bottom() );
884 : :
885 [ # # ]: 0 : rSet.DisableItem( SID_RULER_OBJECT );
886 : :
887 : : // Seitenraender werden gelocked
888 : 0 : aProtect.SetSizeProtect( sal_True );
889 [ # # ]: 0 : aProtect.SetPosProtect( sal_True );
890 : : }
891 : :
892 [ # # ][ # # ]: 0 : if( aEditAttr.GetItemState( EE_PARA_WRITINGDIR ) >= SFX_ITEM_AVAILABLE )
893 : : {
894 [ # # ]: 0 : const SvxFrameDirectionItem& rItem = (const SvxFrameDirectionItem&) aEditAttr.Get( EE_PARA_WRITINGDIR );
895 [ # # ][ # # ]: 0 : rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == ::com::sun::star::text::WritingMode_RL_TB));
[ # # ]
896 [ # # ]: 0 : }
897 : : }
898 : : }
899 : : else
900 : : {
901 [ + - ]: 1 : rSet.DisableItem( EE_PARA_TABS );
902 [ + - ]: 1 : rSet.DisableItem( SID_RULER_TEXT_RIGHT_TO_LEFT );
903 : :
904 [ + - ][ + - ]: 1 : if( mpDrawView->IsResizeAllowed(sal_True) )
905 : : {
906 : 1 : Rectangle aResizeRect( maMarkRect );
907 : :
908 : 1 : aResizeRect.SetPos(aResizeRect.TopLeft() + aPagePos);
909 : 1 : SvxObjectItem aObjItem(aResizeRect.Left(), aResizeRect.Right(),
910 [ + - ]: 2 : aResizeRect.Top(), aResizeRect.Bottom());
911 [ + - ]: 1 : rSet.Put(aObjItem);
912 [ + - ][ + - ]: 1 : rSet.DisableItem( EE_PARA_TABS );
913 : : }
914 : : else
915 : : {
916 [ # # ]: 0 : rSet.DisableItem( SID_RULER_OBJECT );
917 : : }
918 : : }
919 : : }
920 : : else
921 : : {
922 [ + - ]: 71 : rSet.DisableItem( SID_RULER_OBJECT );
923 [ + - ]: 71 : rSet.DisableItem( EE_PARA_TABS );
924 : : }
925 : :
926 [ + - ]: 72 : rSet.Put( aLRSpace );
927 [ + - ]: 72 : rSet.Put( aULSpace );
928 : :
929 [ + - ]: 72 : rSet.Put( aPointItem );
930 [ + - ][ + - ]: 72 : rSet.Put( aProtect );
[ + - ][ + - ]
[ + - ]
931 : 72 : }
932 : :
933 : : /*************************************************************************
934 : : |*
935 : : |* SfxRequests fuer StatusBar bearbeiten
936 : : |*
937 : : \************************************************************************/
938 : :
939 : 0 : void DrawViewShell::ExecStatusBar(SfxRequest& rReq)
940 : : {
941 : : // waehrend einer Diashow wird nichts ausgefuehrt!
942 [ # # ]: 0 : if(HasCurrentFunction(SID_PRESENTATION))
943 : 0 : return;
944 : :
945 : 0 : CheckLineTo (rReq);
946 : :
947 [ # # # ]: 0 : switch ( rReq.GetSlot() )
948 : : {
949 : : case SID_ATTR_SIZE:
950 : : {
951 : 0 : GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_TRANSFORM, SFX_CALLMODE_ASYNCHRON );
952 : : }
953 : 0 : break;
954 : :
955 : : case SID_STATUS_LAYOUT:
956 : : {
957 : 0 : GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION_LAYOUT, SFX_CALLMODE_ASYNCHRON );
958 : : }
959 : 0 : break;
960 : : }
961 : : }
962 : :
963 : : /*************************************************************************
964 : : |*
965 : : |* Status der Snap-Objekt-Eintraege im Popup setzen
966 : : |*
967 : : \************************************************************************/
968 : :
969 : 0 : void DrawViewShell::GetSnapItemState( SfxItemSet &rSet )
970 : : {
971 : : SdrPageView* pPV;
972 [ # # ][ # # ]: 0 : Point aMPos = GetActiveWindow()->PixelToLogic(maMousePos);
973 [ # # ]: 0 : sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic(
974 [ # # ]: 0 : Size(FuPoor::HITPIX,0)).Width();
975 : : sal_uInt16 nHelpLine;
976 : :
977 [ # # ][ # # ]: 0 : if ( mpDrawView->PickHelpLine(aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
[ # # ]
978 : : {
979 [ # # ]: 0 : const SdrHelpLine& rHelpLine = (pPV->GetHelpLines())[nHelpLine];
980 : :
981 [ # # ]: 0 : if ( rHelpLine.GetKind() == SDRHELPLINE_POINT )
982 : : {
983 : : rSet.Put( SfxStringItem( SID_SET_SNAPITEM,
984 [ # # ][ # # ]: 0 : String( SdResId( STR_POPUP_EDIT_SNAPPOINT))) );
[ # # ][ # # ]
[ # # ][ # # ]
985 : : rSet.Put( SfxStringItem( SID_DELETE_SNAPITEM,
986 [ # # ][ # # ]: 0 : String( SdResId( STR_POPUP_DELETE_SNAPPOINT))) );
[ # # ][ # # ]
[ # # ][ # # ]
987 : : }
988 : : else
989 : : {
990 : : rSet.Put( SfxStringItem( SID_SET_SNAPITEM,
991 [ # # ][ # # ]: 0 : String( SdResId( STR_POPUP_EDIT_SNAPLINE))) );
[ # # ][ # # ]
[ # # ][ # # ]
992 : : rSet.Put( SfxStringItem( SID_DELETE_SNAPITEM,
993 [ # # ][ # # ]: 0 : String( SdResId( STR_POPUP_DELETE_SNAPLINE))) );
[ # # ][ # # ]
[ # # ][ # # ]
994 : : }
995 : : }
996 : 0 : }
997 : :
998 : 0 : void DrawViewShell::AddWindow (::sd::Window* pWin)
999 : : {
1000 : 0 : mpDrawView->AddWindowToPaintView(pWin);
1001 : 0 : }
1002 : :
1003 : 0 : void DrawViewShell::RemoveWindow(::sd::Window* pWin)
1004 : : {
1005 : 0 : mpDrawView->DeleteWindowFromPaintView(pWin);
1006 : 0 : }
1007 : :
1008 : : } // end of namespace sd
1009 : :
1010 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|