15b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
35b190011SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
45b190011SAndrew Rist * or more contributor license agreements. See the NOTICE file
55b190011SAndrew Rist * distributed with this work for additional information
65b190011SAndrew Rist * regarding copyright ownership. The ASF licenses this file
75b190011SAndrew Rist * to you under the Apache License, Version 2.0 (the
85b190011SAndrew Rist * "License"); you may not use this file except in compliance
95b190011SAndrew Rist * with the License. You may obtain a copy of the License at
105b190011SAndrew Rist *
115b190011SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
125b190011SAndrew Rist *
135b190011SAndrew Rist * Unless required by applicable law or agreed to in writing,
145b190011SAndrew Rist * software distributed under the License is distributed on an
155b190011SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165b190011SAndrew Rist * KIND, either express or implied. See the License for the
175b190011SAndrew Rist * specific language governing permissions and limitations
185b190011SAndrew Rist * under the License.
195b190011SAndrew Rist *
205b190011SAndrew Rist *************************************************************/
215b190011SAndrew Rist
225b190011SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include "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>
35*512ec161SZheng 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 sal_uInt16 nCurPage = GetLayerTabControl()->GetCurPageId ();
226cdf0e10cSrcweir
227cdf0e10cSrcweir if( pArgs && pArgs->Count () == 1)
228cdf0e10cSrcweir {
229cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
230cdf0e10cSrcweir if( pWhatLayer )
231cdf0e10cSrcweir nCurPage = (short) pWhatLayer->GetValue ();
232cdf0e10cSrcweir }
233cdf0e10cSrcweir
234cdf0e10cSrcweir mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) );
235cdf0e10cSrcweir Invalidate();
236cdf0e10cSrcweir rReq.Done ();
237cdf0e10cSrcweir
238cdf0e10cSrcweir break;
239cdf0e10cSrcweir }
240cdf0e10cSrcweir
241cdf0e10cSrcweir case SID_PAGEMODE: // BASIC
242cdf0e10cSrcweir {
243cdf0e10cSrcweir
244cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs ();
245cdf0e10cSrcweir
246cdf0e10cSrcweir if ( pArgs && pArgs->Count () == 2)
247cdf0e10cSrcweir {
248cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, ID_VAL_ISACTIVE, sal_False);
249cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND, sal_False);
250cdf0e10cSrcweir
251cdf0e10cSrcweir sal_Int32 nWhatKind = (sal_Int32)pWhatKind->GetValue ();
252cdf0e10cSrcweir if (CHECK_RANGE (PK_STANDARD, nWhatKind, PK_HANDOUT))
253cdf0e10cSrcweir {
254cdf0e10cSrcweir mbIsLayerModeActive = pIsActive->GetValue ();
255cdf0e10cSrcweir mePageKind = (PageKind) nWhatKind;
256cdf0e10cSrcweir }
257cdf0e10cSrcweir }
258cdf0e10cSrcweir
259cdf0e10cSrcweir // Default-Layer der Page einschalten
260cdf0e10cSrcweir mpDrawView->SetActiveLayer( String( SdResId(STR_LAYER_LAYOUT) ) );
261cdf0e10cSrcweir
262cdf0e10cSrcweir ChangeEditMode(EM_PAGE, mbIsLayerModeActive);
263cdf0e10cSrcweir
264cdf0e10cSrcweir Invalidate();
265cdf0e10cSrcweir rReq.Done ();
266cdf0e10cSrcweir
267cdf0e10cSrcweir break;
268cdf0e10cSrcweir }
269cdf0e10cSrcweir
270cdf0e10cSrcweir case SID_LAYERMODE: // BASIC
271cdf0e10cSrcweir {
272cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs ();
273cdf0e10cSrcweir
274cdf0e10cSrcweir if ( pArgs && pArgs->Count () == 2)
275cdf0e10cSrcweir {
276cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatLayerMode, SfxBoolItem, ID_VAL_ISACTIVE, sal_False);
277cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
278cdf0e10cSrcweir
279cdf0e10cSrcweir sal_Int32 nWhatLayer = (sal_Int32)pWhatLayer->GetValue ();
280cdf0e10cSrcweir if (CHECK_RANGE (EM_PAGE, nWhatLayer, EM_MASTERPAGE))
281cdf0e10cSrcweir {
282cdf0e10cSrcweir mbIsLayerModeActive = pWhatLayerMode->GetValue ();
283cdf0e10cSrcweir meEditMode = (EditMode) nWhatLayer;
284cdf0e10cSrcweir }
285cdf0e10cSrcweir }
286cdf0e10cSrcweir
287cdf0e10cSrcweir ChangeEditMode(meEditMode, !mbIsLayerModeActive);
288cdf0e10cSrcweir
289cdf0e10cSrcweir Invalidate();
290cdf0e10cSrcweir rReq.Done ();
291cdf0e10cSrcweir
292cdf0e10cSrcweir break;
293cdf0e10cSrcweir }
294cdf0e10cSrcweir
295cdf0e10cSrcweir case SID_HEADER_AND_FOOTER:
296cdf0e10cSrcweir case SID_INSERT_PAGE_NUMBER:
297cdf0e10cSrcweir case SID_INSERT_DATE_TIME:
298cdf0e10cSrcweir {
299cdf0e10cSrcweir SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
300cdf0e10cSrcweir AbstractHeaderFooterDialog* pDlg = pFact ? pFact->CreateHeaderFooterDialog( (::ViewShell*)this, GetActiveWindow(), GetDoc(), mpActualPage ) : 0;
301cdf0e10cSrcweir if( pDlg )
302cdf0e10cSrcweir {
303cdf0e10cSrcweir pDlg->Execute();
304cdf0e10cSrcweir delete pDlg;
305cdf0e10cSrcweir
306cdf0e10cSrcweir GetActiveWindow()->Invalidate();
307cdf0e10cSrcweir UpdatePreview( mpActualPage );
308cdf0e10cSrcweir }
309cdf0e10cSrcweir
310cdf0e10cSrcweir Invalidate();
311cdf0e10cSrcweir rReq.Done ();
312cdf0e10cSrcweir
313cdf0e10cSrcweir break;
314cdf0e10cSrcweir }
315cdf0e10cSrcweir
316cdf0e10cSrcweir case SID_MASTER_LAYOUTS:
317cdf0e10cSrcweir {
318cdf0e10cSrcweir SdPage* pPage = GetActualPage();
319cdf0e10cSrcweir if (meEditMode == EM_MASTERPAGE)
320cdf0e10cSrcweir // Use the master page of the current page.
321cdf0e10cSrcweir pPage = static_cast<SdPage*>(&pPage->TRG_GetMasterPage());
322cdf0e10cSrcweir
323cdf0e10cSrcweir SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
324cdf0e10cSrcweir VclAbstractDialog* pDlg = pFact ? pFact->CreateMasterLayoutDialog( GetActiveWindow(), GetDoc(), pPage ) : 0;
325cdf0e10cSrcweir if( pDlg )
326cdf0e10cSrcweir {
327cdf0e10cSrcweir pDlg->Execute();
328cdf0e10cSrcweir delete pDlg;
329cdf0e10cSrcweir Invalidate();
330cdf0e10cSrcweir }
331cdf0e10cSrcweir rReq.Done ();
332cdf0e10cSrcweir break;
333cdf0e10cSrcweir }
334cdf0e10cSrcweir case SID_OBJECTRESIZE:
335cdf0e10cSrcweir {
336cdf0e10cSrcweir /******************************************************************
337cdf0e10cSrcweir * Der Server moechte die Clientgrosse verandern
338cdf0e10cSrcweir ******************************************************************/
339cdf0e10cSrcweir OSL_ASSERT (GetViewShell()!=NULL);
340cdf0e10cSrcweir SfxInPlaceClient* pIPClient = GetViewShell()->GetIPClient();
341cdf0e10cSrcweir
342cdf0e10cSrcweir if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
343cdf0e10cSrcweir {
344cdf0e10cSrcweir const SfxRectangleItem& rRect =
345cdf0e10cSrcweir (SfxRectangleItem&)rReq.GetArgs()->Get(SID_OBJECTRESIZE);
346cdf0e10cSrcweir Rectangle aRect( GetActiveWindow()->PixelToLogic( rRect.GetValue() ) );
347cdf0e10cSrcweir
348cdf0e10cSrcweir if ( mpDrawView->AreObjectsMarked() )
349cdf0e10cSrcweir {
350cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
351cdf0e10cSrcweir
352cdf0e10cSrcweir if (rMarkList.GetMarkCount() == 1)
353cdf0e10cSrcweir {
354cdf0e10cSrcweir SdrMark* pMark = rMarkList.GetMark(0);
355cdf0e10cSrcweir SdrObject* pObj = pMark->GetMarkedSdrObj();
356cdf0e10cSrcweir
357cdf0e10cSrcweir SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( pObj );
358cdf0e10cSrcweir if(pOle2Obj)
359cdf0e10cSrcweir {
360cdf0e10cSrcweir if( pOle2Obj->GetObjRef().is() )
361cdf0e10cSrcweir {
362cdf0e10cSrcweir pOle2Obj->SetLogicRect(aRect);
363cdf0e10cSrcweir }
364cdf0e10cSrcweir }
365cdf0e10cSrcweir }
366cdf0e10cSrcweir }
367cdf0e10cSrcweir }
368cdf0e10cSrcweir rReq.Ignore ();
369cdf0e10cSrcweir break;
370cdf0e10cSrcweir }
371cdf0e10cSrcweir
372cdf0e10cSrcweir case SID_RELOAD:
373cdf0e10cSrcweir {
374cdf0e10cSrcweir // #83951#
375cdf0e10cSrcweir sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId();
376cdf0e10cSrcweir SfxViewFrame* pFrame = GetViewFrame();
377cdf0e10cSrcweir
378cdf0e10cSrcweir try
379cdf0e10cSrcweir {
380cdf0e10cSrcweir Reference< XFrame > xFrame( pFrame->GetFrame().GetFrameInterface(), UNO_SET_THROW );
381cdf0e10cSrcweir
382cdf0e10cSrcweir // Save the current configuration of panes and views.
383cdf0e10cSrcweir Reference<XControllerManager> xControllerManager (
384cdf0e10cSrcweir GetViewShellBase().GetController(), UNO_QUERY_THROW);
385cdf0e10cSrcweir Reference<XConfigurationController> xConfigurationController (
386cdf0e10cSrcweir xControllerManager->getConfigurationController(), UNO_QUERY_THROW );
387cdf0e10cSrcweir Reference<XConfiguration> xConfiguration (
388cdf0e10cSrcweir xConfigurationController->getRequestedConfiguration(), UNO_SET_THROW );
389cdf0e10cSrcweir
390cdf0e10cSrcweir SfxChildWindow* pWindow = pFrame->GetChildWindow(nId);
391cdf0e10cSrcweir if(pWindow)
392cdf0e10cSrcweir {
393cdf0e10cSrcweir Svx3DWin* p3DWin = (Svx3DWin*)(pWindow->GetWindow());
394cdf0e10cSrcweir if(p3DWin)
395cdf0e10cSrcweir p3DWin->DocumentReload();
396cdf0e10cSrcweir }
397cdf0e10cSrcweir
398cdf0e10cSrcweir // Normale Weiterleitung an ViewFrame zur Ausfuehrung
399cdf0e10cSrcweir GetViewFrame()->ExecuteSlot(rReq);
400cdf0e10cSrcweir
401cdf0e10cSrcweir // From here on we must cope with this object and the frame already being
402cdf0e10cSrcweir // deleted. Do not call any methods or use data members.
403cdf0e10cSrcweir Reference<XController> xController( xFrame->getController(), UNO_SET_THROW );
404cdf0e10cSrcweir
405cdf0e10cSrcweir // Restore the configuration.
406cdf0e10cSrcweir xControllerManager = Reference<XControllerManager>( xController, UNO_QUERY_THROW);
407cdf0e10cSrcweir xConfigurationController = Reference<XConfigurationController>(
408cdf0e10cSrcweir xControllerManager->getConfigurationController());
409cdf0e10cSrcweir if ( ! xConfigurationController.is())
410cdf0e10cSrcweir throw RuntimeException();
411cdf0e10cSrcweir xConfigurationController->restoreConfiguration(xConfiguration);
412cdf0e10cSrcweir }
413cdf0e10cSrcweir catch (RuntimeException&)
414cdf0e10cSrcweir {
415cdf0e10cSrcweir DBG_UNHANDLED_EXCEPTION();
416cdf0e10cSrcweir }
417cdf0e10cSrcweir
418cdf0e10cSrcweir // We have to return immediately to avoid accessing this object.
419cdf0e10cSrcweir return;
420cdf0e10cSrcweir }
421cdf0e10cSrcweir
422cdf0e10cSrcweir case SID_JUMPTOMARK:
423cdf0e10cSrcweir {
424cdf0e10cSrcweir if( rReq.GetArgs() )
425cdf0e10cSrcweir {
426cdf0e10cSrcweir SFX_REQUEST_ARG(rReq, pBookmark, SfxStringItem, SID_JUMPTOMARK, sal_False);
427cdf0e10cSrcweir
428cdf0e10cSrcweir if (pBookmark)
429cdf0e10cSrcweir {
430cdf0e10cSrcweir UniString sBookmark( INetURLObject::decode( pBookmark->GetValue(), '%', INetURLObject::DECODE_WITH_CHARSET ) );
431cdf0e10cSrcweir
432cdf0e10cSrcweir rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
433cdf0e10cSrcweir if(xSlideshow.is() && xSlideshow->isRunning())
434cdf0e10cSrcweir {
435cdf0e10cSrcweir xSlideshow->jumpToBookmark(sBookmark);
436cdf0e10cSrcweir }
437cdf0e10cSrcweir else
438cdf0e10cSrcweir {
439cdf0e10cSrcweir GotoBookmark( sBookmark );
440cdf0e10cSrcweir }
441cdf0e10cSrcweir }
442cdf0e10cSrcweir }
443cdf0e10cSrcweir rReq.Done();
444cdf0e10cSrcweir break;
445cdf0e10cSrcweir }
446cdf0e10cSrcweir
447cdf0e10cSrcweir case SID_OUTPUT_QUALITY_COLOR:
448cdf0e10cSrcweir case SID_OUTPUT_QUALITY_GRAYSCALE:
449cdf0e10cSrcweir case SID_OUTPUT_QUALITY_BLACKWHITE:
450cdf0e10cSrcweir case SID_OUTPUT_QUALITY_CONTRAST:
451cdf0e10cSrcweir {
452cdf0e10cSrcweir ExecReq( rReq );
453cdf0e10cSrcweir break;
454cdf0e10cSrcweir }
455cdf0e10cSrcweir
456cdf0e10cSrcweir case SID_MAIL_SCROLLBODY_PAGEDOWN:
457cdf0e10cSrcweir {
458cdf0e10cSrcweir ExecReq( rReq );
459cdf0e10cSrcweir break;
460cdf0e10cSrcweir }
461cdf0e10cSrcweir
462cdf0e10cSrcweir case SID_ATTR_YEAR2000:
463cdf0e10cSrcweir {
464cdf0e10cSrcweir FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
465cdf0e10cSrcweir if (pFormShell != NULL)
466cdf0e10cSrcweir {
467cdf0e10cSrcweir const SfxPoolItem* pItem;
468cdf0e10cSrcweir if (rReq.GetArgs()->GetItemState(
469cdf0e10cSrcweir SID_ATTR_YEAR2000, sal_True, &pItem) == SFX_ITEM_SET)
470cdf0e10cSrcweir pFormShell->SetY2KState (
471cdf0e10cSrcweir static_cast<const SfxUInt16Item*>(pItem)->GetValue());
472cdf0e10cSrcweir }
473cdf0e10cSrcweir
474cdf0e10cSrcweir rReq.Done();
475cdf0e10cSrcweir }
476cdf0e10cSrcweir break;
477cdf0e10cSrcweir
478cdf0e10cSrcweir case SID_OPT_LOCALE_CHANGED:
479cdf0e10cSrcweir {
480cdf0e10cSrcweir GetActiveWindow()->Invalidate();
481cdf0e10cSrcweir UpdatePreview( mpActualPage );
482cdf0e10cSrcweir rReq.Done();
483cdf0e10cSrcweir }
484cdf0e10cSrcweir
485cdf0e10cSrcweir default:
486cdf0e10cSrcweir break;
487cdf0e10cSrcweir }
488cdf0e10cSrcweir }
489cdf0e10cSrcweir
490cdf0e10cSrcweir /*************************************************************************
491cdf0e10cSrcweir |*
492cdf0e10cSrcweir |* SfxRequests fuer Lineale bearbeiten
493cdf0e10cSrcweir |*
494cdf0e10cSrcweir \************************************************************************/
495cdf0e10cSrcweir
ExecRuler(SfxRequest & rReq)496cdf0e10cSrcweir void DrawViewShell::ExecRuler(SfxRequest& rReq)
497cdf0e10cSrcweir {
498cdf0e10cSrcweir // waehrend einer Diashow wird nichts ausgefuehrt!
499cdf0e10cSrcweir if(HasCurrentFunction(SID_PRESENTATION))
500cdf0e10cSrcweir return;
501cdf0e10cSrcweir
502cdf0e10cSrcweir CheckLineTo (rReq);
503cdf0e10cSrcweir
504cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs();
505cdf0e10cSrcweir const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
506cdf0e10cSrcweir Size aPageSize = mpActualPage->GetSize();
507cdf0e10cSrcweir Size aViewSize = GetActiveWindow()->GetViewSize();
508cdf0e10cSrcweir SdUndoGroup* pUndoGroup = NULL;
509cdf0e10cSrcweir
510cdf0e10cSrcweir if ( rReq.GetSlot() == SID_ATTR_LONG_LRSPACE ||
511cdf0e10cSrcweir rReq.GetSlot() == SID_ATTR_LONG_ULSPACE )
512cdf0e10cSrcweir {
513cdf0e10cSrcweir pUndoGroup = new SdUndoGroup(GetDoc());
514cdf0e10cSrcweir String aString(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
515cdf0e10cSrcweir pUndoGroup->SetComment(aString);
516cdf0e10cSrcweir }
517cdf0e10cSrcweir
518cdf0e10cSrcweir switch ( rReq.GetSlot() )
519cdf0e10cSrcweir {
520cdf0e10cSrcweir case SID_ATTR_LONG_LRSPACE:
521cdf0e10cSrcweir {
522cdf0e10cSrcweir const SvxLongLRSpaceItem& rLRSpace = (const SvxLongLRSpaceItem&)
523cdf0e10cSrcweir pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_LRSPACE));
524cdf0e10cSrcweir
525cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
526cdf0e10cSrcweir {
527cdf0e10cSrcweir Rectangle aRect = maMarkRect;
528cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() + aPagePos);
529cdf0e10cSrcweir aRect.Left() = rLRSpace.GetLeft();
530cdf0e10cSrcweir aRect.Right() = aViewSize.Width() - rLRSpace.GetRight();
531cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() - aPagePos);
532cdf0e10cSrcweir if ( aRect != maMarkRect)
533cdf0e10cSrcweir {
534cdf0e10cSrcweir mpDrawView->SetAllMarkedRect(aRect);
535cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect();
536cdf0e10cSrcweir Invalidate( SID_RULER_OBJECT );
537cdf0e10cSrcweir }
538cdf0e10cSrcweir }
539cdf0e10cSrcweir else
540cdf0e10cSrcweir {
541cdf0e10cSrcweir long nLeft = Max(0L, rLRSpace.GetLeft() - aPagePos.X());
542cdf0e10cSrcweir long nRight = Max(0L, rLRSpace.GetRight() + aPagePos.X() +
543cdf0e10cSrcweir aPageSize.Width() - aViewSize.Width());
544cdf0e10cSrcweir
545cdf0e10cSrcweir sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
546cdf0e10cSrcweir sal_uInt16 i;
547cdf0e10cSrcweir for ( i = 0; i < nPageCnt; i++)
548cdf0e10cSrcweir {
549cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
550cdf0e10cSrcweir SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
551cdf0e10cSrcweir pPage,
552cdf0e10cSrcweir pPage->GetLftBorder(),
553cdf0e10cSrcweir pPage->GetRgtBorder(),
554cdf0e10cSrcweir nLeft, nRight);
555cdf0e10cSrcweir pUndoGroup->AddAction(pUndo);
556cdf0e10cSrcweir pPage->SetLftBorder(nLeft);
557cdf0e10cSrcweir pPage->SetRgtBorder(nRight);
558cdf0e10cSrcweir }
559cdf0e10cSrcweir nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
560cdf0e10cSrcweir
561cdf0e10cSrcweir for (i = 0; i < nPageCnt; i++)
562cdf0e10cSrcweir {
563cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
564cdf0e10cSrcweir SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
565cdf0e10cSrcweir pPage,
566cdf0e10cSrcweir pPage->GetLftBorder(),
567cdf0e10cSrcweir pPage->GetRgtBorder(),
568cdf0e10cSrcweir nLeft, nRight);
569cdf0e10cSrcweir pUndoGroup->AddAction(pUndo);
570cdf0e10cSrcweir pPage->SetLftBorder(nLeft);
571cdf0e10cSrcweir pPage->SetRgtBorder(nRight);
572cdf0e10cSrcweir }
573cdf0e10cSrcweir InvalidateWindows();
574cdf0e10cSrcweir }
575cdf0e10cSrcweir break;
576cdf0e10cSrcweir }
577cdf0e10cSrcweir case SID_ATTR_LONG_ULSPACE:
578cdf0e10cSrcweir {
579cdf0e10cSrcweir const SvxLongULSpaceItem& rULSpace = (const SvxLongULSpaceItem&)
580cdf0e10cSrcweir pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_ULSPACE));
581cdf0e10cSrcweir
582cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
583cdf0e10cSrcweir {
584cdf0e10cSrcweir Rectangle aRect = maMarkRect;
585cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() + aPagePos);
586cdf0e10cSrcweir aRect.Top() = rULSpace.GetUpper();
587cdf0e10cSrcweir aRect.Bottom() = aViewSize.Height() - rULSpace.GetLower();
588cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() - aPagePos);
589cdf0e10cSrcweir
590cdf0e10cSrcweir if ( aRect != maMarkRect)
591cdf0e10cSrcweir {
592cdf0e10cSrcweir mpDrawView->SetAllMarkedRect(aRect);
593cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect();
594cdf0e10cSrcweir Invalidate( SID_RULER_OBJECT );
595cdf0e10cSrcweir }
596cdf0e10cSrcweir }
597cdf0e10cSrcweir else
598cdf0e10cSrcweir {
599cdf0e10cSrcweir long nUpper = Max(0L, rULSpace.GetUpper() - aPagePos.Y());
600cdf0e10cSrcweir long nLower = Max(0L, rULSpace.GetLower() + aPagePos.Y() +
601cdf0e10cSrcweir aPageSize.Height() - aViewSize.Height());
602cdf0e10cSrcweir
603cdf0e10cSrcweir sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
604cdf0e10cSrcweir sal_uInt16 i;
605cdf0e10cSrcweir for ( i = 0; i < nPageCnt; i++)
606cdf0e10cSrcweir {
607cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
608cdf0e10cSrcweir SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
609cdf0e10cSrcweir pPage,
610cdf0e10cSrcweir pPage->GetUppBorder(),
611cdf0e10cSrcweir pPage->GetLwrBorder(),
612cdf0e10cSrcweir nUpper, nLower);
613cdf0e10cSrcweir pUndoGroup->AddAction(pUndo);
614cdf0e10cSrcweir pPage->SetUppBorder(nUpper);
615cdf0e10cSrcweir pPage->SetLwrBorder(nLower);
616cdf0e10cSrcweir }
617cdf0e10cSrcweir nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
618cdf0e10cSrcweir
619cdf0e10cSrcweir for (i = 0; i < nPageCnt; i++)
620cdf0e10cSrcweir {
621cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
622cdf0e10cSrcweir SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
623cdf0e10cSrcweir pPage,
624cdf0e10cSrcweir pPage->GetUppBorder(),
625cdf0e10cSrcweir pPage->GetLwrBorder(),
626cdf0e10cSrcweir nUpper, nLower);
627cdf0e10cSrcweir pUndoGroup->AddAction(pUndo);
628cdf0e10cSrcweir pPage->SetUppBorder(nUpper);
629cdf0e10cSrcweir pPage->SetLwrBorder(nLower);
630cdf0e10cSrcweir }
631cdf0e10cSrcweir InvalidateWindows();
632cdf0e10cSrcweir }
633cdf0e10cSrcweir break;
634cdf0e10cSrcweir }
635cdf0e10cSrcweir
636cdf0e10cSrcweir case SID_RULER_OBJECT:
637cdf0e10cSrcweir {
638cdf0e10cSrcweir Rectangle aRect = maMarkRect;
639cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() + aPagePos);
640cdf0e10cSrcweir
641cdf0e10cSrcweir const SvxObjectItem& rOI = (const SvxObjectItem&)
642cdf0e10cSrcweir pArgs->Get(GetPool().GetWhich(SID_RULER_OBJECT));
643cdf0e10cSrcweir
644cdf0e10cSrcweir if ( rOI.GetStartX() != rOI.GetEndX() )
645cdf0e10cSrcweir {
646cdf0e10cSrcweir aRect.Left() = rOI.GetStartX();
647cdf0e10cSrcweir aRect.Right() = rOI.GetEndX();
648cdf0e10cSrcweir }
649cdf0e10cSrcweir if ( rOI.GetStartY() != rOI.GetEndY() )
650cdf0e10cSrcweir {
651cdf0e10cSrcweir aRect.Top() = rOI.GetStartY();
652cdf0e10cSrcweir aRect.Bottom() = rOI.GetEndY();
653cdf0e10cSrcweir }
654cdf0e10cSrcweir aRect.SetPos(aRect.TopLeft() - aPagePos);
655cdf0e10cSrcweir if ( aRect != maMarkRect)
656cdf0e10cSrcweir {
657cdf0e10cSrcweir mpDrawView->SetAllMarkedRect(aRect);
658cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect();
659cdf0e10cSrcweir Invalidate( SID_RULER_OBJECT );
660cdf0e10cSrcweir }
661cdf0e10cSrcweir break;
662cdf0e10cSrcweir }
663cdf0e10cSrcweir
664cdf0e10cSrcweir case SID_ATTR_TABSTOP:
665cdf0e10cSrcweir {
666cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
667cdf0e10cSrcweir {
668cdf0e10cSrcweir const SvxTabStopItem& rItem = (const SvxTabStopItem&)
669cdf0e10cSrcweir pArgs->Get( EE_PARA_TABS );
670cdf0e10cSrcweir
671cdf0e10cSrcweir SfxItemSet aEditAttr( GetPool(), EE_PARA_TABS, EE_PARA_TABS );
672cdf0e10cSrcweir
673cdf0e10cSrcweir aEditAttr.Put( rItem );
674cdf0e10cSrcweir mpDrawView->SetAttributes( aEditAttr );
675cdf0e10cSrcweir
676cdf0e10cSrcweir // #91081# Invalidate is missing here
677cdf0e10cSrcweir Invalidate(SID_ATTR_TABSTOP);
678cdf0e10cSrcweir }
679cdf0e10cSrcweir break;
680cdf0e10cSrcweir }
681cdf0e10cSrcweir
682766ce4d0SZheng Fan case SID_ATTR_PARA_LINESPACE:
683766ce4d0SZheng Fan {
684766ce4d0SZheng Fan sal_uInt16 nSlot = SID_ATTR_PARA_LINESPACE;
685766ce4d0SZheng Fan SvxLineSpacingItem aParaLineSP = (const SvxLineSpacingItem&)pArgs->Get(
686766ce4d0SZheng Fan GetPool().GetWhich(nSlot));
687766ce4d0SZheng Fan
688766ce4d0SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_SBL, EE_PARA_SBL );
689766ce4d0SZheng Fan aParaLineSP.SetWhich( EE_PARA_SBL );
690766ce4d0SZheng Fan
691766ce4d0SZheng Fan aEditAttr.Put( aParaLineSP );
692766ce4d0SZheng Fan mpDrawView->SetAttributes( aEditAttr );
693766ce4d0SZheng Fan
694766ce4d0SZheng Fan Invalidate(SID_ATTR_PARA_LINESPACE);
695766ce4d0SZheng Fan }
696766ce4d0SZheng Fan break;
697*512ec161SZheng Fan case SID_ATTR_PARA_ADJUST_LEFT:
698*512ec161SZheng Fan {
699*512ec161SZheng Fan SvxAdjustItem aItem( SVX_ADJUST_LEFT, EE_PARA_JUST );
700*512ec161SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
701*512ec161SZheng Fan
702*512ec161SZheng Fan aEditAttr.Put( aItem );
703*512ec161SZheng Fan mpDrawView->SetAttributes( aEditAttr );
704*512ec161SZheng Fan
705*512ec161SZheng Fan Invalidate(SID_ATTR_PARA_ADJUST_LEFT);
706*512ec161SZheng Fan }
707*512ec161SZheng Fan break;
708*512ec161SZheng Fan case SID_ATTR_PARA_ADJUST_CENTER:
709*512ec161SZheng Fan {
710*512ec161SZheng Fan SvxAdjustItem aItem( SVX_ADJUST_CENTER, EE_PARA_JUST );
711*512ec161SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
712*512ec161SZheng Fan
713*512ec161SZheng Fan aEditAttr.Put( aItem );
714*512ec161SZheng Fan mpDrawView->SetAttributes( aEditAttr );
715*512ec161SZheng Fan
716*512ec161SZheng Fan Invalidate(SID_ATTR_PARA_ADJUST_CENTER);
717*512ec161SZheng Fan }
718*512ec161SZheng Fan break;
719*512ec161SZheng Fan case SID_ATTR_PARA_ADJUST_RIGHT:
720*512ec161SZheng Fan {
721*512ec161SZheng Fan SvxAdjustItem aItem( SVX_ADJUST_RIGHT, EE_PARA_JUST );
722*512ec161SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
723*512ec161SZheng Fan
724*512ec161SZheng Fan aEditAttr.Put( aItem );
725*512ec161SZheng Fan mpDrawView->SetAttributes( aEditAttr );
726*512ec161SZheng Fan
727*512ec161SZheng Fan Invalidate(SID_ATTR_PARA_ADJUST_RIGHT);
728*512ec161SZheng Fan }
729*512ec161SZheng Fan break;
730*512ec161SZheng Fan case SID_ATTR_PARA_ADJUST_BLOCK:
731*512ec161SZheng Fan {
732*512ec161SZheng Fan SvxAdjustItem aItem( SVX_ADJUST_BLOCK, EE_PARA_JUST );
733*512ec161SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
734*512ec161SZheng Fan
735*512ec161SZheng Fan aEditAttr.Put( aItem );
736*512ec161SZheng Fan mpDrawView->SetAttributes( aEditAttr );
737*512ec161SZheng Fan
738*512ec161SZheng Fan Invalidate(SID_ATTR_PARA_ADJUST_BLOCK);
739*512ec161SZheng Fan }
740*512ec161SZheng Fan break;
741766ce4d0SZheng Fan case SID_ATTR_PARA_ULSPACE:
742766ce4d0SZheng Fan {
743766ce4d0SZheng Fan sal_uInt16 nSlot = SID_ATTR_PARA_ULSPACE;
744766ce4d0SZheng Fan SvxULSpaceItem aULSP = (const SvxULSpaceItem&)pArgs->Get(
745766ce4d0SZheng Fan GetPool().GetWhich(nSlot));
746766ce4d0SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_ULSPACE, EE_PARA_ULSPACE );
747766ce4d0SZheng Fan aULSP.SetWhich( EE_PARA_ULSPACE );
748766ce4d0SZheng Fan
749766ce4d0SZheng Fan aEditAttr.Put( aULSP );
750766ce4d0SZheng Fan mpDrawView->SetAttributes( aEditAttr );
751766ce4d0SZheng Fan
752766ce4d0SZheng Fan Invalidate(SID_ATTR_PARA_ULSPACE);
753766ce4d0SZheng Fan }
754766ce4d0SZheng Fan break;
755766ce4d0SZheng Fan
756cdf0e10cSrcweir case SID_ATTR_PARA_LRSPACE:
757cdf0e10cSrcweir {
7581ff378efSZheng Fan sal_uInt16 nSlot = SID_ATTR_PARA_LRSPACE;
7591ff378efSZheng Fan SvxLRSpaceItem aLRSpace = (const SvxLRSpaceItem&)pArgs->Get(
7601ff378efSZheng Fan GetPool().GetWhich(nSlot));
761cdf0e10cSrcweir
7621ff378efSZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
7631ff378efSZheng Fan aLRSpace.SetWhich( EE_PARA_LRSPACE );
764cdf0e10cSrcweir
7651ff378efSZheng Fan aEditAttr.Put( aLRSpace );
7661ff378efSZheng Fan mpDrawView->SetAttributes( aEditAttr );
767cdf0e10cSrcweir
7681ff378efSZheng Fan Invalidate(SID_ATTR_PARA_LRSPACE);
769cdf0e10cSrcweir break;
770cdf0e10cSrcweir }
771766ce4d0SZheng Fan case SID_ATTR_LRSPACE:
772766ce4d0SZheng Fan {
773766ce4d0SZheng Fan if( mpDrawView->IsTextEdit() )
774766ce4d0SZheng Fan {
775766ce4d0SZheng Fan sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
776766ce4d0SZheng Fan const SvxLRSpaceItem& rItem = (const SvxLRSpaceItem&)
777766ce4d0SZheng Fan pArgs->Get( nId );
778766ce4d0SZheng Fan
779766ce4d0SZheng Fan SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
780766ce4d0SZheng Fan
781766ce4d0SZheng Fan nId = EE_PARA_LRSPACE;
782766ce4d0SZheng Fan SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
783766ce4d0SZheng Fan rItem.GetRight(), rItem.GetTxtLeft(),
784766ce4d0SZheng Fan rItem.GetTxtFirstLineOfst(), nId );
785766ce4d0SZheng Fan aEditAttr.Put( aLRSpaceItem );
786766ce4d0SZheng Fan mpDrawView->SetAttributes( aEditAttr );
787766ce4d0SZheng Fan
788766ce4d0SZheng Fan // #92557# Invalidate is missing here
789766ce4d0SZheng Fan Invalidate(SID_ATTR_PARA_LRSPACE);
790766ce4d0SZheng Fan }
791766ce4d0SZheng Fan break;
792766ce4d0SZheng Fan }
793cdf0e10cSrcweir }
794cdf0e10cSrcweir if ( pUndoGroup )
795cdf0e10cSrcweir // Undo Gruppe dem Undo Manager uebergeben
796cdf0e10cSrcweir GetViewFrame()->GetObjectShell()->GetUndoManager()->
797cdf0e10cSrcweir AddUndoAction(pUndoGroup);
798cdf0e10cSrcweir }
799cdf0e10cSrcweir
800cdf0e10cSrcweir /*************************************************************************
801cdf0e10cSrcweir |*
802cdf0e10cSrcweir |* Statuswerte der Lineale bestimmen
803cdf0e10cSrcweir |*
804cdf0e10cSrcweir \************************************************************************/
GetRulerState(SfxItemSet & rSet)805cdf0e10cSrcweir void DrawViewShell::GetRulerState(SfxItemSet& rSet)
806cdf0e10cSrcweir {
807cdf0e10cSrcweir Point aOrigin;
808cdf0e10cSrcweir
809cdf0e10cSrcweir if (mpDrawView->GetSdrPageView())
810cdf0e10cSrcweir {
811cdf0e10cSrcweir aOrigin = mpDrawView->GetSdrPageView()->GetPageOrigin();
812cdf0e10cSrcweir }
813cdf0e10cSrcweir
814cdf0e10cSrcweir Size aViewSize = GetActiveWindow()->GetViewSize();
815cdf0e10cSrcweir
816cdf0e10cSrcweir const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
817cdf0e10cSrcweir Size aPageSize = mpActualPage->GetSize();
818cdf0e10cSrcweir
819cdf0e10cSrcweir Rectangle aRect(aPagePos, Point( aViewSize.Width() - (aPagePos.X() + aPageSize.Width()),
820cdf0e10cSrcweir aViewSize.Height() - (aPagePos.Y() + aPageSize.Height())));
821cdf0e10cSrcweir
822cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
823cdf0e10cSrcweir {
824cdf0e10cSrcweir Point aPnt1 = GetActiveWindow()->GetWinViewPos();
825cdf0e10cSrcweir Point aPnt2 = GetActiveWindow()->GetViewOrigin();
826cdf0e10cSrcweir Rectangle aMinMaxRect = Rectangle( aPnt1, Size(ULONG_MAX, ULONG_MAX) );
827cdf0e10cSrcweir rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aMinMaxRect) );
828cdf0e10cSrcweir }
829cdf0e10cSrcweir else
830cdf0e10cSrcweir {
831cdf0e10cSrcweir rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aRect) );
832cdf0e10cSrcweir }
833cdf0e10cSrcweir
834cdf0e10cSrcweir SvxLongLRSpaceItem aLRSpace(aPagePos.X() + mpActualPage->GetLftBorder(),
835cdf0e10cSrcweir aRect.Right() + mpActualPage->GetRgtBorder(),
836cdf0e10cSrcweir GetPool().GetWhich(SID_ATTR_LONG_LRSPACE));
837cdf0e10cSrcweir SvxLongULSpaceItem aULSpace(aPagePos.Y() + mpActualPage->GetUppBorder(),
838cdf0e10cSrcweir aRect.Bottom() + mpActualPage->GetLwrBorder(),
839cdf0e10cSrcweir GetPool().GetWhich(SID_ATTR_LONG_ULSPACE));
840cdf0e10cSrcweir rSet.Put(SvxPagePosSizeItem(Point(0,0) - aPagePos, aViewSize.Width(),
841cdf0e10cSrcweir aViewSize.Height()));
842cdf0e10cSrcweir SfxPointItem aPointItem( SID_RULER_NULL_OFFSET, aPagePos + aOrigin );
843cdf0e10cSrcweir
844cdf0e10cSrcweir SvxProtectItem aProtect( SID_RULER_PROTECT );
845cdf0e10cSrcweir
846cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect();
847cdf0e10cSrcweir
848cdf0e10cSrcweir const sal_Bool bRTL = GetDoc() && GetDoc()->GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB;
849cdf0e10cSrcweir rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, bRTL));
850cdf0e10cSrcweir
851cdf0e10cSrcweir if( mpDrawView->AreObjectsMarked() )
852cdf0e10cSrcweir {
853cdf0e10cSrcweir if( mpDrawView->IsTextEdit() )
854cdf0e10cSrcweir {
855cdf0e10cSrcweir SdrObject* pObj = mpDrawView->GetMarkedObjectList().GetMark( 0 )->GetMarkedSdrObj();
856cdf0e10cSrcweir if( pObj->GetObjInventor() == SdrInventor)
857cdf0e10cSrcweir {
858cdf0e10cSrcweir SfxItemSet aEditAttr( GetDoc()->GetPool() );
859cdf0e10cSrcweir mpDrawView->GetAttributes( aEditAttr );
860cdf0e10cSrcweir if( aEditAttr.GetItemState( EE_PARA_TABS ) >= SFX_ITEM_AVAILABLE )
861cdf0e10cSrcweir {
862cdf0e10cSrcweir const SvxTabStopItem& rItem = (const SvxTabStopItem&) aEditAttr.Get( EE_PARA_TABS );
863cdf0e10cSrcweir rSet.Put( rItem );
864cdf0e10cSrcweir
865cdf0e10cSrcweir //Rectangle aRect = maMarkRect;
866cdf0e10cSrcweir
867cdf0e10cSrcweir const SvxLRSpaceItem& rLRSpaceItem = (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE );
868cdf0e10cSrcweir sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
869cdf0e10cSrcweir SvxLRSpaceItem aLRSpaceItem( rLRSpaceItem.GetLeft(),
870cdf0e10cSrcweir rLRSpaceItem.GetRight(), rLRSpaceItem.GetTxtLeft(),
871cdf0e10cSrcweir rLRSpaceItem.GetTxtFirstLineOfst(), nId );
872cdf0e10cSrcweir rSet.Put( aLRSpaceItem );
873cdf0e10cSrcweir
874cdf0e10cSrcweir Point aPos( aPagePos + maMarkRect.TopLeft() );
875cdf0e10cSrcweir
876cdf0e10cSrcweir if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SFX_ITEM_ON )
877cdf0e10cSrcweir {
878cdf0e10cSrcweir const SdrTextLeftDistItem& rTLDItem = (const SdrTextLeftDistItem&)
879cdf0e10cSrcweir aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
880cdf0e10cSrcweir long nLD = rTLDItem.GetValue();
881cdf0e10cSrcweir aPos.X() += nLD;
882cdf0e10cSrcweir }
883cdf0e10cSrcweir
884cdf0e10cSrcweir aPointItem.SetValue( aPos );
885cdf0e10cSrcweir
886cdf0e10cSrcweir aLRSpace.SetLeft( aPagePos.X() + maMarkRect.Left() );
887cdf0e10cSrcweir
888cdf0e10cSrcweir if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SFX_ITEM_ON )
889cdf0e10cSrcweir {
890cdf0e10cSrcweir const SdrTextLeftDistItem& rTLDItem = (const SdrTextLeftDistItem&)
891cdf0e10cSrcweir aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
892cdf0e10cSrcweir long nLD = rTLDItem.GetValue();
893cdf0e10cSrcweir aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD );
894cdf0e10cSrcweir }
895cdf0e10cSrcweir
896cdf0e10cSrcweir aLRSpace.SetRight( aRect.Right() + aPageSize.Width() - maMarkRect.Right() );
897cdf0e10cSrcweir aULSpace.SetUpper( aPagePos.Y() + maMarkRect.Top() );
898cdf0e10cSrcweir aULSpace.SetLower( aRect.Bottom() + aPageSize.Height() - maMarkRect.Bottom() );
899cdf0e10cSrcweir
900cdf0e10cSrcweir rSet.DisableItem( SID_RULER_OBJECT );
901cdf0e10cSrcweir
902cdf0e10cSrcweir // Seitenraender werden gelocked
903cdf0e10cSrcweir aProtect.SetSizeProtect( sal_True );
904cdf0e10cSrcweir aProtect.SetPosProtect( sal_True );
905cdf0e10cSrcweir }
906cdf0e10cSrcweir
907cdf0e10cSrcweir if( aEditAttr.GetItemState( EE_PARA_WRITINGDIR ) >= SFX_ITEM_AVAILABLE )
908cdf0e10cSrcweir {
909cdf0e10cSrcweir const SvxFrameDirectionItem& rItem = (const SvxFrameDirectionItem&) aEditAttr.Get( EE_PARA_WRITINGDIR );
910cdf0e10cSrcweir rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == ::com::sun::star::text::WritingMode_RL_TB));
911cdf0e10cSrcweir }
912cdf0e10cSrcweir }
913cdf0e10cSrcweir }
914cdf0e10cSrcweir else
915cdf0e10cSrcweir {
916cdf0e10cSrcweir rSet.DisableItem( EE_PARA_TABS );
917cdf0e10cSrcweir rSet.DisableItem( SID_RULER_TEXT_RIGHT_TO_LEFT );
918cdf0e10cSrcweir
919cdf0e10cSrcweir if( mpDrawView->IsResizeAllowed(sal_True) )
920cdf0e10cSrcweir {
921cdf0e10cSrcweir Rectangle aResizeRect( maMarkRect );
922cdf0e10cSrcweir
923cdf0e10cSrcweir aResizeRect.SetPos(aResizeRect.TopLeft() + aPagePos);
924cdf0e10cSrcweir SvxObjectItem aObjItem(aResizeRect.Left(), aResizeRect.Right(),
925cdf0e10cSrcweir aResizeRect.Top(), aResizeRect.Bottom());
926cdf0e10cSrcweir rSet.Put(aObjItem);
927cdf0e10cSrcweir rSet.DisableItem( EE_PARA_TABS );
928cdf0e10cSrcweir }
929cdf0e10cSrcweir else
930cdf0e10cSrcweir {
931cdf0e10cSrcweir rSet.DisableItem( SID_RULER_OBJECT );
932cdf0e10cSrcweir }
933cdf0e10cSrcweir }
934cdf0e10cSrcweir }
935cdf0e10cSrcweir else
936cdf0e10cSrcweir {
937cdf0e10cSrcweir rSet.DisableItem( SID_RULER_OBJECT );
938cdf0e10cSrcweir rSet.DisableItem( EE_PARA_TABS );
939cdf0e10cSrcweir // rSet.DisableItem( SID_RULER_TEXT_RIGHT_TO_LEFT );
940cdf0e10cSrcweir }
941cdf0e10cSrcweir
942cdf0e10cSrcweir rSet.Put( aLRSpace );
943cdf0e10cSrcweir rSet.Put( aULSpace );
944cdf0e10cSrcweir
945cdf0e10cSrcweir rSet.Put( aPointItem );
946cdf0e10cSrcweir rSet.Put( aProtect );
947cdf0e10cSrcweir }
948cdf0e10cSrcweir
949cdf0e10cSrcweir /*************************************************************************
950cdf0e10cSrcweir |*
951cdf0e10cSrcweir |* SfxRequests fuer StatusBar bearbeiten
952cdf0e10cSrcweir |*
953cdf0e10cSrcweir \************************************************************************/
954cdf0e10cSrcweir
ExecStatusBar(SfxRequest & rReq)955cdf0e10cSrcweir void DrawViewShell::ExecStatusBar(SfxRequest& rReq)
956cdf0e10cSrcweir {
957cdf0e10cSrcweir // waehrend einer Diashow wird nichts ausgefuehrt!
958cdf0e10cSrcweir if(HasCurrentFunction(SID_PRESENTATION))
959cdf0e10cSrcweir return;
960cdf0e10cSrcweir
961cdf0e10cSrcweir CheckLineTo (rReq);
962cdf0e10cSrcweir
963cdf0e10cSrcweir switch ( rReq.GetSlot() )
964cdf0e10cSrcweir {
965cdf0e10cSrcweir case SID_ATTR_SIZE:
966cdf0e10cSrcweir {
967cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_TRANSFORM, SFX_CALLMODE_ASYNCHRON );
968cdf0e10cSrcweir }
969cdf0e10cSrcweir break;
970cdf0e10cSrcweir
971cdf0e10cSrcweir case SID_STATUS_LAYOUT:
972cdf0e10cSrcweir {
973cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION_LAYOUT, SFX_CALLMODE_ASYNCHRON );
974cdf0e10cSrcweir }
975cdf0e10cSrcweir break;
976cdf0e10cSrcweir }
977cdf0e10cSrcweir }
978cdf0e10cSrcweir
979cdf0e10cSrcweir /*************************************************************************
980cdf0e10cSrcweir |*
981cdf0e10cSrcweir |* Status der Snap-Objekt-Eintraege im Popup setzen
982cdf0e10cSrcweir |*
983cdf0e10cSrcweir \************************************************************************/
984cdf0e10cSrcweir
GetSnapItemState(SfxItemSet & rSet)985cdf0e10cSrcweir void DrawViewShell::GetSnapItemState( SfxItemSet &rSet )
986cdf0e10cSrcweir {
987cdf0e10cSrcweir SdrPageView* pPV;
988cdf0e10cSrcweir Point aMPos = GetActiveWindow()->PixelToLogic(maMousePos);
989cdf0e10cSrcweir sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic(
990cdf0e10cSrcweir Size(FuPoor::HITPIX,0)).Width();
991cdf0e10cSrcweir sal_uInt16 nHelpLine;
992cdf0e10cSrcweir
993cdf0e10cSrcweir if ( mpDrawView->PickHelpLine(aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
994cdf0e10cSrcweir {
995cdf0e10cSrcweir const SdrHelpLine& rHelpLine = (pPV->GetHelpLines())[nHelpLine];
996cdf0e10cSrcweir
997cdf0e10cSrcweir if ( rHelpLine.GetKind() == SDRHELPLINE_POINT )
998cdf0e10cSrcweir {
999cdf0e10cSrcweir rSet.Put( SfxStringItem( SID_SET_SNAPITEM,
1000cdf0e10cSrcweir String( SdResId( STR_POPUP_EDIT_SNAPPOINT))) );
1001cdf0e10cSrcweir rSet.Put( SfxStringItem( SID_DELETE_SNAPITEM,
1002cdf0e10cSrcweir String( SdResId( STR_POPUP_DELETE_SNAPPOINT))) );
1003cdf0e10cSrcweir }
1004cdf0e10cSrcweir else
1005cdf0e10cSrcweir {
1006cdf0e10cSrcweir rSet.Put( SfxStringItem( SID_SET_SNAPITEM,
1007cdf0e10cSrcweir String( SdResId( STR_POPUP_EDIT_SNAPLINE))) );
1008cdf0e10cSrcweir rSet.Put( SfxStringItem( SID_DELETE_SNAPITEM,
1009cdf0e10cSrcweir String( SdResId( STR_POPUP_DELETE_SNAPLINE))) );
1010cdf0e10cSrcweir }
1011cdf0e10cSrcweir }
1012cdf0e10cSrcweir }
1013cdf0e10cSrcweir
1014cdf0e10cSrcweir
1015cdf0e10cSrcweir /*************************************************************************
1016cdf0e10cSrcweir |*
1017cdf0e10cSrcweir |*
1018cdf0e10cSrcweir |*
1019cdf0e10cSrcweir \************************************************************************/
1020cdf0e10cSrcweir
AddWindow(::sd::Window * pWin)1021cdf0e10cSrcweir void DrawViewShell::AddWindow (::sd::Window* pWin)
1022cdf0e10cSrcweir {
1023cdf0e10cSrcweir mpDrawView->AddWindowToPaintView(pWin);
1024cdf0e10cSrcweir }
1025cdf0e10cSrcweir
1026cdf0e10cSrcweir /*************************************************************************
1027cdf0e10cSrcweir |*
1028cdf0e10cSrcweir |*
1029cdf0e10cSrcweir |*
1030cdf0e10cSrcweir \************************************************************************/
1031cdf0e10cSrcweir
RemoveWindow(::sd::Window * pWin)1032cdf0e10cSrcweir void DrawViewShell::RemoveWindow(::sd::Window* pWin)
1033cdf0e10cSrcweir {
1034cdf0e10cSrcweir mpDrawView->DeleteWindowFromPaintView(pWin);
1035cdf0e10cSrcweir }
1036cdf0e10cSrcweir
1037cdf0e10cSrcweir } // end of namespace sd
1038