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 #include "ViewShellImplementation.hxx" 29cdf0e10cSrcweir #include <vcl/waitobj.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir #ifndef _SVXIDS_HRC 32cdf0e10cSrcweir #include <svx/svxids.hrc> 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir #include <svx/dialogs.hrc> 35cdf0e10cSrcweir #ifndef _IMAPDLG_HXX 36cdf0e10cSrcweir #include <svx/imapdlg.hxx> 37cdf0e10cSrcweir #endif 38cdf0e10cSrcweir #include <vcl/msgbox.hxx> 39cdf0e10cSrcweir #include <sfx2/request.hxx> 40cdf0e10cSrcweir #include <svx/svdogrp.hxx> 41cdf0e10cSrcweir #include <svx/svdoole2.hxx> 42cdf0e10cSrcweir #include <svx/svdograf.hxx> 43cdf0e10cSrcweir #include <svx/svxdlg.hxx> 44cdf0e10cSrcweir #ifndef _BINDING_HXX //autogen 45cdf0e10cSrcweir #include <sfx2/bindings.hxx> 46cdf0e10cSrcweir #endif 47cdf0e10cSrcweir #include <sfx2/dispatch.hxx> 48cdf0e10cSrcweir #include <svx/svdoole2.hxx> 49cdf0e10cSrcweir #include <svl/style.hxx> 50cdf0e10cSrcweir #include <svx/svdpagv.hxx> 51cdf0e10cSrcweir #include <svx/grafctrl.hxx> 52cdf0e10cSrcweir #include "stlsheet.hxx" 53cdf0e10cSrcweir 54cdf0e10cSrcweir #include <sfx2/viewfrm.hxx> 55cdf0e10cSrcweir 56cdf0e10cSrcweir #include "app.hrc" 57cdf0e10cSrcweir #include "strings.hrc" 58cdf0e10cSrcweir #include "helpids.h" 59cdf0e10cSrcweir #include "misc.hxx" 60cdf0e10cSrcweir #include "Window.hxx" 61cdf0e10cSrcweir #include "imapinfo.hxx" 62cdf0e10cSrcweir #include "futempl.hxx" 63cdf0e10cSrcweir #include "fusel.hxx" 64cdf0e10cSrcweir #include "sdresid.hxx" 65cdf0e10cSrcweir #include "drawdoc.hxx" 66cdf0e10cSrcweir #include "DrawDocShell.hxx" 67cdf0e10cSrcweir #include "drawview.hxx" 68cdf0e10cSrcweir #include "sdabstdlg.hxx" 69cdf0e10cSrcweir #include "brkdlg.hrc" 70cdf0e10cSrcweir namespace sd { 71cdf0e10cSrcweir 72cdf0e10cSrcweir #define MIN_ACTIONS_FOR_DIALOG 5000 // bei mehr als 1600 Metaobjekten 73cdf0e10cSrcweir // wird beim Aufbrechen ein Dialog 74cdf0e10cSrcweir // angezeigt. 75cdf0e10cSrcweir /************************************************************************* 76cdf0e10cSrcweir |* 77cdf0e10cSrcweir |* SfxRequests fuer temporaere Funktionen 78cdf0e10cSrcweir |* 79cdf0e10cSrcweir \************************************************************************/ 80cdf0e10cSrcweir 81cdf0e10cSrcweir void DrawViewShell::FuTemp03(SfxRequest& rReq) 82cdf0e10cSrcweir { 83cdf0e10cSrcweir sal_uInt16 nSId = rReq.GetSlot(); 84cdf0e10cSrcweir switch( nSId ) 85cdf0e10cSrcweir { 86cdf0e10cSrcweir case SID_GROUP: // BASIC 87cdf0e10cSrcweir { 88cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected( sal_True, sal_True, sal_True ) ) 89cdf0e10cSrcweir { 90cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 91cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 92cdf0e10cSrcweir } 93cdf0e10cSrcweir else 94cdf0e10cSrcweir { 95cdf0e10cSrcweir mpDrawView->GroupMarked(); 96cdf0e10cSrcweir } 97cdf0e10cSrcweir Cancel(); 98cdf0e10cSrcweir rReq.Done (); 99cdf0e10cSrcweir } 100cdf0e10cSrcweir break; 101cdf0e10cSrcweir 102cdf0e10cSrcweir case SID_UNGROUP: // BASIC 103cdf0e10cSrcweir { 104cdf0e10cSrcweir mpDrawView->UnGroupMarked(); 105cdf0e10cSrcweir Cancel(); 106cdf0e10cSrcweir rReq.Done (); 107cdf0e10cSrcweir } 108cdf0e10cSrcweir break; 109cdf0e10cSrcweir 110cdf0e10cSrcweir case SID_NAME_GROUP: 111cdf0e10cSrcweir { 112cdf0e10cSrcweir // only allow for single object selection since the name of an object needs 113cdf0e10cSrcweir // to be unique 114cdf0e10cSrcweir if(1L == mpDrawView->GetMarkedObjectCount()) 115cdf0e10cSrcweir { 116cdf0e10cSrcweir // #i68101# 117cdf0e10cSrcweir SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L); 118cdf0e10cSrcweir OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)"); 119cdf0e10cSrcweir String aName(pSelected->GetName()); 120cdf0e10cSrcweir 121cdf0e10cSrcweir SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); 122cdf0e10cSrcweir OSL_ENSURE(pFact, "Dialogdiet fail!"); 123cdf0e10cSrcweir AbstractSvxObjectNameDialog* pDlg = pFact->CreateSvxObjectNameDialog(NULL, aName); 124cdf0e10cSrcweir OSL_ENSURE(pDlg, "Dialogdiet fail!"); 125cdf0e10cSrcweir 126cdf0e10cSrcweir pDlg->SetCheckNameHdl(LINK(this, DrawViewShell, NameObjectHdl)); 127cdf0e10cSrcweir 128cdf0e10cSrcweir if(RET_OK == pDlg->Execute()) 129cdf0e10cSrcweir { 130cdf0e10cSrcweir pDlg->GetName(aName); 131cdf0e10cSrcweir pSelected->SetName(aName); 132cdf0e10cSrcweir } 133cdf0e10cSrcweir 134cdf0e10cSrcweir delete pDlg; 135cdf0e10cSrcweir } 136cdf0e10cSrcweir 137cdf0e10cSrcweir SfxBindings& rBindings = GetViewFrame()->GetBindings(); 138cdf0e10cSrcweir rBindings.Invalidate( SID_NAVIGATOR_STATE, sal_True, sal_False ); 139cdf0e10cSrcweir rBindings.Invalidate( SID_CONTEXT ); 140cdf0e10cSrcweir 141cdf0e10cSrcweir Cancel(); 142cdf0e10cSrcweir rReq.Ignore(); 143cdf0e10cSrcweir break; 144cdf0e10cSrcweir } 145cdf0e10cSrcweir 146cdf0e10cSrcweir // #i68101# 147cdf0e10cSrcweir case SID_OBJECT_TITLE_DESCRIPTION: 148cdf0e10cSrcweir { 149cdf0e10cSrcweir if(1L == mpDrawView->GetMarkedObjectCount()) 150cdf0e10cSrcweir { 151cdf0e10cSrcweir SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L); 152cdf0e10cSrcweir OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)"); 153cdf0e10cSrcweir String aTitle(pSelected->GetTitle()); 154cdf0e10cSrcweir String aDescription(pSelected->GetDescription()); 155cdf0e10cSrcweir 156cdf0e10cSrcweir SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); 157cdf0e10cSrcweir OSL_ENSURE(pFact, "Dialogdiet fail!"); 158cdf0e10cSrcweir AbstractSvxObjectTitleDescDialog* pDlg = pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription); 159cdf0e10cSrcweir OSL_ENSURE(pDlg, "Dialogdiet fail!"); 160cdf0e10cSrcweir 161cdf0e10cSrcweir if(RET_OK == pDlg->Execute()) 162cdf0e10cSrcweir { 163cdf0e10cSrcweir pDlg->GetTitle(aTitle); 164cdf0e10cSrcweir pDlg->GetDescription(aDescription); 165cdf0e10cSrcweir pSelected->SetTitle(aTitle); 166cdf0e10cSrcweir pSelected->SetDescription(aDescription); 167cdf0e10cSrcweir } 168cdf0e10cSrcweir 169cdf0e10cSrcweir delete pDlg; 170cdf0e10cSrcweir } 171cdf0e10cSrcweir 172cdf0e10cSrcweir SfxBindings& rBindings = GetViewFrame()->GetBindings(); 173cdf0e10cSrcweir rBindings.Invalidate( SID_NAVIGATOR_STATE, sal_True, sal_False ); 174cdf0e10cSrcweir rBindings.Invalidate( SID_CONTEXT ); 175cdf0e10cSrcweir 176cdf0e10cSrcweir Cancel(); 177cdf0e10cSrcweir rReq.Ignore(); 178cdf0e10cSrcweir break; 179cdf0e10cSrcweir } 180cdf0e10cSrcweir 181cdf0e10cSrcweir case SID_ENTER_GROUP: // BASIC 182cdf0e10cSrcweir { 183cdf0e10cSrcweir mpDrawView->EnterMarkedGroup(); 184cdf0e10cSrcweir Cancel(); 185cdf0e10cSrcweir rReq.Done (); 186cdf0e10cSrcweir } 187cdf0e10cSrcweir break; 188cdf0e10cSrcweir 189cdf0e10cSrcweir case SID_LEAVE_GROUP: // BASIC 190cdf0e10cSrcweir { 191cdf0e10cSrcweir mpDrawView->LeaveOneGroup(); 192cdf0e10cSrcweir Cancel(); 193cdf0e10cSrcweir rReq.Done (); 194cdf0e10cSrcweir } 195cdf0e10cSrcweir break; 196cdf0e10cSrcweir 197cdf0e10cSrcweir case SID_LEAVE_ALL_GROUPS: // BASIC 198cdf0e10cSrcweir { 199cdf0e10cSrcweir mpDrawView->LeaveAllGroup(); 200cdf0e10cSrcweir Cancel(); 201cdf0e10cSrcweir rReq.Done (); 202cdf0e10cSrcweir } 203cdf0e10cSrcweir break; 204cdf0e10cSrcweir 205cdf0e10cSrcweir case SID_COMBINE: // BASIC 206cdf0e10cSrcweir { 207cdf0e10cSrcweir // #88224# End text edit to avoid conflicts 208cdf0e10cSrcweir if(mpDrawView->IsTextEdit()) 209cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 210cdf0e10cSrcweir 211cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 212cdf0e10cSrcweir { 213cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 214cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 215cdf0e10cSrcweir } 216cdf0e10cSrcweir else 217cdf0e10cSrcweir { 218cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 219cdf0e10cSrcweir mpDrawView->CombineMarkedObjects(sal_False); 220cdf0e10cSrcweir } 221cdf0e10cSrcweir Cancel(); 222cdf0e10cSrcweir rReq.Done (); 223cdf0e10cSrcweir } 224cdf0e10cSrcweir break; 225cdf0e10cSrcweir 226cdf0e10cSrcweir case SID_DISTRIBUTE_DLG: 227cdf0e10cSrcweir { 228cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 229cdf0e10cSrcweir { 230cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 231cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 232cdf0e10cSrcweir } 233cdf0e10cSrcweir else 234cdf0e10cSrcweir { 235cdf0e10cSrcweir mpDrawView->DistributeMarkedObjects(); 236cdf0e10cSrcweir } 237cdf0e10cSrcweir Cancel(); 238cdf0e10cSrcweir rReq.Done (); 239cdf0e10cSrcweir } 240cdf0e10cSrcweir break; 241cdf0e10cSrcweir 242cdf0e10cSrcweir case SID_POLY_MERGE: 243cdf0e10cSrcweir { 244cdf0e10cSrcweir // #88224# End text edit to avoid conflicts 245cdf0e10cSrcweir if(mpDrawView->IsTextEdit()) 246cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 247cdf0e10cSrcweir 248cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 249cdf0e10cSrcweir { 250cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 251cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 252cdf0e10cSrcweir } 253cdf0e10cSrcweir else 254cdf0e10cSrcweir { 255cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 256cdf0e10cSrcweir mpDrawView->MergeMarkedObjects(SDR_MERGE_MERGE); 257cdf0e10cSrcweir } 258cdf0e10cSrcweir Cancel(); 259cdf0e10cSrcweir rReq.Done (); 260cdf0e10cSrcweir } 261cdf0e10cSrcweir break; 262cdf0e10cSrcweir 263cdf0e10cSrcweir case SID_POLY_SUBSTRACT: 264cdf0e10cSrcweir { 265cdf0e10cSrcweir // #88224# End text edit to avoid conflicts 266cdf0e10cSrcweir if(mpDrawView->IsTextEdit()) 267cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 268cdf0e10cSrcweir 269cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 270cdf0e10cSrcweir { 271cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 272cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 273cdf0e10cSrcweir } 274cdf0e10cSrcweir else 275cdf0e10cSrcweir { 276cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 277cdf0e10cSrcweir mpDrawView->MergeMarkedObjects(SDR_MERGE_SUBSTRACT); 278cdf0e10cSrcweir } 279cdf0e10cSrcweir Cancel(); 280cdf0e10cSrcweir rReq.Done (); 281cdf0e10cSrcweir } 282cdf0e10cSrcweir break; 283cdf0e10cSrcweir 284cdf0e10cSrcweir case SID_POLY_INTERSECT: 285cdf0e10cSrcweir { 286cdf0e10cSrcweir // #88224# End text edit to avoid conflicts 287cdf0e10cSrcweir if(mpDrawView->IsTextEdit()) 288cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 289cdf0e10cSrcweir 290cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 291cdf0e10cSrcweir { 292cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 293cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 294cdf0e10cSrcweir } 295cdf0e10cSrcweir else 296cdf0e10cSrcweir { 297cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 298cdf0e10cSrcweir mpDrawView->MergeMarkedObjects(SDR_MERGE_INTERSECT); 299cdf0e10cSrcweir } 300cdf0e10cSrcweir Cancel(); 301cdf0e10cSrcweir rReq.Done (); 302cdf0e10cSrcweir } 303cdf0e10cSrcweir break; 304cdf0e10cSrcweir 305cdf0e10cSrcweir case SID_DISMANTLE: // BASIC 306cdf0e10cSrcweir { 307cdf0e10cSrcweir if ( mpDrawView->IsDismantlePossible(sal_False) ) 308cdf0e10cSrcweir { 309cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 310cdf0e10cSrcweir mpDrawView->DismantleMarkedObjects(sal_False); 311cdf0e10cSrcweir } 312cdf0e10cSrcweir Cancel(); 313cdf0e10cSrcweir rReq.Done (); 314cdf0e10cSrcweir } 315cdf0e10cSrcweir break; 316cdf0e10cSrcweir 317cdf0e10cSrcweir case SID_CONNECT: // BASIC 318cdf0e10cSrcweir { 319cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 320cdf0e10cSrcweir { 321cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 322cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 323cdf0e10cSrcweir } 324cdf0e10cSrcweir else 325cdf0e10cSrcweir { 326cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 327cdf0e10cSrcweir mpDrawView->CombineMarkedObjects(sal_True); 328cdf0e10cSrcweir } 329cdf0e10cSrcweir Cancel(); 330cdf0e10cSrcweir rReq.Done (); 331cdf0e10cSrcweir } 332cdf0e10cSrcweir break; 333cdf0e10cSrcweir 334cdf0e10cSrcweir case SID_BREAK: // BASIC 335cdf0e10cSrcweir { 336cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 337cdf0e10cSrcweir { 338cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 339cdf0e10cSrcweir } 340cdf0e10cSrcweir 341cdf0e10cSrcweir if ( mpDrawView->IsBreak3DObjPossible() ) 342cdf0e10cSrcweir { 343cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 344cdf0e10cSrcweir mpDrawView->Break3DObj(); 345cdf0e10cSrcweir } 346cdf0e10cSrcweir else if ( mpDrawView->IsDismantlePossible(sal_True) ) 347cdf0e10cSrcweir { 348cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 349cdf0e10cSrcweir mpDrawView->DismantleMarkedObjects(sal_True); 350cdf0e10cSrcweir } 351cdf0e10cSrcweir else if ( mpDrawView->IsImportMtfPossible() ) 352cdf0e10cSrcweir { 353cdf0e10cSrcweir 354cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 355cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 356cdf0e10cSrcweir sal_uLong nAnz=rMarkList.GetMarkCount(); 357cdf0e10cSrcweir 358cdf0e10cSrcweir // Summe der Metaobjekte aller sel. Metafiles erm. 359cdf0e10cSrcweir sal_uLong nCount = 0; 360cdf0e10cSrcweir for(sal_uLong nm=0; nm<nAnz; nm++) 361cdf0e10cSrcweir { 362cdf0e10cSrcweir SdrMark* pM=rMarkList.GetMark(nm); 363cdf0e10cSrcweir SdrObject* pObj=pM->GetMarkedSdrObj(); 364cdf0e10cSrcweir SdrGrafObj* pGraf=PTR_CAST(SdrGrafObj,pObj); 365cdf0e10cSrcweir SdrOle2Obj* pOle2=PTR_CAST(SdrOle2Obj,pObj); 366ddde725dSArmin Le Grand 367ddde725dSArmin Le Grand if(pGraf) 368ddde725dSArmin Le Grand { 369ddde725dSArmin Le Grand if(pGraf->HasGDIMetaFile()) 370ddde725dSArmin Le Grand { 371cdf0e10cSrcweir nCount += pGraf->GetGraphic().GetGDIMetaFile().GetActionCount(); 372ddde725dSArmin Le Grand } 373ddde725dSArmin Le Grand else if(pGraf->isEmbeddedSvg()) 374ddde725dSArmin Le Grand { 375ddde725dSArmin Le Grand nCount += pGraf->getMetafileFromEmbeddedSvg().GetActionCount(); 376ddde725dSArmin Le Grand } 377ddde725dSArmin Le Grand } 378ddde725dSArmin Le Grand 379ddde725dSArmin Le Grand if(pOle2 && pOle2->GetGraphic()) 380ddde725dSArmin Le Grand { 381cdf0e10cSrcweir nCount += pOle2->GetGraphic()->GetGDIMetaFile().GetActionCount(); 382cdf0e10cSrcweir } 383ddde725dSArmin Le Grand } 384cdf0e10cSrcweir 385cdf0e10cSrcweir // anhand der erm. Summe entscheiden ob mit 386cdf0e10cSrcweir // oder ohne Dialog aufgebrochen wird. 387cdf0e10cSrcweir if(nCount < MIN_ACTIONS_FOR_DIALOG) 388cdf0e10cSrcweir { 389cdf0e10cSrcweir // ohne Dialog aufbrechen 390cdf0e10cSrcweir mpDrawView->DoImportMarkedMtf(); 391cdf0e10cSrcweir } 392cdf0e10cSrcweir else 393cdf0e10cSrcweir { 394cdf0e10cSrcweir SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); 395cdf0e10cSrcweir if( pFact ) 396cdf0e10cSrcweir { 397cdf0e10cSrcweir VclAbstractDialog* pDlg = pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, nAnz ); 398cdf0e10cSrcweir if( pDlg ) 399cdf0e10cSrcweir { 400cdf0e10cSrcweir pDlg->Execute(); 401cdf0e10cSrcweir delete pDlg; 402cdf0e10cSrcweir } 403cdf0e10cSrcweir } 404cdf0e10cSrcweir } 405cdf0e10cSrcweir } 406cdf0e10cSrcweir 407cdf0e10cSrcweir Cancel(); 408cdf0e10cSrcweir rReq.Done (); 409cdf0e10cSrcweir } 410cdf0e10cSrcweir break; 411cdf0e10cSrcweir 412cdf0e10cSrcweir case SID_CONVERT_TO_3D: 413cdf0e10cSrcweir { 414cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 415cdf0e10cSrcweir { 416cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 417cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 418cdf0e10cSrcweir } 419cdf0e10cSrcweir else 420cdf0e10cSrcweir { 421cdf0e10cSrcweir if (mpDrawView->IsConvertTo3DObjPossible()) 422cdf0e10cSrcweir { 423cdf0e10cSrcweir if (mpDrawView->IsTextEdit()) 424cdf0e10cSrcweir { 425cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 426cdf0e10cSrcweir } 427cdf0e10cSrcweir 428cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 429cdf0e10cSrcweir mpDrawView->ConvertMarkedObjTo3D(sal_True); 430cdf0e10cSrcweir } 431cdf0e10cSrcweir } 432cdf0e10cSrcweir 433cdf0e10cSrcweir Cancel(); 434cdf0e10cSrcweir rReq.Done(); 435cdf0e10cSrcweir } 436cdf0e10cSrcweir break; 437cdf0e10cSrcweir 438cdf0e10cSrcweir case SID_FRAME_TO_TOP: // BASIC 439cdf0e10cSrcweir { 440cdf0e10cSrcweir mpDrawView->PutMarkedToTop(); 441cdf0e10cSrcweir Cancel(); 442cdf0e10cSrcweir Invalidate( SID_POSITION ); 443cdf0e10cSrcweir rReq.Done (); 444cdf0e10cSrcweir } 445cdf0e10cSrcweir break; 446cdf0e10cSrcweir 447cdf0e10cSrcweir case SID_MOREFRONT: // BASIC 448cdf0e10cSrcweir { 449cdf0e10cSrcweir mpDrawView->MovMarkedToTop(); 450cdf0e10cSrcweir Cancel(); 451cdf0e10cSrcweir Invalidate( SID_POSITION ); 452cdf0e10cSrcweir rReq.Done (); 453cdf0e10cSrcweir } 454cdf0e10cSrcweir break; 455cdf0e10cSrcweir 456cdf0e10cSrcweir case SID_MOREBACK: // BASIC 457cdf0e10cSrcweir { 458cdf0e10cSrcweir mpDrawView->MovMarkedToBtm(); 459cdf0e10cSrcweir Cancel(); 460cdf0e10cSrcweir Invalidate( SID_POSITION ); 461cdf0e10cSrcweir rReq.Done (); 462cdf0e10cSrcweir } 463cdf0e10cSrcweir break; 464cdf0e10cSrcweir 465cdf0e10cSrcweir case SID_FRAME_TO_BOTTOM: // BASIC 466cdf0e10cSrcweir { 467cdf0e10cSrcweir mpDrawView->PutMarkedToBtm(); 468cdf0e10cSrcweir Cancel(); 469cdf0e10cSrcweir Invalidate( SID_POSITION ); 470cdf0e10cSrcweir rReq.Done (); 471cdf0e10cSrcweir } 472cdf0e10cSrcweir break; 473cdf0e10cSrcweir 474cdf0e10cSrcweir case SID_HORIZONTAL: // BASIC 475*ee093554SAndre Fischer case SID_FLIP_HORIZONTAL: 476cdf0e10cSrcweir { 477cdf0e10cSrcweir mpDrawView->MirrorAllMarkedHorizontal(); 478cdf0e10cSrcweir Cancel(); 479cdf0e10cSrcweir rReq.Done (); 480cdf0e10cSrcweir } 481cdf0e10cSrcweir break; 482cdf0e10cSrcweir 483cdf0e10cSrcweir case SID_VERTICAL: // BASIC 484*ee093554SAndre Fischer case SID_FLIP_VERTICAL: 485cdf0e10cSrcweir { 486cdf0e10cSrcweir mpDrawView->MirrorAllMarkedVertical(); 487cdf0e10cSrcweir Cancel(); 488cdf0e10cSrcweir rReq.Done (); 489cdf0e10cSrcweir } 490cdf0e10cSrcweir break; 491cdf0e10cSrcweir 492cdf0e10cSrcweir case SID_OBJECT_ALIGN_LEFT: // BASIC 493cdf0e10cSrcweir { 494cdf0e10cSrcweir mpDrawView->AlignMarkedObjects(SDRHALIGN_LEFT, SDRVALIGN_NONE); 495cdf0e10cSrcweir Cancel(); 496cdf0e10cSrcweir rReq.Done (); 497cdf0e10cSrcweir } 498cdf0e10cSrcweir break; 499cdf0e10cSrcweir 500cdf0e10cSrcweir case SID_OBJECT_ALIGN_CENTER: // BASIC 501cdf0e10cSrcweir { 502cdf0e10cSrcweir mpDrawView->AlignMarkedObjects(SDRHALIGN_CENTER, SDRVALIGN_NONE); 503cdf0e10cSrcweir Cancel(); 504cdf0e10cSrcweir rReq.Done (); 505cdf0e10cSrcweir } 506cdf0e10cSrcweir break; 507cdf0e10cSrcweir 508cdf0e10cSrcweir case SID_OBJECT_ALIGN_RIGHT: // BASIC 509cdf0e10cSrcweir { 510cdf0e10cSrcweir mpDrawView->AlignMarkedObjects(SDRHALIGN_RIGHT, SDRVALIGN_NONE); 511cdf0e10cSrcweir Cancel(); 512cdf0e10cSrcweir rReq.Done (); 513cdf0e10cSrcweir } 514cdf0e10cSrcweir break; 515cdf0e10cSrcweir 516cdf0e10cSrcweir case SID_OBJECT_ALIGN_UP: // BASIC 517cdf0e10cSrcweir { 518cdf0e10cSrcweir mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_TOP); 519cdf0e10cSrcweir Cancel(); 520cdf0e10cSrcweir rReq.Done (); 521cdf0e10cSrcweir } 522cdf0e10cSrcweir break; 523cdf0e10cSrcweir 524cdf0e10cSrcweir case SID_OBJECT_ALIGN_MIDDLE: // BASIC 525cdf0e10cSrcweir { 526cdf0e10cSrcweir mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_CENTER); 527cdf0e10cSrcweir Cancel(); 528cdf0e10cSrcweir rReq.Done (); 529cdf0e10cSrcweir } 530cdf0e10cSrcweir break; 531cdf0e10cSrcweir 532cdf0e10cSrcweir case SID_OBJECT_ALIGN_DOWN: // BASIC 533cdf0e10cSrcweir { 534cdf0e10cSrcweir mpDrawView->AlignMarkedObjects(SDRHALIGN_NONE, SDRVALIGN_BOTTOM); 535cdf0e10cSrcweir Cancel(); 536cdf0e10cSrcweir rReq.Done (); 537cdf0e10cSrcweir } 538cdf0e10cSrcweir break; 539cdf0e10cSrcweir 540cdf0e10cSrcweir case SID_SELECTALL: // BASIC 541cdf0e10cSrcweir { 542cdf0e10cSrcweir if( (dynamic_cast<FuSelection*>( GetOldFunction().get() ) != 0) && 543cdf0e10cSrcweir !GetView()->IsFrameDragSingles() && GetView()->HasMarkablePoints()) 544cdf0e10cSrcweir { 545cdf0e10cSrcweir if ( !mpDrawView->IsAction() ) 546cdf0e10cSrcweir mpDrawView->MarkAllPoints(); 547cdf0e10cSrcweir } 548cdf0e10cSrcweir else 549cdf0e10cSrcweir mpDrawView->SelectAll(); 550cdf0e10cSrcweir 551cdf0e10cSrcweir Cancel(); 552cdf0e10cSrcweir rReq.Done (); 553cdf0e10cSrcweir } 554cdf0e10cSrcweir break; 555cdf0e10cSrcweir 556cdf0e10cSrcweir case SID_STYLE_NEW: // BASIC ??? 557cdf0e10cSrcweir case SID_STYLE_APPLY: 558cdf0e10cSrcweir case SID_STYLE_EDIT: 559cdf0e10cSrcweir case SID_STYLE_DELETE: 560cdf0e10cSrcweir case SID_STYLE_FAMILY: 561cdf0e10cSrcweir case SID_STYLE_WATERCAN: 562cdf0e10cSrcweir case SID_STYLE_UPDATE_BY_EXAMPLE: 563cdf0e10cSrcweir case SID_STYLE_NEW_BY_EXAMPLE: 564cdf0e10cSrcweir { 565cdf0e10cSrcweir if( rReq.GetSlot() == SID_STYLE_EDIT && !rReq.GetArgs() ) 566cdf0e10cSrcweir { 567cdf0e10cSrcweir SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet(); 568cdf0e10cSrcweir if( pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) 569cdf0e10cSrcweir pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet(); 570cdf0e10cSrcweir 571cdf0e10cSrcweir if( (pStyleSheet == NULL) && GetView()->IsTextEdit() ) 572cdf0e10cSrcweir { 573cdf0e10cSrcweir GetView()->SdrEndTextEdit(); 574cdf0e10cSrcweir 575cdf0e10cSrcweir pStyleSheet = mpDrawView->GetStyleSheet(); 576cdf0e10cSrcweir if(pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) 577cdf0e10cSrcweir pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet(); 578cdf0e10cSrcweir } 579cdf0e10cSrcweir 580cdf0e10cSrcweir if( pStyleSheet == NULL ) 581cdf0e10cSrcweir { 582cdf0e10cSrcweir rReq.Ignore(); 583cdf0e10cSrcweir break; 584cdf0e10cSrcweir } 585cdf0e10cSrcweir 586cdf0e10cSrcweir SfxAllItemSet aSet(GetDoc()->GetPool()); 587cdf0e10cSrcweir 588cdf0e10cSrcweir SfxStringItem aStyleNameItem( SID_STYLE_EDIT, pStyleSheet->GetName() ); 589cdf0e10cSrcweir aSet.Put(aStyleNameItem); 590cdf0e10cSrcweir 591cdf0e10cSrcweir SfxUInt16Item aStyleFamilyItem( SID_STYLE_FAMILY, (sal_uInt16)pStyleSheet->GetFamily() ); 592cdf0e10cSrcweir aSet.Put(aStyleFamilyItem); 593cdf0e10cSrcweir 594cdf0e10cSrcweir rReq.SetArgs(aSet); 595cdf0e10cSrcweir } 596cdf0e10cSrcweir 597cdf0e10cSrcweir if( rReq.GetArgs() ) 598cdf0e10cSrcweir { 599cdf0e10cSrcweir SetCurrentFunction( FuTemplate::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); 600cdf0e10cSrcweir if( rReq.GetSlot() == SID_STYLE_APPLY ) 601cdf0e10cSrcweir GetViewFrame()->GetBindings().Invalidate( SID_STYLE_APPLY ); 602cdf0e10cSrcweir Cancel(); 603cdf0e10cSrcweir } 604cdf0e10cSrcweir else if( rReq.GetSlot() == SID_STYLE_APPLY ) 605cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_DESIGNER, SFX_CALLMODE_ASYNCHRON ); 606cdf0e10cSrcweir rReq.Ignore (); 607cdf0e10cSrcweir } 608cdf0e10cSrcweir break; 609cdf0e10cSrcweir 610cdf0e10cSrcweir case SID_IMAP: 611cdf0e10cSrcweir { 612cdf0e10cSrcweir SvxIMapDlg* pDlg; 613cdf0e10cSrcweir sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId(); 614cdf0e10cSrcweir 615cdf0e10cSrcweir GetViewFrame()->ToggleChildWindow( nId ); 616cdf0e10cSrcweir GetViewFrame()->GetBindings().Invalidate( SID_IMAP ); 617cdf0e10cSrcweir 618cdf0e10cSrcweir if ( GetViewFrame()->HasChildWindow( nId ) 619cdf0e10cSrcweir && ( ( pDlg = ViewShell::Implementation::GetImageMapDialog() ) != NULL ) ) 620cdf0e10cSrcweir { 621cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 622cdf0e10cSrcweir 623cdf0e10cSrcweir if ( rMarkList.GetMarkCount() == 1 ) 624cdf0e10cSrcweir UpdateIMapDlg( rMarkList.GetMark( 0 )->GetMarkedSdrObj() ); 625cdf0e10cSrcweir } 626cdf0e10cSrcweir 627cdf0e10cSrcweir Cancel(); 628cdf0e10cSrcweir rReq.Ignore (); 629cdf0e10cSrcweir } 630cdf0e10cSrcweir break; 631cdf0e10cSrcweir 632cdf0e10cSrcweir case SID_GRID_FRONT: 633cdf0e10cSrcweir { 634cdf0e10cSrcweir mpDrawView->SetGridFront( !mpDrawView->IsGridFront() ); 635cdf0e10cSrcweir Cancel(); 636cdf0e10cSrcweir rReq.Done (); 637cdf0e10cSrcweir } 638cdf0e10cSrcweir break; 639cdf0e10cSrcweir 640cdf0e10cSrcweir case SID_HELPLINES_FRONT: 641cdf0e10cSrcweir { 642cdf0e10cSrcweir mpDrawView->SetHlplFront( !mpDrawView->IsHlplFront() ); 643cdf0e10cSrcweir Cancel(); 644cdf0e10cSrcweir rReq.Done (); 645cdf0e10cSrcweir } 646cdf0e10cSrcweir break; 647cdf0e10cSrcweir 648cdf0e10cSrcweir default: 649cdf0e10cSrcweir FuTemp04(rReq); 650cdf0e10cSrcweir break; 651cdf0e10cSrcweir }; 652cdf0e10cSrcweir }; 653cdf0e10cSrcweir 654cdf0e10cSrcweir /************************************************************************* 655cdf0e10cSrcweir |* 656cdf0e10cSrcweir |* Liefert die globale/Haupt-ID zurueck, also die ID, ueber die die 657cdf0e10cSrcweir |* Toolbox ausgeloest wird 658cdf0e10cSrcweir |* 659cdf0e10cSrcweir \************************************************************************/ 660cdf0e10cSrcweir 661cdf0e10cSrcweir sal_uInt16 DrawViewShell::GetIdBySubId( sal_uInt16 nSId ) 662cdf0e10cSrcweir { 663cdf0e10cSrcweir sal_uInt16 nMappedSId = 0; 664cdf0e10cSrcweir switch( nSId ) 665cdf0e10cSrcweir { 666cdf0e10cSrcweir case SID_OBJECT_ROTATE: 667cdf0e10cSrcweir case SID_OBJECT_MIRROR: 668cdf0e10cSrcweir case SID_OBJECT_TRANSPARENCE: 669cdf0e10cSrcweir case SID_OBJECT_GRADIENT: 670cdf0e10cSrcweir case SID_OBJECT_SHEAR: 671cdf0e10cSrcweir case SID_OBJECT_CROOK_ROTATE: 672cdf0e10cSrcweir case SID_OBJECT_CROOK_SLANT: 673cdf0e10cSrcweir case SID_OBJECT_CROOK_STRETCH: 674cdf0e10cSrcweir case SID_CONVERT_TO_3D_LATHE: 675cdf0e10cSrcweir { 676cdf0e10cSrcweir nMappedSId = SID_OBJECT_CHOOSE_MODE; 677cdf0e10cSrcweir } 678cdf0e10cSrcweir break; 679cdf0e10cSrcweir 680cdf0e10cSrcweir case SID_OBJECT_ALIGN_LEFT: 681cdf0e10cSrcweir case SID_OBJECT_ALIGN_CENTER: 682cdf0e10cSrcweir case SID_OBJECT_ALIGN_RIGHT: 683cdf0e10cSrcweir case SID_OBJECT_ALIGN_UP: 684cdf0e10cSrcweir case SID_OBJECT_ALIGN_MIDDLE: 685cdf0e10cSrcweir case SID_OBJECT_ALIGN_DOWN: 686cdf0e10cSrcweir { 687cdf0e10cSrcweir nMappedSId = SID_OBJECT_ALIGN; 688cdf0e10cSrcweir } 689cdf0e10cSrcweir break; 690cdf0e10cSrcweir 691cdf0e10cSrcweir case SID_FRAME_TO_TOP: 692cdf0e10cSrcweir case SID_MOREFRONT: 693cdf0e10cSrcweir case SID_MOREBACK: 694cdf0e10cSrcweir case SID_FRAME_TO_BOTTOM: 695cdf0e10cSrcweir case SID_BEFORE_OBJ: 696cdf0e10cSrcweir case SID_BEHIND_OBJ: 697cdf0e10cSrcweir case SID_REVERSE_ORDER: 698cdf0e10cSrcweir { 699cdf0e10cSrcweir nMappedSId = SID_POSITION; 700cdf0e10cSrcweir } 701cdf0e10cSrcweir break; 702cdf0e10cSrcweir 703cdf0e10cSrcweir case SID_ZOOM_OUT: 704cdf0e10cSrcweir case SID_ZOOM_IN: 705cdf0e10cSrcweir case SID_SIZE_REAL: 706cdf0e10cSrcweir case SID_ZOOM_PANNING: 707cdf0e10cSrcweir case SID_SIZE_PAGE: 708cdf0e10cSrcweir case SID_SIZE_PAGE_WIDTH: 709cdf0e10cSrcweir case SID_SIZE_ALL: 710cdf0e10cSrcweir case SID_SIZE_OPTIMAL: 711cdf0e10cSrcweir case SID_ZOOM_NEXT: 712cdf0e10cSrcweir case SID_ZOOM_PREV: 713cdf0e10cSrcweir { 714cdf0e10cSrcweir nMappedSId = SID_ZOOM_TOOLBOX; 715cdf0e10cSrcweir } 716cdf0e10cSrcweir break; 717cdf0e10cSrcweir 718cdf0e10cSrcweir case SID_ATTR_CHAR: 719cdf0e10cSrcweir case SID_TEXT_FITTOSIZE: 720cdf0e10cSrcweir case SID_DRAW_CAPTION: 721cdf0e10cSrcweir case SID_DRAW_FONTWORK: 722cdf0e10cSrcweir case SID_DRAW_FONTWORK_VERTICAL: 723cdf0e10cSrcweir { 724cdf0e10cSrcweir nMappedSId = SID_DRAWTBX_TEXT; 725cdf0e10cSrcweir } 726cdf0e10cSrcweir break; 727cdf0e10cSrcweir 728cdf0e10cSrcweir case SID_DRAW_RECT: 729cdf0e10cSrcweir case SID_DRAW_SQUARE: 730cdf0e10cSrcweir case SID_DRAW_RECT_ROUND: 731cdf0e10cSrcweir case SID_DRAW_SQUARE_ROUND: 732cdf0e10cSrcweir case SID_DRAW_RECT_NOFILL: 733cdf0e10cSrcweir case SID_DRAW_SQUARE_NOFILL: 734cdf0e10cSrcweir case SID_DRAW_RECT_ROUND_NOFILL: 735cdf0e10cSrcweir case SID_DRAW_SQUARE_ROUND_NOFILL: 736cdf0e10cSrcweir { 737cdf0e10cSrcweir nMappedSId = SID_DRAWTBX_RECTANGLES; 738cdf0e10cSrcweir } 739cdf0e10cSrcweir break; 740cdf0e10cSrcweir 741cdf0e10cSrcweir case SID_DRAW_ELLIPSE: 742cdf0e10cSrcweir case SID_DRAW_CIRCLE: 743cdf0e10cSrcweir case SID_DRAW_PIE: 744cdf0e10cSrcweir case SID_DRAW_CIRCLEPIE: 745cdf0e10cSrcweir case SID_DRAW_ELLIPSECUT: 746cdf0e10cSrcweir case SID_DRAW_CIRCLECUT: 747cdf0e10cSrcweir case SID_DRAW_ARC: 748cdf0e10cSrcweir case SID_DRAW_CIRCLEARC: 749cdf0e10cSrcweir case SID_DRAW_ELLIPSE_NOFILL: 750cdf0e10cSrcweir case SID_DRAW_CIRCLE_NOFILL: 751cdf0e10cSrcweir case SID_DRAW_PIE_NOFILL: 752cdf0e10cSrcweir case SID_DRAW_CIRCLEPIE_NOFILL: 753cdf0e10cSrcweir case SID_DRAW_ELLIPSECUT_NOFILL: 754cdf0e10cSrcweir case SID_DRAW_CIRCLECUT_NOFILL: 755cdf0e10cSrcweir { 756cdf0e10cSrcweir nMappedSId = SID_DRAWTBX_ELLIPSES; 757cdf0e10cSrcweir } 758cdf0e10cSrcweir break; 759cdf0e10cSrcweir 760cdf0e10cSrcweir case SID_DRAW_BEZIER_NOFILL: 761cdf0e10cSrcweir case SID_DRAW_POLYGON_NOFILL: 762cdf0e10cSrcweir case SID_DRAW_XPOLYGON_NOFILL: 763cdf0e10cSrcweir case SID_DRAW_FREELINE_NOFILL: 764cdf0e10cSrcweir case SID_DRAW_BEZIER_FILL: 765cdf0e10cSrcweir case SID_DRAW_POLYGON: 766cdf0e10cSrcweir case SID_DRAW_XPOLYGON: 767cdf0e10cSrcweir case SID_DRAW_FREELINE: 768cdf0e10cSrcweir { 769cdf0e10cSrcweir nMappedSId = SID_DRAWTBX_LINES; 770cdf0e10cSrcweir } 771cdf0e10cSrcweir break; 772cdf0e10cSrcweir 773cdf0e10cSrcweir case SID_DRAW_LINE: 774cdf0e10cSrcweir case SID_DRAW_XLINE: 775cdf0e10cSrcweir case SID_DRAW_MEASURELINE: 776cdf0e10cSrcweir case SID_LINE_ARROW_START: 777cdf0e10cSrcweir case SID_LINE_ARROW_END: 778cdf0e10cSrcweir case SID_LINE_ARROWS: 779cdf0e10cSrcweir case SID_LINE_ARROW_CIRCLE: 780cdf0e10cSrcweir case SID_LINE_CIRCLE_ARROW: 781cdf0e10cSrcweir case SID_LINE_ARROW_SQUARE: 782cdf0e10cSrcweir case SID_LINE_SQUARE_ARROW: 783cdf0e10cSrcweir { 784cdf0e10cSrcweir nMappedSId = SID_DRAWTBX_ARROWS; 785cdf0e10cSrcweir } 786cdf0e10cSrcweir break; 787cdf0e10cSrcweir 788cdf0e10cSrcweir case SID_3D_CUBE: 789cdf0e10cSrcweir case SID_3D_TORUS: 790cdf0e10cSrcweir case SID_3D_SPHERE: 791cdf0e10cSrcweir case SID_3D_SHELL: 792cdf0e10cSrcweir case SID_3D_HALF_SPHERE: 793cdf0e10cSrcweir case SID_3D_CYLINDER: 794cdf0e10cSrcweir case SID_3D_CONE: 795cdf0e10cSrcweir case SID_3D_PYRAMID: 796cdf0e10cSrcweir { 797cdf0e10cSrcweir nMappedSId = SID_DRAWTBX_3D_OBJECTS; 798cdf0e10cSrcweir } 799cdf0e10cSrcweir break; 800cdf0e10cSrcweir 801cdf0e10cSrcweir case SID_INSERT_DIAGRAM: 802cdf0e10cSrcweir case SID_ATTR_TABLE: 803cdf0e10cSrcweir case SID_INSERTFILE: 804cdf0e10cSrcweir case SID_INSERT_GRAPHIC: 805cdf0e10cSrcweir case SID_INSERT_AVMEDIA: 806cdf0e10cSrcweir case SID_INSERTPAGE: 807cdf0e10cSrcweir case SID_INSERT_MATH: 808cdf0e10cSrcweir case SID_INSERT_FLOATINGFRAME: 809cdf0e10cSrcweir case SID_INSERT_OBJECT: 810cdf0e10cSrcweir case SID_INSERT_PLUGIN: 811cdf0e10cSrcweir case SID_INSERT_SOUND: 812cdf0e10cSrcweir case SID_INSERT_VIDEO: 813cdf0e10cSrcweir case SID_INSERT_TABLE: 814cdf0e10cSrcweir { 815cdf0e10cSrcweir nMappedSId = SID_DRAWTBX_INSERT; 816cdf0e10cSrcweir } 817cdf0e10cSrcweir break; 818cdf0e10cSrcweir 819cdf0e10cSrcweir case SID_TOOL_CONNECTOR: 820cdf0e10cSrcweir case SID_CONNECTOR_ARROW_START: 821cdf0e10cSrcweir case SID_CONNECTOR_ARROW_END: 822cdf0e10cSrcweir case SID_CONNECTOR_ARROWS: 823cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_START: 824cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_END: 825cdf0e10cSrcweir case SID_CONNECTOR_CIRCLES: 826cdf0e10cSrcweir case SID_CONNECTOR_LINE: 827cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_START: 828cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_END: 829cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROWS: 830cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_START: 831cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_END: 832cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLES: 833cdf0e10cSrcweir case SID_CONNECTOR_CURVE: 834cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_START: 835cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_END: 836cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROWS: 837cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_START: 838cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_END: 839cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLES: 840cdf0e10cSrcweir case SID_CONNECTOR_LINES: 841cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_START: 842cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_END: 843cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROWS: 844cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_START: 845cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_END: 846cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLES: 847cdf0e10cSrcweir { 848cdf0e10cSrcweir nMappedSId = SID_DRAWTBX_CONNECTORS; 849cdf0e10cSrcweir } 850cdf0e10cSrcweir } 851cdf0e10cSrcweir return( nMappedSId ); 852cdf0e10cSrcweir } 853cdf0e10cSrcweir 854cdf0e10cSrcweir /************************************************************************* 855cdf0e10cSrcweir |* 856cdf0e10cSrcweir |* Fuellt das SlotArray, um das aktuelle Mapping des ToolboxSlots zu 857cdf0e10cSrcweir |* bekommen 858cdf0e10cSrcweir |* 859cdf0e10cSrcweir \************************************************************************/ 860cdf0e10cSrcweir 861cdf0e10cSrcweir void DrawViewShell::MapSlot( sal_uInt16 nSId ) 862cdf0e10cSrcweir { 863cdf0e10cSrcweir sal_uInt16 nMappedSId = GetIdBySubId( nSId ); 864cdf0e10cSrcweir 865cdf0e10cSrcweir if( nMappedSId > 0 ) 866cdf0e10cSrcweir { 867cdf0e10cSrcweir sal_uInt16 nID = GetArrayId( nMappedSId ) + 1; 868cdf0e10cSrcweir mpSlotArray[ nID ] = nSId; 869cdf0e10cSrcweir } 870cdf0e10cSrcweir } 871cdf0e10cSrcweir 872cdf0e10cSrcweir /************************************************************************* 873cdf0e10cSrcweir |* 874cdf0e10cSrcweir |* Ermoeglicht ueber das SlotArray ein ImageMapping 875cdf0e10cSrcweir |* 876cdf0e10cSrcweir \************************************************************************/ 877cdf0e10cSrcweir 878cdf0e10cSrcweir void DrawViewShell::UpdateToolboxImages( SfxItemSet &rSet, sal_Bool bPermanent ) 879cdf0e10cSrcweir { 880cdf0e10cSrcweir if( !bPermanent ) 881cdf0e10cSrcweir { 882cdf0e10cSrcweir sal_uInt16 nId = GetArrayId( SID_ZOOM_TOOLBOX ) + 1; 883cdf0e10cSrcweir rSet.Put( TbxImageItem( SID_ZOOM_TOOLBOX, mpSlotArray[nId] ) ); 884cdf0e10cSrcweir 885cdf0e10cSrcweir nId = GetArrayId( SID_DRAWTBX_INSERT ) + 1; 886cdf0e10cSrcweir rSet.Put( TbxImageItem( SID_DRAWTBX_INSERT, mpSlotArray[nId] ) ); 887cdf0e10cSrcweir 888cdf0e10cSrcweir nId = GetArrayId( SID_POSITION ) + 1; 889cdf0e10cSrcweir rSet.Put( TbxImageItem( SID_POSITION, mpSlotArray[nId] ) ); 890cdf0e10cSrcweir 891cdf0e10cSrcweir nId = GetArrayId( SID_OBJECT_ALIGN ) + 1; 892cdf0e10cSrcweir rSet.Put( TbxImageItem( SID_OBJECT_ALIGN, mpSlotArray[nId] ) ); 893cdf0e10cSrcweir } 894cdf0e10cSrcweir else 895cdf0e10cSrcweir { 896cdf0e10cSrcweir for( sal_uInt16 nId = 0; nId < SLOTARRAY_COUNT; nId += 2 ) 897cdf0e10cSrcweir { 898cdf0e10cSrcweir rSet.Put( TbxImageItem( mpSlotArray[nId], mpSlotArray[nId+1] ) ); 899cdf0e10cSrcweir } 900cdf0e10cSrcweir } 901cdf0e10cSrcweir } 902cdf0e10cSrcweir 903cdf0e10cSrcweir /************************************************************************* 904cdf0e10cSrcweir |* 905cdf0e10cSrcweir |* Gibt den gemappten Slot zurueck 906cdf0e10cSrcweir |* 907cdf0e10cSrcweir \************************************************************************/ 908cdf0e10cSrcweir 909cdf0e10cSrcweir sal_uInt16 DrawViewShell::GetMappedSlot( sal_uInt16 nSId ) 910cdf0e10cSrcweir { 911cdf0e10cSrcweir sal_uInt16 nSlot = 0; 912cdf0e10cSrcweir sal_uInt16 nId = GetArrayId( nSId ); 913cdf0e10cSrcweir if( nId != USHRT_MAX ) 914cdf0e10cSrcweir nSlot = mpSlotArray[ nId+1 ]; 915cdf0e10cSrcweir 916cdf0e10cSrcweir // Wenn der Slot noch auf sich selbst gemapped ist, muss 0 zurueck- 917cdf0e10cSrcweir // gegeben werden, da sonst der Slot immer wieder selbst executet 918cdf0e10cSrcweir // wird. Im Array ist der Slot selbst initial vorhanden, damit das 919cdf0e10cSrcweir // Image richtig angezeigt wird. 920cdf0e10cSrcweir if( nSId == nSlot ) 921cdf0e10cSrcweir return( 0 ); 922cdf0e10cSrcweir 923cdf0e10cSrcweir return( nSlot ); 924cdf0e10cSrcweir } 925cdf0e10cSrcweir 926cdf0e10cSrcweir /************************************************************************* 927cdf0e10cSrcweir |* 928cdf0e10cSrcweir |* Gibt die Nummer des HauptSlots im SlotArray zurueck 929cdf0e10cSrcweir |* 930cdf0e10cSrcweir \************************************************************************/ 931cdf0e10cSrcweir 932cdf0e10cSrcweir sal_uInt16 DrawViewShell::GetArrayId( sal_uInt16 nSId ) 933cdf0e10cSrcweir { 934cdf0e10cSrcweir for( sal_uInt16 i = 0; i < SLOTARRAY_COUNT; i += 2 ) 935cdf0e10cSrcweir { 936cdf0e10cSrcweir if( mpSlotArray[ i ] == nSId ) 937cdf0e10cSrcweir return( i ); 938cdf0e10cSrcweir } 939cdf0e10cSrcweir DBG_ERROR( "Slot im Array nicht gefunden!" ); 940cdf0e10cSrcweir return( USHRT_MAX ); 941cdf0e10cSrcweir } 942cdf0e10cSrcweir 943cdf0e10cSrcweir 944cdf0e10cSrcweir /************************************************************************* 945cdf0e10cSrcweir |* 946cdf0e10cSrcweir |* IMap-Dlg updaten 947cdf0e10cSrcweir |* 948cdf0e10cSrcweir \************************************************************************/ 949cdf0e10cSrcweir 950cdf0e10cSrcweir void DrawViewShell::UpdateIMapDlg( SdrObject* pObj ) 951cdf0e10cSrcweir { 952cdf0e10cSrcweir if( ( pObj->ISA( SdrGrafObj ) || pObj->ISA( SdrOle2Obj ) ) && !mpDrawView->IsTextEdit() && 953cdf0e10cSrcweir GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) ) 954cdf0e10cSrcweir { 955cdf0e10cSrcweir Graphic aGraphic; 956cdf0e10cSrcweir ImageMap* pIMap = NULL; 957cdf0e10cSrcweir TargetList* pTargetList = NULL; 958cdf0e10cSrcweir SdIMapInfo* pIMapInfo = GetDoc()->GetIMapInfo( pObj ); 959cdf0e10cSrcweir 960cdf0e10cSrcweir // get graphic from shape 961cdf0e10cSrcweir SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( pObj ); 962cdf0e10cSrcweir if( pGrafObj ) 963cdf0e10cSrcweir aGraphic = pGrafObj->GetGraphic(); 964cdf0e10cSrcweir 965cdf0e10cSrcweir if ( pIMapInfo ) 966cdf0e10cSrcweir { 967cdf0e10cSrcweir pIMap = (ImageMap*) &pIMapInfo->GetImageMap(); 968cdf0e10cSrcweir pTargetList = new TargetList; 969cdf0e10cSrcweir GetViewFrame()->GetTargetList( *pTargetList ); 970cdf0e10cSrcweir } 971cdf0e10cSrcweir 972cdf0e10cSrcweir SvxIMapDlgChildWindow::UpdateIMapDlg( aGraphic, pIMap, pTargetList, pObj ); 973cdf0e10cSrcweir 974cdf0e10cSrcweir // TargetListe kann von uns wieder geloescht werden 975cdf0e10cSrcweir if ( pTargetList ) 976cdf0e10cSrcweir { 977cdf0e10cSrcweir String* pEntry = pTargetList->First(); 978cdf0e10cSrcweir while( pEntry ) 979cdf0e10cSrcweir { 980cdf0e10cSrcweir delete pEntry; 981cdf0e10cSrcweir pEntry = pTargetList->Next(); 982cdf0e10cSrcweir } 983cdf0e10cSrcweir 984cdf0e10cSrcweir delete pTargetList; 985cdf0e10cSrcweir } 986cdf0e10cSrcweir } 987cdf0e10cSrcweir } 988cdf0e10cSrcweir 989cdf0e10cSrcweir // ----------------------------------------------------------------------------- 990cdf0e10cSrcweir 991cdf0e10cSrcweir IMPL_LINK( DrawViewShell, NameObjectHdl, AbstractSvxNameDialog*, pDialog ) 992cdf0e10cSrcweir { 993cdf0e10cSrcweir String aName; 994cdf0e10cSrcweir 995cdf0e10cSrcweir if( pDialog ) 996cdf0e10cSrcweir pDialog->GetName( aName ); 997cdf0e10cSrcweir 998cdf0e10cSrcweir return( ( !aName.Len() || ( GetDoc() && !GetDoc()->GetObj( aName ) ) ) ? 1 : 0 ); 999cdf0e10cSrcweir } 1000cdf0e10cSrcweir 1001cdf0e10cSrcweir } // end of namespace sd 1002