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