15b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
35b190011SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
45b190011SAndrew Rist * or more contributor license agreements. See the NOTICE file
55b190011SAndrew Rist * distributed with this work for additional information
65b190011SAndrew Rist * regarding copyright ownership. The ASF licenses this file
75b190011SAndrew Rist * to you under the Apache License, Version 2.0 (the
85b190011SAndrew Rist * "License"); you may not use this file except in compliance
95b190011SAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
115b190011SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
135b190011SAndrew Rist * Unless required by applicable law or agreed to in writing,
145b190011SAndrew Rist * software distributed under the License is distributed on an
155b190011SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165b190011SAndrew Rist * KIND, either express or implied. See the License for the
175b190011SAndrew Rist * specific language governing permissions and limitations
185b190011SAndrew Rist * under the License.
19cdf0e10cSrcweir *
205b190011SAndrew Rist *************************************************************/
215b190011SAndrew Rist
225b190011SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include "DrawViewShell.hxx"
28cdf0e10cSrcweir
29cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
30cdf0e10cSrcweir #include <editeng/eeitem.hxx>
31cdf0e10cSrcweir #include <editeng/tstpitem.hxx>
32cdf0e10cSrcweir #include <editeng/lrspitem.hxx>
33cdf0e10cSrcweir #include <editeng/protitem.hxx>
34cdf0e10cSrcweir #include <editeng/frmdiritem.hxx>
35512ec161SZheng Fan #include <editeng/adjitem.hxx>
36cdf0e10cSrcweir #include <svx/ruler.hxx>
37cdf0e10cSrcweir #ifndef _SVX_RULERITEM_HXX
38cdf0e10cSrcweir #include <svx/rulritem.hxx>
39cdf0e10cSrcweir #endif
40cdf0e10cSrcweir #include <svx/zoomitem.hxx>
41cdf0e10cSrcweir #ifndef _SVXIDS_HRC
42cdf0e10cSrcweir #include <svx/svxids.hrc>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #include <svx/svdpagv.hxx>
45cdf0e10cSrcweir #include <sfx2/request.hxx>
46cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
47cdf0e10cSrcweir #include <tools/urlobj.hxx>
48cdf0e10cSrcweir #include <svl/aeitem.hxx>
49cdf0e10cSrcweir #include <svl/eitem.hxx>
50cdf0e10cSrcweir #include <svl/rectitem.hxx>
51cdf0e10cSrcweir #include <svl/stritem.hxx>
52cdf0e10cSrcweir #include <svx/svdoole2.hxx>
53cdf0e10cSrcweir #include <svl/itempool.hxx>
54cdf0e10cSrcweir #include <svl/ptitem.hxx>
55cdf0e10cSrcweir #include <basic/sbstar.hxx>
56cdf0e10cSrcweir #include <basic/sberrors.hxx>
57cdf0e10cSrcweir #include <svx/fmshell.hxx>
58cdf0e10cSrcweir #include <svx/f3dchild.hxx>
59cdf0e10cSrcweir #include <svx/float3d.hxx>
60cdf0e10cSrcweir #include "optsitem.hxx"
61cdf0e10cSrcweir
62cdf0e10cSrcweir #include "app.hrc"
63cdf0e10cSrcweir #include "glob.hrc"
64cdf0e10cSrcweir #include "strings.hrc"
65cdf0e10cSrcweir #include "res_bmp.hrc"
66cdf0e10cSrcweir
67cdf0e10cSrcweir #include "sdundogr.hxx"
68cdf0e10cSrcweir #include "undopage.hxx"
69cdf0e10cSrcweir #include "glob.hxx"
70cdf0e10cSrcweir #include "app.hxx"
71cdf0e10cSrcweir #include "fupoor.hxx"
72cdf0e10cSrcweir #include "slideshow.hxx"
73cdf0e10cSrcweir #ifndef SD_FRAME_VIEW
74cdf0e10cSrcweir #include "FrameView.hxx"
75cdf0e10cSrcweir #endif
76cdf0e10cSrcweir #include "sdpage.hxx"
77cdf0e10cSrcweir #include "Window.hxx"
78cdf0e10cSrcweir #include "sdresid.hxx"
79cdf0e10cSrcweir #include "drawview.hxx"
80cdf0e10cSrcweir #include "drawdoc.hxx"
81cdf0e10cSrcweir #include "DrawViewShell.hxx"
82cdf0e10cSrcweir #include "Ruler.hxx"
83cdf0e10cSrcweir #include "DrawDocShell.hxx"
84cdf0e10cSrcweir #include "headerfooterdlg.hxx"
85cdf0e10cSrcweir #include "masterlayoutdlg.hxx"
86cdf0e10cSrcweir #include "Ruler.hxx"
87cdf0e10cSrcweir #include "DrawDocShell.hxx"
88cdf0e10cSrcweir #include "sdabstdlg.hxx"
89cdf0e10cSrcweir #include <sfx2/ipclient.hxx>
90cdf0e10cSrcweir #include <tools/diagnose_ex.h>
91cdf0e10cSrcweir #include "ViewShellBase.hxx"
92cdf0e10cSrcweir #include "FormShellManager.hxx"
93cdf0e10cSrcweir #include "LayerTabBar.hxx"
94cdf0e10cSrcweir #include "sdabstdlg.hxx"
95cdf0e10cSrcweir #include "sdpage.hxx"
96cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XControllerManager.hpp>
97cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
98cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XConfiguration.hpp>
99cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
100766ce4d0SZheng Fan #include <editeng/lspcitem.hxx>
101766ce4d0SZheng Fan #include <editeng/ulspitem.hxx>
102cdf0e10cSrcweir using namespace ::com::sun::star::uno;
103cdf0e10cSrcweir using namespace ::com::sun::star::drawing::framework;
104cdf0e10cSrcweir using ::com::sun::star::frame::XFrame;
105cdf0e10cSrcweir using ::com::sun::star::frame::XController;
106cdf0e10cSrcweir
107cdf0e10cSrcweir namespace sd {
108cdf0e10cSrcweir
109cdf0e10cSrcweir #ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED
110cdf0e10cSrcweir #define SO2_DECL_SVINPLACEOBJECT_DEFINED
SO2_DECL_REF(SvInPlaceObject)111cdf0e10cSrcweir SO2_DECL_REF(SvInPlaceObject)
112cdf0e10cSrcweir #endif
113cdf0e10cSrcweir
114cdf0e10cSrcweir
115cdf0e10cSrcweir
116cdf0e10cSrcweir /*************************************************************************
117cdf0e10cSrcweir |*
118cdf0e10cSrcweir |* SfxRequests fuer Controller bearbeiten
119cdf0e10cSrcweir |*
120cdf0e10cSrcweir \************************************************************************/
121cdf0e10cSrcweir
122cdf0e10cSrcweir void DrawViewShell::ExecCtrl(SfxRequest& rReq)
123cdf0e10cSrcweir {
124cdf0e10cSrcweir // waehrend einer Diashow wird nichts ausser dem Seitenwechsel und dem
125cdf0e10cSrcweir // Sprung zur Bookmark ausgefuehrt!
126cdf0e10cSrcweir if( HasCurrentFunction(SID_PRESENTATION) &&
127cdf0e10cSrcweir rReq.GetSlot() != SID_SWITCHPAGE &&
128cdf0e10cSrcweir rReq.GetSlot() != SID_JUMPTOMARK)
129cdf0e10cSrcweir return;
130cdf0e10cSrcweir
131cdf0e10cSrcweir CheckLineTo (rReq);
132cdf0e10cSrcweir
133cdf0e10cSrcweir // End text edit mode for some requests.
134cdf0e10cSrcweir sal_uInt16 nSlot = rReq.GetSlot();
135cdf0e10cSrcweir switch (nSlot)
136cdf0e10cSrcweir {
137cdf0e10cSrcweir case SID_OUTPUT_QUALITY_COLOR:
138cdf0e10cSrcweir case SID_OUTPUT_QUALITY_GRAYSCALE:
139cdf0e10cSrcweir case SID_OUTPUT_QUALITY_BLACKWHITE:
140cdf0e10cSrcweir case SID_OUTPUT_QUALITY_CONTRAST:
141cdf0e10cSrcweir // Do nothing.
142cdf0e10cSrcweir break;
143cdf0e10cSrcweir default:
144cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() )
145cdf0e10cSrcweir {
146cdf0e10cSrcweir mpDrawView->SdrEndTextEdit();
147cdf0e10cSrcweir }
148cdf0e10cSrcweir }
149cdf0e10cSrcweir
150cdf0e10cSrcweir // sal_uInt16 nSlot = rReq.GetSlot();
151cdf0e10cSrcweir switch (nSlot)
152cdf0e10cSrcweir {
153cdf0e10cSrcweir case SID_SWITCHPAGE: // BASIC
154cdf0e10cSrcweir {
155cdf0e10cSrcweir sal_Bool bWasBasic = sal_False;
156cdf0e10cSrcweir
157cdf0e10cSrcweir // switch page in running slide show
158cdf0e10cSrcweir if(SlideShow::IsRunning(GetViewShellBase()) && rReq.GetArgs())
159cdf0e10cSrcweir {
160cdf0e10cSrcweir SFX_REQUEST_ARG(rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE, sal_False);
161cdf0e10cSrcweir SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber((sal_Int32)((pWhatPage->GetValue()-1)>>1));
162cdf0e10cSrcweir }
163cdf0e10cSrcweir else
164cdf0e10cSrcweir {
165cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs ();
166cdf0e10cSrcweir sal_uInt16 nSelectedPage = 0;
167cdf0e10cSrcweir
168cdf0e10cSrcweir if (! pArgs)
169cdf0e10cSrcweir {
170cdf0e10cSrcweir nSelectedPage = maTabControl.GetCurPageId() - 1;
171cdf0e10cSrcweir }
172cdf0e10cSrcweir else if (pArgs->Count () == 2)
173cdf0e10cSrcweir {
174cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE, sal_False);
175cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND, sal_False);
176cdf0e10cSrcweir
177cdf0e10cSrcweir sal_Int32 nWhatPage = (sal_Int32)pWhatPage->GetValue ();
178cdf0e10cSrcweir sal_Int32 nWhatKind = (sal_Int32)pWhatKind->GetValue ();
179cdf0e10cSrcweir if (! CHECK_RANGE (PK_STANDARD, nWhatKind, PK_HANDOUT))
180cdf0e10cSrcweir {
181cdf0e10cSrcweir StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
182cdf0e10cSrcweir rReq.Ignore ();
183cdf0e10cSrcweir break;
184cdf0e10cSrcweir }
185cdf0e10cSrcweir else if (meEditMode != EM_MASTERPAGE)
186cdf0e10cSrcweir {
187cdf0e10cSrcweir if (! CHECK_RANGE (0, nWhatPage, GetDoc()->GetSdPageCount((PageKind)nWhatKind)))
188cdf0e10cSrcweir {
189cdf0e10cSrcweir StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
190cdf0e10cSrcweir rReq.Ignore ();
191cdf0e10cSrcweir break;
192cdf0e10cSrcweir }
193cdf0e10cSrcweir
194cdf0e10cSrcweir nSelectedPage = (short) nWhatPage;
195cdf0e10cSrcweir mePageKind = (PageKind) nWhatKind;
196cdf0e10cSrcweir bWasBasic = sal_True;
197cdf0e10cSrcweir }
198cdf0e10cSrcweir }
199cdf0e10cSrcweir else
200cdf0e10cSrcweir {
201cdf0e10cSrcweir StarBASIC::FatalError (SbERR_WRONG_ARGS);
202cdf0e10cSrcweir rReq.Ignore ();
203cdf0e10cSrcweir break;
204cdf0e10cSrcweir }
205cdf0e10cSrcweir
206cdf0e10cSrcweir
207cdf0e10cSrcweir if( GetDocSh() && (GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED))
208cdf0e10cSrcweir GetDocSh()->SetModified();
209cdf0e10cSrcweir
210cdf0e10cSrcweir SwitchPage(nSelectedPage);
211cdf0e10cSrcweir
212cdf0e10cSrcweir if(HasCurrentFunction(SID_BEZIER_EDIT))
213cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
214cdf0e10cSrcweir
215cdf0e10cSrcweir Invalidate();
216cdf0e10cSrcweir InvalidateWindows();
217cdf0e10cSrcweir rReq.Done ();
218cdf0e10cSrcweir }
219cdf0e10cSrcweir break;
220cdf0e10cSrcweir }
221cdf0e10cSrcweir
222cdf0e10cSrcweir case SID_SWITCHLAYER: // BASIC
223cdf0e10cSrcweir {
224cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs ();
225cdf0e10cSrcweir
226*2d19362eSArmin Le Grand // #87182#
227*2d19362eSArmin Le Grand bool bCurPageValid(false);
228*2d19362eSArmin Le Grand sal_uInt16 nCurPage(0);
229*2d19362eSArmin Le Grand
230*2d19362eSArmin Le Grand if(GetLayerTabControl())
231cdf0e10cSrcweir {
232*2d19362eSArmin Le Grand nCurPage = GetLayerTabControl()->GetCurPageId();
233*2d19362eSArmin Le Grand bCurPageValid = true;
234cdf0e10cSrcweir }
235cdf0e10cSrcweir
236*2d19362eSArmin Le Grand if(pArgs && 1 == pArgs->Count())
237*2d19362eSArmin Le Grand {
238*2d19362eSArmin Le Grand SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
239*2d19362eSArmin Le Grand
240*2d19362eSArmin Le Grand if(pWhatLayer)
241*2d19362eSArmin Le Grand {
242*2d19362eSArmin Le Grand nCurPage = (short)pWhatLayer->GetValue();
243*2d19362eSArmin Le Grand bCurPageValid = true;
244*2d19362eSArmin Le Grand }
245*2d19362eSArmin Le Grand }
246*2d19362eSArmin Le Grand
247*2d19362eSArmin Le Grand if(bCurPageValid)
248*2d19362eSArmin Le Grand {
249cdf0e10cSrcweir mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) );
250cdf0e10cSrcweir Invalidate();
251*2d19362eSArmin Le Grand }
252*2d19362eSArmin Le Grand
253cdf0e10cSrcweir rReq.Done ();
254cdf0e10cSrcweir
255cdf0e10cSrcweir break;
256cdf0e10cSrcweir }
257cdf0e10cSrcweir
258cdf0e10cSrcweir case SID_PAGEMODE: // BASIC
259cdf0e10cSrcweir {
260cdf0e10cSrcweir
261cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs ();
262cdf0e10cSrcweir
263cdf0e10cSrcweir if ( pArgs && pArgs->Count () == 2)
264cdf0e10cSrcweir {
265cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, ID_VAL_ISACTIVE, sal_False);
266cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND, sal_False);
267cdf0e10cSrcweir
268cdf0e10cSrcweir sal_Int32 nWhatKind = (sal_Int32)pWhatKind->GetValue ();
269cdf0e10cSrcweir if (CHECK_RANGE (PK_STANDARD, nWhatKind, PK_HANDOUT))
270cdf0e10cSrcweir {
271cdf0e10cSrcweir mbIsLayerModeActive = pIsActive->GetValue ();
272cdf0e10cSrcweir mePageKind = (PageKind) nWhatKind;
273cdf0e10cSrcweir }
274cdf0e10cSrcweir }
275cdf0e10cSrcweir
276cdf0e10cSrcweir // Default-Layer der Page einschalten
277cdf0e10cSrcweir mpDrawView->SetActiveLayer( String( SdResId(STR_LAYER_LAYOUT) ) );
278cdf0e10cSrcweir
279cdf0e10cSrcweir ChangeEditMode(EM_PAGE, mbIsLayerModeActive);
280cdf0e10cSrcweir
281cdf0e10cSrcweir Invalidate();
282cdf0e10cSrcweir rReq.Done ();
283cdf0e10cSrcweir
284cdf0e10cSrcweir break;
285cdf0e10cSrcweir }
286cdf0e10cSrcweir
287cdf0e10cSrcweir case SID_LAYERMODE: // BASIC
288cdf0e10cSrcweir {
289cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs ();
290cdf0e10cSrcweir
291cdf0e10cSrcweir if ( pArgs && pArgs->Count () == 2)
292cdf0e10cSrcweir {
293cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatLayerMode, SfxBoolItem, ID_VAL_ISACTIVE, sal_False);
294cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
295cdf0e10cSrcweir
296cdf0e10cSrcweir sal_Int32 nWhatLayer = (sal_Int32)pWhatLayer->GetValue ();
297cdf0e10cSrcweir if (CHECK_RANGE (EM_PAGE, nWhatLayer, EM_MASTERPAGE))
298cdf0e10cSrcweir {
299cdf0e10cSrcweir mbIsLayerModeActive = pWhatLayerMode->GetValue ();
300cdf0e10cSrcweir meEditMode = (EditMode) nWhatLayer;
301cdf0e10cSrcweir }
302cdf0e10cSrcweir }
303cdf0e10cSrcweir
304cdf0e10cSrcweir ChangeEditMode(meEditMode, !mbIsLayerModeActive);
305cdf0e10cSrcweir
306cdf0e10cSrcweir Invalidate();
307cdf0e10cSrcweir rReq.Done ();
308cdf0e10cSrcweir
309cdf0e10cSrcweir break;
310cdf0e10cSrcweir }
311cdf0e10cSrcweir
312cdf0e10cSrcweir case SID_HEADER_AND_FOOTER:
313cdf0e10cSrcweir case SID_INSERT_PAGE_NUMBER:
314cdf0e10cSrcweir case SID_INSERT_DATE_TIME:
315cdf0e10cSrcweir {
316cdf0e10cSrcweir SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
317cdf0e10cSrcweir AbstractHeaderFooterDialog* pDlg = pFact ? pFact->CreateHeaderFooterDialog( (::ViewShell*)this, GetActiveWindow(), GetDoc(), mpActualPage ) : 0;
318cdf0e10cSrcweir if( pDlg )
319cdf0e10cSrcweir {
320cdf0e10cSrcweir pDlg->Execute();
321cdf0e10cSrcweir delete pDlg;
322cdf0e10cSrcweir
323cdf0e10cSrcweir GetActiveWindow()->Invalidate();
324cdf0e10cSrcweir UpdatePreview( mpActualPage );
325cdf0e10cSrcweir }
326cdf0e10cSrcweir
327cdf0e10cSrcweir Invalidate();
328cdf0e10cSrcweir rReq.Done ();
329cdf0e10cSrcweir
330cdf0e10cSrcweir break;
331cdf0e10cSrcweir }
332cdf0e10cSrcweir
333cdf0e10cSrcweir case SID_MASTER_LAYOUTS:
334cdf0e10cSrcweir {
335cdf0e10cSrcweir SdPage* pPage = GetActualPage();
336cdf0e10cSrcweir if (meEditMode == EM_MASTERPAGE)
337cdf0e10cSrcweir // Use the master page of the current page.
338cdf0e10cSrcweir pPage = static_cast<SdPage*>(&pPage->TRG_GetMasterPage());
339cdf0e10cSrcweir
340cdf0e10cSrcweir SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
341cdf0e10cSrcweir VclAbstractDialog* pDlg = pFact ? pFact->CreateMasterLayoutDialog( GetActiveWindow(), GetDoc(), pPage ) : 0;
342cdf0e10cSrcweir if( pDlg )
343cdf0e10cSrcweir {
344cdf0e10cSrcweir pDlg->Execute();
345cdf0e10cSrcweir delete pDlg;
346cdf0e10cSrcweir Invalidate();
347cdf0e10cSrcweir }
348cdf0e10cSrcweir rReq.Done ();
349cdf0e10cSrcweir break;
350cdf0e10cSrcweir }
351cdf0e10cSrcweir case SID_OBJECTRESIZE:
352cdf0e10cSrcweir {
353cdf0e10cSrcweir /******************************************************************
354cdf0e10cSrcweir * Der Server moechte die Clientgrosse verandern
355cdf0e10cSrcweir ******************************************************************/
356cdf0e10cSrcweir OSL_ASSERT (GetViewShell()!=NULL);
357cdf0e10cSrcweir SfxInPlaceClient* pIPClient = GetViewShell()->GetIPClient();
358cdf0e10cSrcweir
359cdf0e10cSrcweir if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
360cdf0e10cSrcweir {
361cdf0e10cSrcweir const SfxRectangleItem& rRect =
362cdf0e10cSrcweir (SfxRectangleItem&)rReq.GetArgs()->Get(SID_OBJECTRESIZE);
363cdf0e10cSrcweir Rectangle aRect( GetActiveWindow()->PixelToLogic( rRect.GetValue() ) );
364cdf0e10cSrcweir
365cdf0e10cSrcweir if ( mpDrawView->AreObjectsMarked() )
366cdf0e10cSrcweir {
367cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
368cdf0e10cSrcweir
369cdf0e10cSrcweir if (rMarkList.GetMarkCount() == 1)
370cdf0e10cSrcweir {
371cdf0e10cSrcweir SdrMark* pMark = rMarkList.GetMark(0);
372cdf0e10cSrcweir SdrObject* pObj = pMark->GetMarkedSdrObj();
373cdf0e10cSrcweir
374cdf0e10cSrcweir SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( pObj );
375cdf0e10cSrcweir if(pOle2Obj)
376cdf0e10cSrcweir {
377cdf0e10cSrcweir if( pOle2Obj->GetObjRef().is() )
378cdf0e10cSrcweir {
379cdf0e10cSrcweir pOle2Obj->SetLogicRect(aRect);
380cdf0e10cSrcweir }
381cdf0e10cSrcweir }
382cdf0e10cSrcweir }
383cdf0e10cSrcweir }
384cdf0e10cSrcweir }
385cdf0e10cSrcweir rReq.Ignore ();
386cdf0e10cSrcweir break;
387cdf0e10cSrcweir }
388cdf0e10cSrcweir
389cdf0e10cSrcweir case SID_RELOAD:
390cdf0e10cSrcweir {
391cdf0e10cSrcweir // #83951#
392cdf0e10cSrcweir sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId();
393cdf0e10cSrcweir SfxViewFrame* pFrame = GetViewFrame();
394cdf0e10cSrcweir
395cdf0e10cSrcweir try
396cdf0e10cSrcweir {
397cdf0e10cSrcweir Reference< XFrame > xFrame( pFrame->GetFrame().GetFrameInterface(), UNO_SET_THROW );
398cdf0e10cSrcweir
399cdf0e10cSrcweir // Save the current configuration of panes and views.
400cdf0e10cSrcweir Reference<XControllerManager> xControllerManager (
401cdf0e10cSrcweir GetViewShellBase().GetController(), UNO_QUERY_THROW);
402cdf0e10cSrcweir Reference<XConfigurationController> xConfigurationController (
403cdf0e10cSrcweir xControllerManager->getConfigurationController(), UNO_QUERY_THROW );
404cdf0e10cSrcweir Reference<XConfiguration> xConfiguration (
405cdf0e10cSrcweir xConfigurationController->getRequestedConfiguration(), UNO_SET_THROW );
406cdf0e10cSrcweir
407cdf0e10cSrcweir SfxChildWindow* pWindow = pFrame->GetChildWindow(nId);
408cdf0e10cSrcweir if(pWindow)
409cdf0e10cSrcweir {
410cdf0e10cSrcweir Svx3DWin* p3DWin = (Svx3DWin*)(pWindow->GetWindow());
411cdf0e10cSrcweir if(p3DWin)
412cdf0e10cSrcweir p3DWin->DocumentReload();
413cdf0e10cSrcweir }
414cdf0e10cSrcweir
415cdf0e10cSrcweir // Normale Weiterleitung an ViewFrame zur Ausfuehrung
416cdf0e10cSrcweir GetViewFrame()->ExecuteSlot(rReq);
417cdf0e10cSrcweir
418cdf0e10cSrcweir // From here on we must cope with this object and the frame already being
419cdf0e10cSrcweir // deleted. Do not call any methods or use data members.
420cdf0e10cSrcweir Reference<XController> xController( xFrame->getController(), UNO_SET_THROW );
421cdf0e10cSrcweir
422cdf0e10cSrcweir // Restore the configuration.
423cdf0e10cSrcweir xControllerManager = Reference<XControllerManager>( xController, UNO_QUERY_THROW);
424cdf0e10cSrcweir xConfigurationController = Reference<XConfigurationController>(
425cdf0e10cSrcweir xControllerManager->getConfigurationController());
426cdf0e10cSrcweir if ( ! xConfigurationController.is())
427cdf0e10cSrcweir throw RuntimeException();
428cdf0e10cSrcweir xConfigurationController->restoreConfiguration(xConfiguration);
429cdf0e10cSrcweir }
430cdf0e10cSrcweir catch (RuntimeException&)
431cdf0e10cSrcweir {
432cdf0e10cSrcweir DBG_UNHANDLED_EXCEPTION();
433cdf0e10cSrcweir }
434cdf0e10cSrcweir
435cdf0e10cSrcweir // We have to return immediately to avoid accessing this object.
436cdf0e10cSrcweir return;
437cdf0e10cSrcweir }
438cdf0e10cSrcweir
439cdf0e10cSrcweir case SID_JUMPTOMARK:
440cdf0e10cSrcweir {
441cdf0e10cSrcweir if( rReq.GetArgs() )
442cdf0e10cSrcweir {
443cdf0e10cSrcweir SFX_REQUEST_ARG(rReq, pBookmark, SfxStringItem, SID_JUMPTOMARK, sal_False);
444cdf0e10cSrcweir
445cdf0e10cSrcweir if (pBookmark)
446cdf0e10cSrcweir {
447cdf0e10cSrcweir UniString sBookmark( INetURLObject::decode( pBookmark->GetValue(), '%', INetURLObject::DECODE_WITH_CHARSET ) );
448cdf0e10cSrcweir
449cdf0e10cSrcweir rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
450cdf0e10cSrcweir if(xSlideshow.is() && xSlideshow->isRunning())
451cdf0e10cSrcweir {
452cdf0e10cSrcweir xSlideshow->jumpToBookmark(sBookmark);
453cdf0e10cSrcweir }
454cdf0e10cSrcweir else
455cdf0e10cSrcweir {
456cdf0e10cSrcweir GotoBookmark( sBookmark );
457cdf0e10cSrcweir }
458cdf0e10cSrcweir }
459cdf0e10cSrcweir }
460cdf0e10cSrcweir rReq.Done();
461cdf0e10cSrcweir break;
462cdf0e10cSrcweir }
463cdf0e10cSrcweir
464cdf0e10cSrcweir case SID_OUTPUT_QUALITY_COLOR:
465cdf0e10cSrcweir case SID_OUTPUT_QUALITY_GRAYSCALE:
466cdf0e10cSrcweir case SID_OUTPUT_QUALITY_BLACKWHITE:
467cdf0e10cSrcweir case SID_OUTPUT_QUALITY_CONTRAST:
468cdf0e10cSrcweir {
469cdf0e10cSrcweir ExecReq( rReq );
470cdf0e10cSrcweir break;
471cdf0e10cSrcweir }
472cdf0e10cSrcweir
473cdf0e10cSrcweir case SID_MAIL_SCROLLBODY_PAGEDOWN:
474cdf0e10cSrcweir {
475cdf0e10cSrcweir ExecReq( rReq );
476cdf0e10cSrcweir break;
477cdf0e10cSrcweir }
478cdf0e10cSrcweir
479cdf0e10cSrcweir case SID_ATTR_YEAR2000:
480cdf0e10cSrcweir {
481cdf0e10cSrcweir FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
482cdf0e10cSrcweir if (pFormShell != NULL)
483cdf0e10cSrcweir {
484cdf0e10cSrcweir const SfxPoolItem* pItem;
485cdf0e10cSrcweir if (rReq.GetArgs()->GetItemState(
486cdf0e10cSrcweir SID_ATTR_YEAR2000, sal_True, &pItem) == SFX_ITEM_SET)
487cdf0e10cSrcweir pFormShell->SetY2KState (
488cdf0e10cSrcweir static_cast<const SfxUInt16Item*>(pItem)->GetValue());
489cdf0e10cSrcweir }
490cdf0e10cSrcweir
491cdf0e10cSrcweir rReq.Done();
492cdf0e10cSrcweir }
493cdf0e10cSrcweir break;
494cdf0e10cSrcweir
495cdf0e10cSrcweir case SID_OPT_LOCALE_CHANGED:
496cdf0e10cSrcweir {
497cdf0e10cSrcweir GetActiveWindow()->Invalidate();
498cdf0e10cSrcweir UpdatePreview( mpActualPage );
499cdf0e10cSrcweir rReq.Done();
500cdf0e10cSrcweir }
501cdf0e10cSrcweir
502cdf0e10cSrcweir default:
503cdf0e10cSrcweir break;
504cdf0e10cSrcweir }
505cdf0e10cSrcweir }
506cdf0e10cSrcweir
507cdf0e10cSrcweir /*************************************************************************
508cdf0e10cSrcweir |*
509cdf0e10cSrcweir |* SfxRequests fuer Lineale bearbeiten
510cdf0e10cSrcweir |*
511cdf0e10cSrcweir \************************************************************************/
512cdf0e10cSrcweir
ExecRuler(SfxRequest & rReq)513cdf0e10cSrcweir void DrawViewShell::ExecRuler(SfxRequest& rReq)
514cdf0e10cSrcweir {
515cdf0e10cSrcweir // waehrend einer Diashow wird nichts ausgefuehrt!
516cdf0e10cSrcweir if(HasCurrentFunction(SID_PRESENTATION))
517cdf0e10cSrcweir return;
518cdf0e10cSrcweir
519cdf0e10cSrcweir CheckLineTo (rReq);
520cdf0e10cSrcweir
521cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs();
522cdf0e10cSrcweir const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
523cdf0e10cSrcweir Size aPageSize = mpActualPage->GetSize();
524cdf0e10cSrcweir Size aViewSize = GetActiveWindow()->GetViewSize();
525cdf0e10cSrcweir SdUndoGroup* pUndoGroup = NULL;
526cdf0e10cSrcweir
527cdf0e10cSrcweir if ( rReq.GetSlot() == SID_ATTR_LONG_LRSPACE ||
528cdf0e10cSrcweir rReq.GetSlot() == SID_ATTR_LONG_ULSPACE )
529cdf0e10cSrcweir {
530cdf0e10cSrcweir pUndoGroup = new SdUndoGroup(GetDoc());
531cdf0e10cSrcweir String aString(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
532cdf0e10cSrcweir pUndoGroup->SetComment(aString);
533cdf0e10cSrcweir }
534cdf0e10cSrcweir
535cdf0e10cSrcweir switch ( rReq.GetSlot() )
536cdf0e10cSrcweir {
537cdf0e10cSrcweir case SID_ATTR_LONG_LRSPACE:
538cdf0e10cSrcweir {
539cdf0e10cSrcweir const SvxLongLRSpaceItem& rLRSpace = (const SvxLongLRSpaceItem&)
540cdf0e10cSrcweir pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_LRSPACE));
541cdf0e10cSrcweir
542cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
543cdf0e10cSrcweir {
544cdf0e10cSrcweir Rectangle aRect = maMarkRect;
545cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() + aPagePos);
546cdf0e10cSrcweir aRect.Left() = rLRSpace.GetLeft();
547cdf0e10cSrcweir aRect.Right() = aViewSize.Width() - rLRSpace.GetRight();
548cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() - aPagePos);
549cdf0e10cSrcweir if ( aRect != maMarkRect)
550cdf0e10cSrcweir {
551cdf0e10cSrcweir mpDrawView->SetAllMarkedRect(aRect);
552cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect();
553cdf0e10cSrcweir Invalidate( SID_RULER_OBJECT );
554cdf0e10cSrcweir }
555cdf0e10cSrcweir }
556cdf0e10cSrcweir else
557cdf0e10cSrcweir {
558cdf0e10cSrcweir long nLeft = Max(0L, rLRSpace.GetLeft() - aPagePos.X());
559cdf0e10cSrcweir long nRight = Max(0L, rLRSpace.GetRight() + aPagePos.X() +
560cdf0e10cSrcweir aPageSize.Width() - aViewSize.Width());
561cdf0e10cSrcweir
562cdf0e10cSrcweir sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
563cdf0e10cSrcweir sal_uInt16 i;
564cdf0e10cSrcweir for ( i = 0; i < nPageCnt; i++)
565cdf0e10cSrcweir {
566cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
567cdf0e10cSrcweir SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
568cdf0e10cSrcweir pPage,
569cdf0e10cSrcweir pPage->GetLftBorder(),
570cdf0e10cSrcweir pPage->GetRgtBorder(),
571cdf0e10cSrcweir nLeft, nRight);
572cdf0e10cSrcweir pUndoGroup->AddAction(pUndo);
573cdf0e10cSrcweir pPage->SetLftBorder(nLeft);
574cdf0e10cSrcweir pPage->SetRgtBorder(nRight);
575cdf0e10cSrcweir }
576cdf0e10cSrcweir nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
577cdf0e10cSrcweir
578cdf0e10cSrcweir for (i = 0; i < nPageCnt; i++)
579cdf0e10cSrcweir {
580cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
581cdf0e10cSrcweir SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
582cdf0e10cSrcweir pPage,
583cdf0e10cSrcweir pPage->GetLftBorder(),
584cdf0e10cSrcweir pPage->GetRgtBorder(),
585cdf0e10cSrcweir nLeft, nRight);
586cdf0e10cSrcweir pUndoGroup->AddAction(pUndo);
587cdf0e10cSrcweir pPage->SetLftBorder(nLeft);
588cdf0e10cSrcweir pPage->SetRgtBorder(nRight);
589cdf0e10cSrcweir }
590cdf0e10cSrcweir InvalidateWindows();
591cdf0e10cSrcweir }
592cdf0e10cSrcweir break;
593cdf0e10cSrcweir }
594cdf0e10cSrcweir case SID_ATTR_LONG_ULSPACE:
595cdf0e10cSrcweir {
596cdf0e10cSrcweir const SvxLongULSpaceItem& rULSpace = (const SvxLongULSpaceItem&)
597cdf0e10cSrcweir pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_ULSPACE));
598cdf0e10cSrcweir
599cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
600cdf0e10cSrcweir {
601cdf0e10cSrcweir Rectangle aRect = maMarkRect;
602cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() + aPagePos);
603cdf0e10cSrcweir aRect.Top() = rULSpace.GetUpper();
604cdf0e10cSrcweir aRect.Bottom() = aViewSize.Height() - rULSpace.GetLower();
605cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() - aPagePos);
606cdf0e10cSrcweir
607cdf0e10cSrcweir if ( aRect != maMarkRect)
608cdf0e10cSrcweir {
609cdf0e10cSrcweir mpDrawView->SetAllMarkedRect(aRect);
610cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect();
611cdf0e10cSrcweir Invalidate( SID_RULER_OBJECT );
612cdf0e10cSrcweir }
613cdf0e10cSrcweir }
614cdf0e10cSrcweir else
615cdf0e10cSrcweir {
616cdf0e10cSrcweir long nUpper = Max(0L, rULSpace.GetUpper() - aPagePos.Y());
617cdf0e10cSrcweir long nLower = Max(0L, rULSpace.GetLower() + aPagePos.Y() +
618cdf0e10cSrcweir aPageSize.Height() - aViewSize.Height());
619cdf0e10cSrcweir
620cdf0e10cSrcweir sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
621cdf0e10cSrcweir sal_uInt16 i;
622cdf0e10cSrcweir for ( i = 0; i < nPageCnt; i++)
623cdf0e10cSrcweir {
624cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
625cdf0e10cSrcweir SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
626cdf0e10cSrcweir pPage,
627cdf0e10cSrcweir pPage->GetUppBorder(),
628cdf0e10cSrcweir pPage->GetLwrBorder(),
629cdf0e10cSrcweir nUpper, nLower);
630cdf0e10cSrcweir pUndoGroup->AddAction(pUndo);
631cdf0e10cSrcweir pPage->SetUppBorder(nUpper);
632cdf0e10cSrcweir pPage->SetLwrBorder(nLower);
633cdf0e10cSrcweir }
634cdf0e10cSrcweir nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
635cdf0e10cSrcweir
636cdf0e10cSrcweir for (i = 0; i < nPageCnt; i++)
637cdf0e10cSrcweir {
638cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
639cdf0e10cSrcweir SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
640cdf0e10cSrcweir pPage,
641cdf0e10cSrcweir pPage->GetUppBorder(),
642cdf0e10cSrcweir pPage->GetLwrBorder(),
643cdf0e10cSrcweir nUpper, nLower);
644cdf0e10cSrcweir pUndoGroup->AddAction(pUndo);
645cdf0e10cSrcweir pPage->SetUppBorder(nUpper);
646cdf0e10cSrcweir pPage->SetLwrBorder(nLower);
647cdf0e10cSrcweir }
648cdf0e10cSrcweir InvalidateWindows();
649cdf0e10cSrcweir }
650cdf0e10cSrcweir break;
651cdf0e10cSrcweir }
652cdf0e10cSrcweir
653cdf0e10cSrcweir case SID_RULER_OBJECT:
654cdf0e10cSrcweir {
655cdf0e10cSrcweir Rectangle aRect = maMarkRect;
656cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() + aPagePos);
657cdf0e10cSrcweir
658cdf0e10cSrcweir const SvxObjectItem& rOI = (const SvxObjectItem&)
659cdf0e10cSrcweir pArgs->Get(GetPool().GetWhich(SID_RULER_OBJECT));
660cdf0e10cSrcweir
661cdf0e10cSrcweir if ( rOI.GetStartX() != rOI.GetEndX() )
662cdf0e10cSrcweir {
663cdf0e10cSrcweir aRect.Left() = rOI.GetStartX();
664cdf0e10cSrcweir aRect.Right() = rOI.GetEndX();
665cdf0e10cSrcweir }
666cdf0e10cSrcweir if ( rOI.GetStartY() != rOI.GetEndY() )
667cdf0e10cSrcweir {
668cdf0e10cSrcweir aRect.Top() = rOI.GetStartY();
669cdf0e10cSrcweir aRect.Bottom() = rOI.GetEndY();
670cdf0e10cSrcweir }
671cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() - aPagePos);
672cdf0e10cSrcweir if ( aRect != maMarkRect)
673cdf0e10cSrcweir {
674cdf0e10cSrcweir mpDrawView->SetAllMarkedRect(aRect);
675cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect();
676cdf0e10cSrcweir Invalidate( SID_RULER_OBJECT );
677cdf0e10cSrcweir }
678cdf0e10cSrcweir break;
679cdf0e10cSrcweir }
680cdf0e10cSrcweir
681cdf0e10cSrcweir case SID_ATTR_TABSTOP:
682cdf0e10cSrcweir {
683cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
684cdf0e10cSrcweir {
685cdf0e10cSrcweir const SvxTabStopItem& rItem = (const SvxTabStopItem&)
686cdf0e10cSrcweir pArgs->Get( EE_PARA_TABS );
687cdf0e10cSrcweir
688cdf0e10cSrcweir SfxItemSet aEditAttr( GetPool(), EE_PARA_TABS, EE_PARA_TABS );
689cdf0e10cSrcweir
690cdf0e10cSrcweir aEditAttr.Put( rItem );
691cdf0e10cSrcweir mpDrawView->SetAttributes( aEditAttr );
692cdf0e10cSrcweir
693cdf0e10cSrcweir // #91081# Invalidate is missing here
694cdf0e10cSrcweir Invalidate(SID_ATTR_TABSTOP);
695cdf0e10cSrcweir }
696cdf0e10cSrcweir break;
697cdf0e10cSrcweir }
698cdf0e10cSrcweir
699766ce4d0SZheng Fan case SID_ATTR_PARA_LINESPACE:
700766ce4d0SZheng Fan {
701766ce4d0SZheng Fan sal_uInt16 nSlot = SID_ATTR_PARA_LINESPACE;
702766ce4d0SZheng Fan SvxLineSpacingItem aParaLineSP = (const SvxLineSpacingItem&)pArgs->Get(
703766ce4d0SZheng Fan GetPool().GetWhich(nSlot));
704766ce4d0SZheng Fan
705766ce4d0SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_SBL, EE_PARA_SBL );
706766ce4d0SZheng Fan aParaLineSP.SetWhich( EE_PARA_SBL );
707766ce4d0SZheng Fan
708766ce4d0SZheng Fan aEditAttr.Put( aParaLineSP );
709766ce4d0SZheng Fan mpDrawView->SetAttributes( aEditAttr );
710766ce4d0SZheng Fan
711766ce4d0SZheng Fan Invalidate(SID_ATTR_PARA_LINESPACE);
712766ce4d0SZheng Fan }
713766ce4d0SZheng Fan break;
714512ec161SZheng Fan case SID_ATTR_PARA_ADJUST_LEFT:
715512ec161SZheng Fan {
716512ec161SZheng Fan SvxAdjustItem aItem( SVX_ADJUST_LEFT, EE_PARA_JUST );
717512ec161SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
718512ec161SZheng Fan
719512ec161SZheng Fan aEditAttr.Put( aItem );
720512ec161SZheng Fan mpDrawView->SetAttributes( aEditAttr );
721512ec161SZheng Fan
722512ec161SZheng Fan Invalidate(SID_ATTR_PARA_ADJUST_LEFT);
723512ec161SZheng Fan }
724512ec161SZheng Fan break;
725512ec161SZheng Fan case SID_ATTR_PARA_ADJUST_CENTER:
726512ec161SZheng Fan {
727512ec161SZheng Fan SvxAdjustItem aItem( SVX_ADJUST_CENTER, EE_PARA_JUST );
728512ec161SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
729512ec161SZheng Fan
730512ec161SZheng Fan aEditAttr.Put( aItem );
731512ec161SZheng Fan mpDrawView->SetAttributes( aEditAttr );
732512ec161SZheng Fan
733512ec161SZheng Fan Invalidate(SID_ATTR_PARA_ADJUST_CENTER);
734512ec161SZheng Fan }
735512ec161SZheng Fan break;
736512ec161SZheng Fan case SID_ATTR_PARA_ADJUST_RIGHT:
737512ec161SZheng Fan {
738512ec161SZheng Fan SvxAdjustItem aItem( SVX_ADJUST_RIGHT, EE_PARA_JUST );
739512ec161SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
740512ec161SZheng Fan
741512ec161SZheng Fan aEditAttr.Put( aItem );
742512ec161SZheng Fan mpDrawView->SetAttributes( aEditAttr );
743512ec161SZheng Fan
744512ec161SZheng Fan Invalidate(SID_ATTR_PARA_ADJUST_RIGHT);
745512ec161SZheng Fan }
746512ec161SZheng Fan break;
747512ec161SZheng Fan case SID_ATTR_PARA_ADJUST_BLOCK:
748512ec161SZheng Fan {
749512ec161SZheng Fan SvxAdjustItem aItem( SVX_ADJUST_BLOCK, EE_PARA_JUST );
750512ec161SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
751512ec161SZheng Fan
752512ec161SZheng Fan aEditAttr.Put( aItem );
753512ec161SZheng Fan mpDrawView->SetAttributes( aEditAttr );
754512ec161SZheng Fan
755512ec161SZheng Fan Invalidate(SID_ATTR_PARA_ADJUST_BLOCK);
756512ec161SZheng Fan }
757512ec161SZheng Fan break;
758766ce4d0SZheng Fan case SID_ATTR_PARA_ULSPACE:
759766ce4d0SZheng Fan {
760766ce4d0SZheng Fan sal_uInt16 nSlot = SID_ATTR_PARA_ULSPACE;
761766ce4d0SZheng Fan SvxULSpaceItem aULSP = (const SvxULSpaceItem&)pArgs->Get(
762766ce4d0SZheng Fan GetPool().GetWhich(nSlot));
763766ce4d0SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_ULSPACE, EE_PARA_ULSPACE );
764766ce4d0SZheng Fan aULSP.SetWhich( EE_PARA_ULSPACE );
765766ce4d0SZheng Fan
766766ce4d0SZheng Fan aEditAttr.Put( aULSP );
767766ce4d0SZheng Fan mpDrawView->SetAttributes( aEditAttr );
768766ce4d0SZheng Fan
769766ce4d0SZheng Fan Invalidate(SID_ATTR_PARA_ULSPACE);
770766ce4d0SZheng Fan }
771766ce4d0SZheng Fan break;
772766ce4d0SZheng Fan
773cdf0e10cSrcweir case SID_ATTR_PARA_LRSPACE:
774cdf0e10cSrcweir {
7751ff378efSZheng Fan sal_uInt16 nSlot = SID_ATTR_PARA_LRSPACE;
7761ff378efSZheng Fan SvxLRSpaceItem aLRSpace = (const SvxLRSpaceItem&)pArgs->Get(
7771ff378efSZheng Fan GetPool().GetWhich(nSlot));
778cdf0e10cSrcweir
779cdf0e10cSrcweir SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
7801ff378efSZheng Fan aLRSpace.SetWhich( EE_PARA_LRSPACE );
781cdf0e10cSrcweir
7821ff378efSZheng Fan aEditAttr.Put( aLRSpace );
783cdf0e10cSrcweir mpDrawView->SetAttributes( aEditAttr );
784cdf0e10cSrcweir
785cdf0e10cSrcweir Invalidate(SID_ATTR_PARA_LRSPACE);
786cdf0e10cSrcweir break;
787cdf0e10cSrcweir }
788766ce4d0SZheng Fan case SID_ATTR_LRSPACE:
789766ce4d0SZheng Fan {
790766ce4d0SZheng Fan if( mpDrawView->IsTextEdit() )
791766ce4d0SZheng Fan {
792766ce4d0SZheng Fan sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
793766ce4d0SZheng Fan const SvxLRSpaceItem& rItem = (const SvxLRSpaceItem&)
794766ce4d0SZheng Fan pArgs->Get( nId );
795766ce4d0SZheng Fan
796766ce4d0SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
797766ce4d0SZheng Fan
798766ce4d0SZheng Fan nId = EE_PARA_LRSPACE;
799766ce4d0SZheng Fan SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
800766ce4d0SZheng Fan rItem.GetRight(), rItem.GetTxtLeft(),
801766ce4d0SZheng Fan rItem.GetTxtFirstLineOfst(), nId );
802766ce4d0SZheng Fan aEditAttr.Put( aLRSpaceItem );
803766ce4d0SZheng Fan mpDrawView->SetAttributes( aEditAttr );
804766ce4d0SZheng Fan
805766ce4d0SZheng Fan // #92557# Invalidate is missing here
806766ce4d0SZheng Fan Invalidate(SID_ATTR_PARA_LRSPACE);
807766ce4d0SZheng Fan }
808766ce4d0SZheng Fan break;
809766ce4d0SZheng Fan }
810cdf0e10cSrcweir }
811cdf0e10cSrcweir if ( pUndoGroup )
812cdf0e10cSrcweir // Undo Gruppe dem Undo Manager uebergeben
813cdf0e10cSrcweir GetViewFrame()->GetObjectShell()->GetUndoManager()->
814cdf0e10cSrcweir AddUndoAction(pUndoGroup);
815cdf0e10cSrcweir }
816cdf0e10cSrcweir
817cdf0e10cSrcweir /*************************************************************************
818cdf0e10cSrcweir |*
819cdf0e10cSrcweir |* Statuswerte der Lineale bestimmen
820cdf0e10cSrcweir |*
821cdf0e10cSrcweir \************************************************************************/
GetRulerState(SfxItemSet & rSet)822cdf0e10cSrcweir void DrawViewShell::GetRulerState(SfxItemSet& rSet)
823cdf0e10cSrcweir {
824cdf0e10cSrcweir Point aOrigin;
825cdf0e10cSrcweir
826cdf0e10cSrcweir if (mpDrawView->GetSdrPageView())
827cdf0e10cSrcweir {
828cdf0e10cSrcweir aOrigin = mpDrawView->GetSdrPageView()->GetPageOrigin();
829cdf0e10cSrcweir }
830cdf0e10cSrcweir
831cdf0e10cSrcweir Size aViewSize = GetActiveWindow()->GetViewSize();
832cdf0e10cSrcweir
833cdf0e10cSrcweir const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
834cdf0e10cSrcweir Size aPageSize = mpActualPage->GetSize();
835cdf0e10cSrcweir
836cdf0e10cSrcweir Rectangle aRect(aPagePos, Point( aViewSize.Width() - (aPagePos.X() + aPageSize.Width()),
837cdf0e10cSrcweir aViewSize.Height() - (aPagePos.Y() + aPageSize.Height())));
838cdf0e10cSrcweir
839cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
840cdf0e10cSrcweir {
841cdf0e10cSrcweir Point aPnt1 = GetActiveWindow()->GetWinViewPos();
842cdf0e10cSrcweir Point aPnt2 = GetActiveWindow()->GetViewOrigin();
843cdf0e10cSrcweir Rectangle aMinMaxRect = Rectangle( aPnt1, Size(ULONG_MAX, ULONG_MAX) );
844cdf0e10cSrcweir rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aMinMaxRect) );
845cdf0e10cSrcweir }
846cdf0e10cSrcweir else
847cdf0e10cSrcweir {
848cdf0e10cSrcweir rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aRect) );
849cdf0e10cSrcweir }
850cdf0e10cSrcweir
851cdf0e10cSrcweir SvxLongLRSpaceItem aLRSpace(aPagePos.X() + mpActualPage->GetLftBorder(),
852cdf0e10cSrcweir aRect.Right() + mpActualPage->GetRgtBorder(),
853cdf0e10cSrcweir GetPool().GetWhich(SID_ATTR_LONG_LRSPACE));
854cdf0e10cSrcweir SvxLongULSpaceItem aULSpace(aPagePos.Y() + mpActualPage->GetUppBorder(),
855cdf0e10cSrcweir aRect.Bottom() + mpActualPage->GetLwrBorder(),
856cdf0e10cSrcweir GetPool().GetWhich(SID_ATTR_LONG_ULSPACE));
857cdf0e10cSrcweir rSet.Put(SvxPagePosSizeItem(Point(0,0) - aPagePos, aViewSize.Width(),
858cdf0e10cSrcweir aViewSize.Height()));
859cdf0e10cSrcweir SfxPointItem aPointItem( SID_RULER_NULL_OFFSET, aPagePos + aOrigin );
860cdf0e10cSrcweir
861cdf0e10cSrcweir SvxProtectItem aProtect( SID_RULER_PROTECT );
862cdf0e10cSrcweir
863cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect();
864cdf0e10cSrcweir
865cdf0e10cSrcweir const sal_Bool bRTL = GetDoc() && GetDoc()->GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB;
866cdf0e10cSrcweir rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, bRTL));
867cdf0e10cSrcweir
868cdf0e10cSrcweir if( mpDrawView->AreObjectsMarked() )
869cdf0e10cSrcweir {
870cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
871cdf0e10cSrcweir {
872cdf0e10cSrcweir SdrObject* pObj = mpDrawView->GetMarkedObjectList().GetMark( 0 )->GetMarkedSdrObj();
873cdf0e10cSrcweir if( pObj->GetObjInventor() == SdrInventor)
874cdf0e10cSrcweir {
875cdf0e10cSrcweir SfxItemSet aEditAttr( GetDoc()->GetPool() );
876cdf0e10cSrcweir mpDrawView->GetAttributes( aEditAttr );
877cdf0e10cSrcweir if( aEditAttr.GetItemState( EE_PARA_TABS ) >= SFX_ITEM_AVAILABLE )
878cdf0e10cSrcweir {
879cdf0e10cSrcweir const SvxTabStopItem& rItem = (const SvxTabStopItem&) aEditAttr.Get( EE_PARA_TABS );
880cdf0e10cSrcweir rSet.Put( rItem );
881cdf0e10cSrcweir
882cdf0e10cSrcweir //Rectangle aRect = maMarkRect;
883cdf0e10cSrcweir
884cdf0e10cSrcweir const SvxLRSpaceItem& rLRSpaceItem = (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE );
885cdf0e10cSrcweir sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
886cdf0e10cSrcweir SvxLRSpaceItem aLRSpaceItem( rLRSpaceItem.GetLeft(),
887cdf0e10cSrcweir rLRSpaceItem.GetRight(), rLRSpaceItem.GetTxtLeft(),
888cdf0e10cSrcweir rLRSpaceItem.GetTxtFirstLineOfst(), nId );
889cdf0e10cSrcweir rSet.Put( aLRSpaceItem );
890cdf0e10cSrcweir
891cdf0e10cSrcweir Point aPos( aPagePos + maMarkRect.TopLeft() );
892cdf0e10cSrcweir
893cdf0e10cSrcweir if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SFX_ITEM_ON )
894cdf0e10cSrcweir {
895cdf0e10cSrcweir const SdrTextLeftDistItem& rTLDItem = (const SdrTextLeftDistItem&)
896cdf0e10cSrcweir aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
897cdf0e10cSrcweir long nLD = rTLDItem.GetValue();
898cdf0e10cSrcweir aPos.X() += nLD;
899cdf0e10cSrcweir }
900cdf0e10cSrcweir
901cdf0e10cSrcweir aPointItem.SetValue( aPos );
902cdf0e10cSrcweir
903cdf0e10cSrcweir aLRSpace.SetLeft( aPagePos.X() + maMarkRect.Left() );
904cdf0e10cSrcweir
905cdf0e10cSrcweir if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SFX_ITEM_ON )
906cdf0e10cSrcweir {
907cdf0e10cSrcweir const SdrTextLeftDistItem& rTLDItem = (const SdrTextLeftDistItem&)
908cdf0e10cSrcweir aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
909cdf0e10cSrcweir long nLD = rTLDItem.GetValue();
910cdf0e10cSrcweir aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD );
911cdf0e10cSrcweir }
912cdf0e10cSrcweir
913cdf0e10cSrcweir aLRSpace.SetRight( aRect.Right() + aPageSize.Width() - maMarkRect.Right() );
914cdf0e10cSrcweir aULSpace.SetUpper( aPagePos.Y() + maMarkRect.Top() );
915cdf0e10cSrcweir aULSpace.SetLower( aRect.Bottom() + aPageSize.Height() - maMarkRect.Bottom() );
916cdf0e10cSrcweir
917cdf0e10cSrcweir rSet.DisableItem( SID_RULER_OBJECT );
918cdf0e10cSrcweir
919cdf0e10cSrcweir // Seitenraender werden gelocked
920cdf0e10cSrcweir aProtect.SetSizeProtect( sal_True );
921cdf0e10cSrcweir aProtect.SetPosProtect( sal_True );
922cdf0e10cSrcweir }
923cdf0e10cSrcweir
924cdf0e10cSrcweir if( aEditAttr.GetItemState( EE_PARA_WRITINGDIR ) >= SFX_ITEM_AVAILABLE )
925cdf0e10cSrcweir {
926cdf0e10cSrcweir const SvxFrameDirectionItem& rItem = (const SvxFrameDirectionItem&) aEditAttr.Get( EE_PARA_WRITINGDIR );
927cdf0e10cSrcweir rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == ::com::sun::star::text::WritingMode_RL_TB));
928cdf0e10cSrcweir }
929cdf0e10cSrcweir }
930cdf0e10cSrcweir }
931cdf0e10cSrcweir else
932cdf0e10cSrcweir {
933cdf0e10cSrcweir rSet.DisableItem( EE_PARA_TABS );
934cdf0e10cSrcweir rSet.DisableItem( SID_RULER_TEXT_RIGHT_TO_LEFT );
935cdf0e10cSrcweir
936cdf0e10cSrcweir if( mpDrawView->IsResizeAllowed(sal_True) )
937cdf0e10cSrcweir {
938cdf0e10cSrcweir Rectangle aResizeRect( maMarkRect );
939cdf0e10cSrcweir
940cdf0e10cSrcweir aResizeRect.SetPos(aResizeRect.TopLeft() + aPagePos);
941cdf0e10cSrcweir SvxObjectItem aObjItem(aResizeRect.Left(), aResizeRect.Right(),
942cdf0e10cSrcweir aResizeRect.Top(), aResizeRect.Bottom());
943cdf0e10cSrcweir rSet.Put(aObjItem);
944cdf0e10cSrcweir rSet.DisableItem( EE_PARA_TABS );
945cdf0e10cSrcweir }
946cdf0e10cSrcweir else
947cdf0e10cSrcweir {
948cdf0e10cSrcweir rSet.DisableItem( SID_RULER_OBJECT );
949cdf0e10cSrcweir }
950cdf0e10cSrcweir }
951cdf0e10cSrcweir }
952cdf0e10cSrcweir else
953cdf0e10cSrcweir {
954cdf0e10cSrcweir rSet.DisableItem( SID_RULER_OBJECT );
955cdf0e10cSrcweir rSet.DisableItem( EE_PARA_TABS );
956cdf0e10cSrcweir // rSet.DisableItem( SID_RULER_TEXT_RIGHT_TO_LEFT );
957cdf0e10cSrcweir }
958cdf0e10cSrcweir
959cdf0e10cSrcweir rSet.Put( aLRSpace );
960cdf0e10cSrcweir rSet.Put( aULSpace );
961cdf0e10cSrcweir
962cdf0e10cSrcweir rSet.Put( aPointItem );
963cdf0e10cSrcweir rSet.Put( aProtect );
964cdf0e10cSrcweir }
965cdf0e10cSrcweir
966cdf0e10cSrcweir /*************************************************************************
967cdf0e10cSrcweir |*
968cdf0e10cSrcweir |* SfxRequests fuer StatusBar bearbeiten
969cdf0e10cSrcweir |*
970cdf0e10cSrcweir \************************************************************************/
971cdf0e10cSrcweir
ExecStatusBar(SfxRequest & rReq)972cdf0e10cSrcweir void DrawViewShell::ExecStatusBar(SfxRequest& rReq)
973cdf0e10cSrcweir {
974cdf0e10cSrcweir // waehrend einer Diashow wird nichts ausgefuehrt!
975cdf0e10cSrcweir if(HasCurrentFunction(SID_PRESENTATION))
976cdf0e10cSrcweir return;
977cdf0e10cSrcweir
978cdf0e10cSrcweir CheckLineTo (rReq);
979cdf0e10cSrcweir
980cdf0e10cSrcweir switch ( rReq.GetSlot() )
981cdf0e10cSrcweir {
982cdf0e10cSrcweir case SID_ATTR_SIZE:
983cdf0e10cSrcweir {
984cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_TRANSFORM, SFX_CALLMODE_ASYNCHRON );
985cdf0e10cSrcweir }
986cdf0e10cSrcweir break;
987cdf0e10cSrcweir
988cdf0e10cSrcweir case SID_STATUS_LAYOUT:
989cdf0e10cSrcweir {
990cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION_LAYOUT, SFX_CALLMODE_ASYNCHRON );
991cdf0e10cSrcweir }
992cdf0e10cSrcweir break;
993cdf0e10cSrcweir }
994cdf0e10cSrcweir }
995cdf0e10cSrcweir
996cdf0e10cSrcweir /*************************************************************************
997cdf0e10cSrcweir |*
998cdf0e10cSrcweir |* Status der Snap-Objekt-Eintraege im Popup setzen
999cdf0e10cSrcweir |*
1000cdf0e10cSrcweir \************************************************************************/
1001cdf0e10cSrcweir
GetSnapItemState(SfxItemSet & rSet)1002cdf0e10cSrcweir void DrawViewShell::GetSnapItemState( SfxItemSet &rSet )
1003cdf0e10cSrcweir {
1004cdf0e10cSrcweir SdrPageView* pPV;
1005cdf0e10cSrcweir Point aMPos = GetActiveWindow()->PixelToLogic(maMousePos);
1006cdf0e10cSrcweir sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic(
1007cdf0e10cSrcweir Size(FuPoor::HITPIX,0)).Width();
1008cdf0e10cSrcweir sal_uInt16 nHelpLine;
1009cdf0e10cSrcweir
1010cdf0e10cSrcweir if ( mpDrawView->PickHelpLine(aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
1011cdf0e10cSrcweir {
1012cdf0e10cSrcweir const SdrHelpLine& rHelpLine = (pPV->GetHelpLines())[nHelpLine];
1013cdf0e10cSrcweir
1014cdf0e10cSrcweir if ( rHelpLine.GetKind() == SDRHELPLINE_POINT )
1015cdf0e10cSrcweir {
1016cdf0e10cSrcweir rSet.Put( SfxStringItem( SID_SET_SNAPITEM,
1017cdf0e10cSrcweir String( SdResId( STR_POPUP_EDIT_SNAPPOINT))) );
1018cdf0e10cSrcweir rSet.Put( SfxStringItem( SID_DELETE_SNAPITEM,
1019cdf0e10cSrcweir String( SdResId( STR_POPUP_DELETE_SNAPPOINT))) );
1020cdf0e10cSrcweir }
1021cdf0e10cSrcweir else
1022cdf0e10cSrcweir {
1023cdf0e10cSrcweir rSet.Put( SfxStringItem( SID_SET_SNAPITEM,
1024cdf0e10cSrcweir String( SdResId( STR_POPUP_EDIT_SNAPLINE))) );
1025cdf0e10cSrcweir rSet.Put( SfxStringItem( SID_DELETE_SNAPITEM,
1026cdf0e10cSrcweir String( SdResId( STR_POPUP_DELETE_SNAPLINE))) );
1027cdf0e10cSrcweir }
1028cdf0e10cSrcweir }
1029cdf0e10cSrcweir }
1030cdf0e10cSrcweir
1031cdf0e10cSrcweir
1032cdf0e10cSrcweir /*************************************************************************
1033cdf0e10cSrcweir |*
1034cdf0e10cSrcweir |*
1035cdf0e10cSrcweir |*
1036cdf0e10cSrcweir \************************************************************************/
1037cdf0e10cSrcweir
AddWindow(::sd::Window * pWin)1038cdf0e10cSrcweir void DrawViewShell::AddWindow (::sd::Window* pWin)
1039cdf0e10cSrcweir {
1040cdf0e10cSrcweir mpDrawView->AddWindowToPaintView(pWin);
1041cdf0e10cSrcweir }
1042cdf0e10cSrcweir
1043cdf0e10cSrcweir /*************************************************************************
1044cdf0e10cSrcweir |*
1045cdf0e10cSrcweir |*
1046cdf0e10cSrcweir |*
1047cdf0e10cSrcweir \************************************************************************/
1048cdf0e10cSrcweir
RemoveWindow(::sd::Window * pWin)1049cdf0e10cSrcweir void DrawViewShell::RemoveWindow(::sd::Window* pWin)
1050cdf0e10cSrcweir {
1051cdf0e10cSrcweir mpDrawView->DeleteWindowFromPaintView(pWin);
1052cdf0e10cSrcweir }
1053cdf0e10cSrcweir
1054cdf0e10cSrcweir } // end of namespace sd
1055