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 #include "ViewShellImplementation.hxx" 29cdf0e10cSrcweir #include <vcl/waitobj.hxx> 30cdf0e10cSrcweir #include <svx/svdograf.hxx> 31cdf0e10cSrcweir #ifndef _SVXIDS_HRC 32cdf0e10cSrcweir #include <svx/svxids.hrc> 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir #include <svx/svdpagv.hxx> 35cdf0e10cSrcweir #include <svx/svdundo.hxx> 36cdf0e10cSrcweir #ifndef _ZOOMITEM_HXX 37cdf0e10cSrcweir #include <svx/zoomitem.hxx> 38cdf0e10cSrcweir #endif 39cdf0e10cSrcweir #ifndef _EDITDATA_HXX 40cdf0e10cSrcweir #include <editeng/editdata.hxx> 41cdf0e10cSrcweir #endif 42cdf0e10cSrcweir #include <basic/sberrors.hxx> 43cdf0e10cSrcweir #include <vcl/msgbox.hxx> 44cdf0e10cSrcweir #include <sfx2/request.hxx> 45cdf0e10cSrcweir #include <sfx2/dispatch.hxx> 46cdf0e10cSrcweir #include <svx/xfillit0.hxx> 47cdf0e10cSrcweir #include <svx/xflclit.hxx> 48cdf0e10cSrcweir #include <svl/aeitem.hxx> 49cdf0e10cSrcweir #include <editeng/eeitem.hxx> 50cdf0e10cSrcweir #include <basic/sbstar.hxx> 51cdf0e10cSrcweir #include <editeng/flditem.hxx> 52cdf0e10cSrcweir #include <svx/xlineit0.hxx> 53cdf0e10cSrcweir #include <svx/xfillit0.hxx> 54cdf0e10cSrcweir 55cdf0e10cSrcweir #ifndef _SDOUTL_HXX //autogen 56cdf0e10cSrcweir #include <svx/svdoutl.hxx> 57cdf0e10cSrcweir #endif 58cdf0e10cSrcweir #include <svx/xlnwtit.hxx> 59cdf0e10cSrcweir #include <svx/svdoattr.hxx> 60cdf0e10cSrcweir #include <svx/xlnstwit.hxx> 61cdf0e10cSrcweir #include <svx/sdtmfitm.hxx> 62cdf0e10cSrcweir #include <svx/sdtagitm.hxx> 63cdf0e10cSrcweir #include <svx/xlnedwit.hxx> 64cdf0e10cSrcweir #include <svx/fontworkbar.hxx> 65cdf0e10cSrcweir 66cdf0e10cSrcweir #include <svx/svxdlg.hxx> 67cdf0e10cSrcweir #include <svx/dialogs.hrc> 68cdf0e10cSrcweir 69cdf0e10cSrcweir #include <sfx2/viewfrm.hxx> 70cdf0e10cSrcweir #include "sdgrffilter.hxx" 71cdf0e10cSrcweir 72cdf0e10cSrcweir #include "app.hrc" 73cdf0e10cSrcweir #include "glob.hrc" 74cdf0e10cSrcweir #include "helpids.h" 75cdf0e10cSrcweir #include "sdattr.hxx" 76cdf0e10cSrcweir #include "drawview.hxx" 77cdf0e10cSrcweir #include "Window.hxx" 78cdf0e10cSrcweir #include "drawdoc.hxx" 79cdf0e10cSrcweir #include "DrawDocShell.hxx" 80cdf0e10cSrcweir #include "sdpage.hxx" 81cdf0e10cSrcweir #include "fuscale.hxx" 82cdf0e10cSrcweir #include "sdresid.hxx" 83cdf0e10cSrcweir #include "GraphicViewShell.hxx" 84cdf0e10cSrcweir #include "unmodpg.hxx" 85cdf0e10cSrcweir #include "slideshow.hxx" 86cdf0e10cSrcweir #include "fuvect.hxx" 87cdf0e10cSrcweir #include "stlpool.hxx" 88cdf0e10cSrcweir 89cdf0e10cSrcweir // #90356# 90cdf0e10cSrcweir #include "optsitem.hxx" 91cdf0e10cSrcweir #include "sdabstdlg.hxx" 92cdf0e10cSrcweir #include <com/sun/star/drawing/XMasterPagesSupplier.hpp> 93cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPages.hpp> 94cdf0e10cSrcweir 95cdf0e10cSrcweir #include <strings.hrc> 96cdf0e10cSrcweir 97cdf0e10cSrcweir using namespace ::com::sun::star; 98cdf0e10cSrcweir using namespace ::com::sun::star::uno; 99cdf0e10cSrcweir 100cdf0e10cSrcweir namespace sd { 101cdf0e10cSrcweir 102cdf0e10cSrcweir /************************************************************************* 103cdf0e10cSrcweir |* 104cdf0e10cSrcweir |* SfxRequests fuer temporaere Funktionen 105cdf0e10cSrcweir |* 106cdf0e10cSrcweir \************************************************************************/ 107cdf0e10cSrcweir 108cdf0e10cSrcweir void DrawViewShell::FuTemporary(SfxRequest& rReq) 109cdf0e10cSrcweir { 110cdf0e10cSrcweir // Waehrend einer Native-Diashow wird nichts ausgefuehrt! 111cdf0e10cSrcweir if(SlideShow::IsRunning( GetViewShellBase() ) && (rReq.GetSlot() != SID_NAVIGATOR)) 112cdf0e10cSrcweir return; 113cdf0e10cSrcweir 114cdf0e10cSrcweir DBG_ASSERT( mpDrawView, "sd::DrawViewShell::FuTemporary(), no draw view!" ); 115cdf0e10cSrcweir if( !mpDrawView ) 116cdf0e10cSrcweir return; 117cdf0e10cSrcweir 118cdf0e10cSrcweir CheckLineTo (rReq); 119cdf0e10cSrcweir 120cdf0e10cSrcweir DeactivateCurrentFunction(); 121cdf0e10cSrcweir 122cdf0e10cSrcweir sal_uInt16 nSId = rReq.GetSlot(); 123cdf0e10cSrcweir 124cdf0e10cSrcweir // Slot wird gemapped (ToolboxImages/-Slots) 125cdf0e10cSrcweir MapSlot( nSId ); 126cdf0e10cSrcweir 127cdf0e10cSrcweir switch ( nSId ) 128cdf0e10cSrcweir { 129cdf0e10cSrcweir // Flaechen und Linien-Attribute: 130cdf0e10cSrcweir // Sollten (wie StateMethode) eine eigene 131cdf0e10cSrcweir // Execute-Methode besitzen 132cdf0e10cSrcweir case SID_ATTR_FILL_STYLE: 133cdf0e10cSrcweir case SID_ATTR_FILL_COLOR: 134cdf0e10cSrcweir case SID_ATTR_FILL_GRADIENT: 135cdf0e10cSrcweir case SID_ATTR_FILL_HATCH: 136cdf0e10cSrcweir case SID_ATTR_FILL_BITMAP: 137cdf0e10cSrcweir case SID_ATTR_FILL_SHADOW: 138cdf0e10cSrcweir 139cdf0e10cSrcweir case SID_ATTR_LINE_STYLE: 140cdf0e10cSrcweir case SID_ATTR_LINE_DASH: 141cdf0e10cSrcweir case SID_ATTR_LINE_WIDTH: 142cdf0e10cSrcweir case SID_ATTR_LINE_COLOR: 143cdf0e10cSrcweir case SID_ATTR_LINEEND_STYLE: 144cdf0e10cSrcweir 145cdf0e10cSrcweir case SID_ATTR_TEXT_FITTOSIZE: 146cdf0e10cSrcweir { 147cdf0e10cSrcweir if( rReq.GetArgs() ) 148cdf0e10cSrcweir { 149cdf0e10cSrcweir sal_Bool bMergeUndo = sal_False; 150cdf0e10cSrcweir ::svl::IUndoManager* pUndoManager = GetDocSh()->GetUndoManager(); 151cdf0e10cSrcweir 152cdf0e10cSrcweir // Anpassungen Start/EndWidth #63083# 153cdf0e10cSrcweir if(nSId == SID_ATTR_LINE_WIDTH) 154cdf0e10cSrcweir { 155cdf0e10cSrcweir SdrObject* pObj = NULL; 156cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 157cdf0e10cSrcweir sal_uLong nCount = rMarkList.GetMarkCount(); 158*1dc0a253SArmin Le Grand const sal_Int32 nNewLineWidth(((const XLineWidthItem&)rReq.GetArgs()->Get(XATTR_LINEWIDTH)).GetValue()); 159*1dc0a253SArmin Le Grand const bool bUndo(mpDrawView->IsUndoEnabled()); 160cdf0e10cSrcweir 161cdf0e10cSrcweir for (sal_uLong i=0; i<nCount; i++) 162cdf0e10cSrcweir { 163cdf0e10cSrcweir SfxItemSet aAttr(GetDoc()->GetPool()); 164cdf0e10cSrcweir pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); 165cdf0e10cSrcweir aAttr.Put(pObj->GetMergedItemSet()); 166cdf0e10cSrcweir 167cdf0e10cSrcweir sal_Int32 nActLineWidth = ((const XLineWidthItem&)aAttr.Get(XATTR_LINEWIDTH)).GetValue(); 168cdf0e10cSrcweir 169cdf0e10cSrcweir if(nActLineWidth != nNewLineWidth) 170cdf0e10cSrcweir { 171cdf0e10cSrcweir sal_Bool bSetItemSet(sal_False); 172cdf0e10cSrcweir 173cdf0e10cSrcweir // #86265# do this for SFX_ITEM_DEFAULT and for SFX_ITEM_SET 174cdf0e10cSrcweir if(SFX_ITEM_DONTCARE != aAttr.GetItemState(XATTR_LINESTARTWIDTH)) 175cdf0e10cSrcweir { 176cdf0e10cSrcweir sal_Int32 nValAct = ((const XLineStartWidthItem&)aAttr.Get(XATTR_LINESTARTWIDTH)).GetValue(); 177cdf0e10cSrcweir sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10); 178cdf0e10cSrcweir if(nValNew < 0) 179cdf0e10cSrcweir nValNew = 0; 180cdf0e10cSrcweir bSetItemSet = sal_True; 181cdf0e10cSrcweir aAttr.Put(XLineStartWidthItem(nValNew)); 182cdf0e10cSrcweir } 183cdf0e10cSrcweir 184cdf0e10cSrcweir // #86265# do this for SFX_ITEM_DEFAULT and for SFX_ITEM_SET 185cdf0e10cSrcweir if(SFX_ITEM_DONTCARE != aAttr.GetItemState(XATTR_LINEENDWIDTH)) 186cdf0e10cSrcweir { 187cdf0e10cSrcweir sal_Int32 nValAct = ((const XLineEndWidthItem&)aAttr.Get(XATTR_LINEENDWIDTH)).GetValue(); 188cdf0e10cSrcweir sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10); 189cdf0e10cSrcweir if(nValNew < 0) 190cdf0e10cSrcweir nValNew = 0; 191cdf0e10cSrcweir bSetItemSet = sal_True; 192cdf0e10cSrcweir aAttr.Put(XLineEndWidthItem(nValNew)); 193cdf0e10cSrcweir } 194cdf0e10cSrcweir 195cdf0e10cSrcweir if(bSetItemSet) 196*1dc0a253SArmin Le Grand { 197*1dc0a253SArmin Le Grand if(bUndo) 198*1dc0a253SArmin Le Grand { 199*1dc0a253SArmin Le Grand if(!bMergeUndo) 200*1dc0a253SArmin Le Grand { 201*1dc0a253SArmin Le Grand pUndoManager->EnterListAction( String(), String() ); 202*1dc0a253SArmin Le Grand mpDrawView->BegUndo(); 203*1dc0a253SArmin Le Grand bMergeUndo = sal_True; 204*1dc0a253SArmin Le Grand } 205*1dc0a253SArmin Le Grand 206*1dc0a253SArmin Le Grand mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj)); 207*1dc0a253SArmin Le Grand } 208*1dc0a253SArmin Le Grand 209*1dc0a253SArmin Le Grand pObj->SetMergedItemSet(aAttr); 210*1dc0a253SArmin Le Grand } 211cdf0e10cSrcweir } 212cdf0e10cSrcweir } 213*1dc0a253SArmin Le Grand 214*1dc0a253SArmin Le Grand if(bMergeUndo) 215*1dc0a253SArmin Le Grand { 216*1dc0a253SArmin Le Grand mpDrawView->EndUndo(); 217*1dc0a253SArmin Le Grand } 218cdf0e10cSrcweir } 219cdf0e10cSrcweir 220cdf0e10cSrcweir if (nSId == SID_ATTR_FILL_SHADOW) 221cdf0e10cSrcweir { 222cdf0e10cSrcweir // Ggf. werden transparente Objekte wei?gefuellt 223cdf0e10cSrcweir SdrObject* pObj = NULL; 224cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 225cdf0e10cSrcweir sal_uLong nCount = rMarkList.GetMarkCount(); 226cdf0e10cSrcweir const bool bUndo = mpDrawView->IsUndoEnabled(); 227cdf0e10cSrcweir 228cdf0e10cSrcweir for (sal_uLong i=0; i<nCount; i++) 229cdf0e10cSrcweir { 230cdf0e10cSrcweir SfxItemSet aAttr(GetDoc()->GetPool()); 231cdf0e10cSrcweir pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); 232cdf0e10cSrcweir 233cdf0e10cSrcweir // #i25616# 234cdf0e10cSrcweir if(!pObj->ISA(SdrGrafObj)) 235cdf0e10cSrcweir { 236cdf0e10cSrcweir aAttr.Put(pObj->GetMergedItemSet()); 237cdf0e10cSrcweir 238*1dc0a253SArmin Le Grand const XFillStyleItem& rFillStyle = (const XFillStyleItem&) aAttr.Get(XATTR_FILLSTYLE); 239*1dc0a253SArmin Le Grand const XLineStyleItem& rLineStyle = (const XLineStyleItem&) aAttr.Get(XATTR_LINESTYLE); 240cdf0e10cSrcweir 241*1dc0a253SArmin Le Grand if(XFILL_NONE == rFillStyle.GetValue() && XLINE_NONE == rLineStyle.GetValue()) 242cdf0e10cSrcweir { 243cdf0e10cSrcweir if( bUndo ) 244cdf0e10cSrcweir { 245cdf0e10cSrcweir // Vorlage hat keine Fuellung, 246cdf0e10cSrcweir // daher hart attributieren: Fuellung setzen 247cdf0e10cSrcweir if (!bMergeUndo) 248cdf0e10cSrcweir { 249cdf0e10cSrcweir bMergeUndo = sal_True; 250cdf0e10cSrcweir pUndoManager->EnterListAction( String(), String() ); 251cdf0e10cSrcweir mpDrawView->BegUndo(); 252cdf0e10cSrcweir } 253cdf0e10cSrcweir 254cdf0e10cSrcweir mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj)); 255cdf0e10cSrcweir } 256cdf0e10cSrcweir 257cdf0e10cSrcweir aAttr.Put(XFillStyleItem(XFILL_SOLID)); 258cdf0e10cSrcweir aAttr.Put(XFillColorItem(String(), COL_WHITE)); 259cdf0e10cSrcweir 260cdf0e10cSrcweir pObj->SetMergedItemSet(aAttr); 261cdf0e10cSrcweir } 262cdf0e10cSrcweir } 263cdf0e10cSrcweir } 264cdf0e10cSrcweir 265cdf0e10cSrcweir if (bMergeUndo) 266cdf0e10cSrcweir { 267cdf0e10cSrcweir mpDrawView->EndUndo(); 268cdf0e10cSrcweir } 269cdf0e10cSrcweir } 270cdf0e10cSrcweir 271cdf0e10cSrcweir mpDrawView->SetAttributes(*rReq.GetArgs()); 272cdf0e10cSrcweir 273cdf0e10cSrcweir if (bMergeUndo) 274cdf0e10cSrcweir { 275cdf0e10cSrcweir pUndoManager->LeaveListAction(); 276cdf0e10cSrcweir } 277cdf0e10cSrcweir 278cdf0e10cSrcweir rReq.Done(); 279cdf0e10cSrcweir } 280cdf0e10cSrcweir else 281cdf0e10cSrcweir { 282cdf0e10cSrcweir switch( rReq.GetSlot() ) 283cdf0e10cSrcweir { 284cdf0e10cSrcweir case SID_ATTR_FILL_SHADOW: 285cdf0e10cSrcweir case SID_ATTR_FILL_STYLE: 286cdf0e10cSrcweir case SID_ATTR_FILL_COLOR: 287cdf0e10cSrcweir case SID_ATTR_FILL_GRADIENT: 288cdf0e10cSrcweir case SID_ATTR_FILL_HATCH: 289cdf0e10cSrcweir case SID_ATTR_FILL_BITMAP: 290cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_AREA, SFX_CALLMODE_ASYNCHRON ); 291cdf0e10cSrcweir break; 292cdf0e10cSrcweir case SID_ATTR_LINE_STYLE: 293cdf0e10cSrcweir case SID_ATTR_LINE_DASH: 294cdf0e10cSrcweir case SID_ATTR_LINE_WIDTH: 295cdf0e10cSrcweir case SID_ATTR_LINE_COLOR: 296cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_LINE, SFX_CALLMODE_ASYNCHRON ); 297cdf0e10cSrcweir break; 298cdf0e10cSrcweir case SID_ATTR_TEXT_FITTOSIZE: 299cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_TEXTATTR_DLG, SFX_CALLMODE_ASYNCHRON ); 300cdf0e10cSrcweir break; 301cdf0e10cSrcweir } 302cdf0e10cSrcweir } 303cdf0e10cSrcweir Cancel(); 304cdf0e10cSrcweir } 305cdf0e10cSrcweir break; 306cdf0e10cSrcweir 307cdf0e10cSrcweir case SID_HYPHENATION: 308cdf0e10cSrcweir { 309cdf0e10cSrcweir // const SfxPoolItem* pItem = rReq.GetArg( SID_HYPHENATION ); 310cdf0e10cSrcweir // ^-- Soll so nicht benutzt werden (Defaults sind falsch) ! 311cdf0e10cSrcweir SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_HYPHENATION, sal_False); 312cdf0e10cSrcweir 313cdf0e10cSrcweir if( pItem ) 314cdf0e10cSrcweir { 315cdf0e10cSrcweir SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE ); 316cdf0e10cSrcweir sal_Bool bValue = ( (const SfxBoolItem*) pItem)->GetValue(); 317cdf0e10cSrcweir aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) ); 318cdf0e10cSrcweir mpDrawView->SetAttributes( aSet ); 319cdf0e10cSrcweir } 320cdf0e10cSrcweir else // nur zum Test 321cdf0e10cSrcweir { 322cdf0e10cSrcweir DBG_ERROR(" Kein Wert fuer Silbentrennung!"); 323cdf0e10cSrcweir SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE ); 324cdf0e10cSrcweir sal_Bool bValue = sal_True; 325cdf0e10cSrcweir aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) ); 326cdf0e10cSrcweir mpDrawView->SetAttributes( aSet ); 327cdf0e10cSrcweir } 328cdf0e10cSrcweir rReq.Done(); 329cdf0e10cSrcweir Cancel(); 330cdf0e10cSrcweir } 331cdf0e10cSrcweir break; 332cdf0e10cSrcweir 333cdf0e10cSrcweir case SID_INSERTPAGE: 334cdf0e10cSrcweir case SID_INSERTPAGE_QUICK: 335cdf0e10cSrcweir case SID_DUPLICATE_PAGE: 336cdf0e10cSrcweir { 337cdf0e10cSrcweir SdPage* pNewPage = CreateOrDuplicatePage (rReq, mePageKind, GetActualPage()); 338cdf0e10cSrcweir Cancel(); 339cdf0e10cSrcweir if(HasCurrentFunction(SID_BEZIER_EDIT) ) 340cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); 341cdf0e10cSrcweir if (pNewPage != NULL) 342cdf0e10cSrcweir SwitchPage((pNewPage->GetPageNum()-1)/2); 343cdf0e10cSrcweir rReq.Done (); 344cdf0e10cSrcweir } 345cdf0e10cSrcweir break; 346cdf0e10cSrcweir 347cdf0e10cSrcweir case SID_INSERT_MASTER_PAGE: 348cdf0e10cSrcweir { 349cdf0e10cSrcweir // Use the API to create a new page. 350cdf0e10cSrcweir Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier ( 351cdf0e10cSrcweir GetDoc()->getUnoModel(), UNO_QUERY); 352cdf0e10cSrcweir if (xMasterPagesSupplier.is()) 353cdf0e10cSrcweir { 354cdf0e10cSrcweir Reference<drawing::XDrawPages> xMasterPages ( 355cdf0e10cSrcweir xMasterPagesSupplier->getMasterPages()); 356cdf0e10cSrcweir if (xMasterPages.is()) 357cdf0e10cSrcweir { 358cdf0e10cSrcweir sal_uInt16 nIndex = GetCurPageId(); 359cdf0e10cSrcweir xMasterPages->insertNewByIndex (nIndex); 360cdf0e10cSrcweir 361cdf0e10cSrcweir // Create shapes for the default layout. 362cdf0e10cSrcweir SdPage* pMasterPage = GetDoc()->GetMasterSdPage( 363cdf0e10cSrcweir nIndex, PK_STANDARD); 364cdf0e10cSrcweir pMasterPage->CreateTitleAndLayout (sal_True,sal_True); 365cdf0e10cSrcweir } 366cdf0e10cSrcweir } 367cdf0e10cSrcweir 368cdf0e10cSrcweir Cancel(); 369cdf0e10cSrcweir if(HasCurrentFunction(SID_BEZIER_EDIT)) 370cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( 371cdf0e10cSrcweir SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); 372cdf0e10cSrcweir rReq.Done (); 373cdf0e10cSrcweir } 374cdf0e10cSrcweir break; 375cdf0e10cSrcweir 376cdf0e10cSrcweir case SID_MODIFYPAGE: 377cdf0e10cSrcweir { 378cdf0e10cSrcweir if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || 379cdf0e10cSrcweir (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE) ) 380cdf0e10cSrcweir { 381cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 382cdf0e10cSrcweir { 383cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 384cdf0e10cSrcweir } 385cdf0e10cSrcweir sal_uInt16 nPage = maTabControl.GetCurPageId() - 1; 386cdf0e10cSrcweir mpActualPage = GetDoc()->GetSdPage(nPage, mePageKind); 387cdf0e10cSrcweir ::sd::ViewShell::mpImpl->ProcessModifyPageSlot ( 388cdf0e10cSrcweir rReq, 389cdf0e10cSrcweir mpActualPage, 390cdf0e10cSrcweir mePageKind); 391cdf0e10cSrcweir } 392cdf0e10cSrcweir 393cdf0e10cSrcweir Cancel(); 394cdf0e10cSrcweir rReq.Done (); 395cdf0e10cSrcweir } 396cdf0e10cSrcweir break; 397cdf0e10cSrcweir 398cdf0e10cSrcweir case SID_ASSIGN_LAYOUT: 399cdf0e10cSrcweir { 400cdf0e10cSrcweir if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE)) 401cdf0e10cSrcweir { 402cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 403cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 404cdf0e10cSrcweir 405cdf0e10cSrcweir ::sd::ViewShell::mpImpl->AssignLayout(rReq, mePageKind); 406cdf0e10cSrcweir } 407cdf0e10cSrcweir Cancel(); 408cdf0e10cSrcweir rReq.Done (); 409cdf0e10cSrcweir } 410cdf0e10cSrcweir break; 411cdf0e10cSrcweir 412cdf0e10cSrcweir case SID_RENAMEPAGE: 413cdf0e10cSrcweir case SID_RENAME_MASTER_PAGE: 414cdf0e10cSrcweir { 415cdf0e10cSrcweir if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES ) 416cdf0e10cSrcweir { 417cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 418cdf0e10cSrcweir { 419cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 420cdf0e10cSrcweir } 421cdf0e10cSrcweir 422cdf0e10cSrcweir sal_uInt16 nPageId = maTabControl.GetCurPageId(); 423cdf0e10cSrcweir SdPage* pCurrentPage = ( GetEditMode() == EM_PAGE ) 424cdf0e10cSrcweir ? GetDoc()->GetSdPage( nPageId - 1, GetPageKind() ) 425cdf0e10cSrcweir : GetDoc()->GetMasterSdPage( nPageId - 1, GetPageKind() ); 426cdf0e10cSrcweir 427cdf0e10cSrcweir String aTitle( SdResId( STR_TITLE_RENAMESLIDE ) ); 428cdf0e10cSrcweir String aDescr( SdResId( STR_DESC_RENAMESLIDE ) ); 429cdf0e10cSrcweir String aPageName = pCurrentPage->GetName(); 430cdf0e10cSrcweir 431cdf0e10cSrcweir SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); 432cdf0e10cSrcweir DBG_ASSERT(pFact, "Dialogdiet fail!"); 433cdf0e10cSrcweir AbstractSvxNameDialog* aNameDlg = pFact->CreateSvxNameDialog( GetActiveWindow(), aPageName, aDescr ); 434cdf0e10cSrcweir DBG_ASSERT(aNameDlg, "Dialogdiet fail!"); 435cdf0e10cSrcweir aNameDlg->SetText( aTitle ); 436cdf0e10cSrcweir aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true ); 437cdf0e10cSrcweir aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE ); 438cdf0e10cSrcweir 439cdf0e10cSrcweir if( aNameDlg->Execute() == RET_OK ) 440cdf0e10cSrcweir { 441cdf0e10cSrcweir String aNewName; 442cdf0e10cSrcweir aNameDlg->GetName( aNewName ); 443cdf0e10cSrcweir if( ! aNewName.Equals( aPageName ) ) 444cdf0e10cSrcweir { 445cdf0e10cSrcweir #ifdef DBG_UTIL 446cdf0e10cSrcweir bool bResult = 447cdf0e10cSrcweir #endif 448cdf0e10cSrcweir RenameSlide( nPageId, aNewName ); 449cdf0e10cSrcweir DBG_ASSERT( bResult, "Couldn't rename slide" ); 450cdf0e10cSrcweir } 451cdf0e10cSrcweir } 452cdf0e10cSrcweir delete aNameDlg; 453cdf0e10cSrcweir } 454cdf0e10cSrcweir 455cdf0e10cSrcweir Cancel(); 456cdf0e10cSrcweir rReq.Ignore (); 457cdf0e10cSrcweir } 458cdf0e10cSrcweir break; 459cdf0e10cSrcweir 460cdf0e10cSrcweir case SID_RENAMEPAGE_QUICK: 461cdf0e10cSrcweir { 462cdf0e10cSrcweir if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES ) 463cdf0e10cSrcweir { 464cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 465cdf0e10cSrcweir { 466cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 467cdf0e10cSrcweir } 468cdf0e10cSrcweir 469cdf0e10cSrcweir maTabControl.StartEditMode( maTabControl.GetCurPageId() ); 470cdf0e10cSrcweir } 471cdf0e10cSrcweir 472cdf0e10cSrcweir Cancel(); 473cdf0e10cSrcweir rReq.Ignore (); 474cdf0e10cSrcweir } 475cdf0e10cSrcweir break; 476cdf0e10cSrcweir 477cdf0e10cSrcweir case SID_PAGESIZE : // entweder dieses (kein menueeintrag o. ae. !!) 478cdf0e10cSrcweir { 479cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs (); 480cdf0e10cSrcweir 481cdf0e10cSrcweir if (pArgs) 482cdf0e10cSrcweir if (pArgs->Count () == 3) 483cdf0e10cSrcweir { 484cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pWidth, SfxUInt32Item, ID_VAL_PAGEWIDTH, sal_False); 485cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pHeight, SfxUInt32Item, ID_VAL_PAGEHEIGHT, sal_False); 486cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False); 487cdf0e10cSrcweir 488cdf0e10cSrcweir Size aSize (pWidth->GetValue (), pHeight->GetValue ()); 489cdf0e10cSrcweir 490cdf0e10cSrcweir SetupPage (aSize, 0, 0, 0, 0, sal_True, sal_False, pScaleAll->GetValue ()); 491cdf0e10cSrcweir rReq.Ignore (); 492cdf0e10cSrcweir break; 493cdf0e10cSrcweir } 494cdf0e10cSrcweir 495cdf0e10cSrcweir StarBASIC::FatalError (SbERR_WRONG_ARGS); 496cdf0e10cSrcweir rReq.Ignore (); 497cdf0e10cSrcweir break; 498cdf0e10cSrcweir } 499cdf0e10cSrcweir 500cdf0e10cSrcweir case SID_PAGEMARGIN : // oder dieses (kein menueeintrag o. ae. !!) 501cdf0e10cSrcweir { 502cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs (); 503cdf0e10cSrcweir 504cdf0e10cSrcweir if (pArgs) 505cdf0e10cSrcweir if (pArgs->Count () == 5) 506cdf0e10cSrcweir { 507cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pLeft, SfxUInt32Item, ID_VAL_PAGELEFT, sal_False); 508cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pRight, SfxUInt32Item, ID_VAL_PAGERIGHT, sal_False); 509cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pUpper, SfxUInt32Item, ID_VAL_PAGETOP, sal_False); 510cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pLower, SfxUInt32Item, ID_VAL_PAGEBOTTOM, sal_False); 511cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False); 512cdf0e10cSrcweir 513cdf0e10cSrcweir Size aEmptySize (0, 0); 514cdf0e10cSrcweir 515cdf0e10cSrcweir SetupPage (aEmptySize, pLeft->GetValue (), pRight->GetValue (), 516cdf0e10cSrcweir pUpper->GetValue (), pLower->GetValue (), 517cdf0e10cSrcweir sal_False, sal_True, pScaleAll->GetValue ()); 518cdf0e10cSrcweir rReq.Ignore (); 519cdf0e10cSrcweir break; 520cdf0e10cSrcweir } 521cdf0e10cSrcweir 522cdf0e10cSrcweir StarBASIC::FatalError (SbERR_WRONG_ARGS); 523cdf0e10cSrcweir rReq.Ignore (); 524cdf0e10cSrcweir break; 525cdf0e10cSrcweir } 526cdf0e10cSrcweir 527cdf0e10cSrcweir case SID_ATTR_ZOOMSLIDER: 528cdf0e10cSrcweir { 529cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 530cdf0e10cSrcweir 531cdf0e10cSrcweir if (pArgs && pArgs->Count () == 1 ) 532cdf0e10cSrcweir { 533cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER, sal_False); 534cdf0e10cSrcweir if (CHECK_RANGE (5, pScale->GetValue (), 3000)) 535cdf0e10cSrcweir { 536cdf0e10cSrcweir SetZoom (pScale->GetValue ()); 537cdf0e10cSrcweir 538cdf0e10cSrcweir SfxBindings& rBindings = GetViewFrame()->GetBindings(); 539cdf0e10cSrcweir rBindings.Invalidate( SID_ATTR_ZOOM ); 540cdf0e10cSrcweir rBindings.Invalidate( SID_ZOOM_IN ); 541cdf0e10cSrcweir rBindings.Invalidate( SID_ZOOM_OUT ); 542cdf0e10cSrcweir rBindings.Invalidate( SID_ATTR_ZOOMSLIDER ); 543cdf0e10cSrcweir 544cdf0e10cSrcweir } 545cdf0e10cSrcweir } 546cdf0e10cSrcweir 547cdf0e10cSrcweir Cancel(); 548cdf0e10cSrcweir rReq.Done (); 549cdf0e10cSrcweir break; 550cdf0e10cSrcweir } 551cdf0e10cSrcweir case SID_ZOOMING : // kein Menueintrag, sondern aus dem Zoomdialog generiert 552cdf0e10cSrcweir { 553cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 554cdf0e10cSrcweir 555cdf0e10cSrcweir if (pArgs) 556cdf0e10cSrcweir if (pArgs->Count () == 1) 557cdf0e10cSrcweir { 558cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM, sal_False); 559cdf0e10cSrcweir if (CHECK_RANGE (10, pScale->GetValue (), 1000)) 560cdf0e10cSrcweir { 561cdf0e10cSrcweir SetZoom (pScale->GetValue ()); 562cdf0e10cSrcweir 563cdf0e10cSrcweir SfxBindings& rBindings = GetViewFrame()->GetBindings(); 564cdf0e10cSrcweir rBindings.Invalidate( SID_ATTR_ZOOM ); 565cdf0e10cSrcweir rBindings.Invalidate( SID_ZOOM_IN ); 566cdf0e10cSrcweir rBindings.Invalidate( SID_ZOOM_OUT ); 567cdf0e10cSrcweir rBindings.Invalidate( SID_ATTR_ZOOMSLIDER ); 568cdf0e10cSrcweir } 569cdf0e10cSrcweir else StarBASIC::FatalError (SbERR_BAD_PROP_VALUE); 570cdf0e10cSrcweir 571cdf0e10cSrcweir rReq.Ignore (); 572cdf0e10cSrcweir break; 573cdf0e10cSrcweir } 574cdf0e10cSrcweir 575cdf0e10cSrcweir StarBASIC::FatalError (SbERR_WRONG_ARGS); 576cdf0e10cSrcweir rReq.Ignore (); 577cdf0e10cSrcweir break; 578cdf0e10cSrcweir } 579cdf0e10cSrcweir 580cdf0e10cSrcweir case SID_ATTR_ZOOM: 581cdf0e10cSrcweir { 582cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 583cdf0e10cSrcweir mbZoomOnPage = sal_False; 584cdf0e10cSrcweir 585cdf0e10cSrcweir if ( pArgs ) 586cdf0e10cSrcweir { 587cdf0e10cSrcweir SvxZoomType eZT = ( ( const SvxZoomItem& ) pArgs-> 588cdf0e10cSrcweir Get( SID_ATTR_ZOOM ) ).GetType(); 589cdf0e10cSrcweir switch( eZT ) 590cdf0e10cSrcweir { 591cdf0e10cSrcweir case SVX_ZOOM_PERCENT: 592cdf0e10cSrcweir SetZoom( (long) ( ( const SvxZoomItem& ) pArgs-> 593cdf0e10cSrcweir Get( SID_ATTR_ZOOM ) ).GetValue() ); 594cdf0e10cSrcweir break; 595cdf0e10cSrcweir 596cdf0e10cSrcweir case SVX_ZOOM_OPTIMAL: 597cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_ALL, 598cdf0e10cSrcweir SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); 599cdf0e10cSrcweir break; 600cdf0e10cSrcweir 601cdf0e10cSrcweir case SVX_ZOOM_PAGEWIDTH: 602cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE_WIDTH, 603cdf0e10cSrcweir SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); 604cdf0e10cSrcweir break; 605cdf0e10cSrcweir 606cdf0e10cSrcweir case SVX_ZOOM_WHOLEPAGE: 607cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE, 608cdf0e10cSrcweir SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); 609cdf0e10cSrcweir break; 610cdf0e10cSrcweir case SVX_ZOOM_PAGEWIDTH_NOBORDER: 611cdf0e10cSrcweir DBG_ERROR("sd::DrawViewShell::FuTemporary(), SVX_ZOOM_PAGEWIDTH_NOBORDER not handled!" ); 612cdf0e10cSrcweir break; 613cdf0e10cSrcweir } 614cdf0e10cSrcweir rReq.Ignore (); 615cdf0e10cSrcweir } 616cdf0e10cSrcweir else 617cdf0e10cSrcweir { 618cdf0e10cSrcweir // hier den Zoom-Dialog oeffnen 619cdf0e10cSrcweir SetCurrentFunction( FuScale::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); 620cdf0e10cSrcweir } 621cdf0e10cSrcweir Cancel(); 622cdf0e10cSrcweir } 623cdf0e10cSrcweir break; 624cdf0e10cSrcweir 625cdf0e10cSrcweir case SID_CHANGEBEZIER: 626cdf0e10cSrcweir case SID_CHANGEPOLYGON: 627cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 628cdf0e10cSrcweir { 629cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 630cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); 631cdf0e10cSrcweir } 632cdf0e10cSrcweir 633cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 634cdf0e10cSrcweir { 635cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 636cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 637cdf0e10cSrcweir } 638cdf0e10cSrcweir else 639cdf0e10cSrcweir { 640cdf0e10cSrcweir if( rReq.GetSlot() == SID_CHANGEBEZIER ) 641cdf0e10cSrcweir { 642cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 643cdf0e10cSrcweir mpDrawView->ConvertMarkedToPathObj(sal_False); 644cdf0e10cSrcweir } 645cdf0e10cSrcweir else 646cdf0e10cSrcweir { 647cdf0e10cSrcweir if( mpDrawView->IsVectorizeAllowed() ) 648ddde725dSArmin Le Grand { 649cdf0e10cSrcweir SetCurrentFunction( FuVectorize::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); 650ddde725dSArmin Le Grand } 651cdf0e10cSrcweir else 652cdf0e10cSrcweir { 653cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 654cdf0e10cSrcweir mpDrawView->ConvertMarkedToPolyObj(sal_False); 655cdf0e10cSrcweir } 656cdf0e10cSrcweir } 657cdf0e10cSrcweir 658cdf0e10cSrcweir Invalidate(SID_CHANGEBEZIER); 659cdf0e10cSrcweir Invalidate(SID_CHANGEPOLYGON); 660cdf0e10cSrcweir } 661cdf0e10cSrcweir Cancel(); 662cdf0e10cSrcweir 663cdf0e10cSrcweir if( HasCurrentFunction(SID_BEZIER_EDIT) ) 664cdf0e10cSrcweir { // ggf. die richtige Editfunktion aktivieren 665cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT, 666cdf0e10cSrcweir SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD); 667cdf0e10cSrcweir } 668cdf0e10cSrcweir rReq.Ignore (); 669cdf0e10cSrcweir break; 670cdf0e10cSrcweir 671cdf0e10cSrcweir case SID_CONVERT_TO_CONTOUR: 672cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 673cdf0e10cSrcweir { 674cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 675cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); 676cdf0e10cSrcweir } 677cdf0e10cSrcweir 678cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 679cdf0e10cSrcweir { 680cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 681cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 682cdf0e10cSrcweir } 683cdf0e10cSrcweir else 684cdf0e10cSrcweir { 685cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 686cdf0e10cSrcweir mpDrawView->ConvertMarkedToPathObj(sal_True); 687cdf0e10cSrcweir 688cdf0e10cSrcweir Invalidate(SID_CONVERT_TO_CONTOUR); 689cdf0e10cSrcweir } 690cdf0e10cSrcweir Cancel(); 691cdf0e10cSrcweir 692cdf0e10cSrcweir rReq.Ignore (); 693cdf0e10cSrcweir break; 694cdf0e10cSrcweir 695cdf0e10cSrcweir case SID_CONVERT_TO_METAFILE: 696cdf0e10cSrcweir case SID_CONVERT_TO_BITMAP: 697cdf0e10cSrcweir { 698cdf0e10cSrcweir // End text edit mode when it is active because the metafile or 699cdf0e10cSrcweir // bitmap that will be created does not support it. 700cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 701cdf0e10cSrcweir { 702cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 703cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); 704cdf0e10cSrcweir } 705cdf0e10cSrcweir 706cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected(true,true,true) ) 707cdf0e10cSrcweir { 708cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 709cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 710cdf0e10cSrcweir } 711cdf0e10cSrcweir else 712cdf0e10cSrcweir { 713cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 714cdf0e10cSrcweir 715cdf0e10cSrcweir // switch on undo for the next operations 716cdf0e10cSrcweir mpDrawView->BegUndo( 717cdf0e10cSrcweir String( 718cdf0e10cSrcweir SdResId (nSId==SID_CONVERT_TO_METAFILE ? STR_UNDO_CONVERT_TO_METAFILE : STR_UNDO_CONVERT_TO_BITMAP))); 719cdf0e10cSrcweir 720cdf0e10cSrcweir // create SdrGrafObj from metafile/bitmap 721cdf0e10cSrcweir Graphic aGraphic; 722cdf0e10cSrcweir switch (nSId) 723cdf0e10cSrcweir { 724cdf0e10cSrcweir case SID_CONVERT_TO_METAFILE: 725cdf0e10cSrcweir { 726bb18ee55SArmin Le Grand GDIMetaFile aMetaFile(mpDrawView->GetMarkedObjMetaFile()); 727cdf0e10cSrcweir aGraphic = Graphic(aMetaFile); 728cdf0e10cSrcweir } 729cdf0e10cSrcweir break; 730cdf0e10cSrcweir case SID_CONVERT_TO_BITMAP: 731cdf0e10cSrcweir { 732ddde725dSArmin Le Grand bool bDone(false); 733ddde725dSArmin Le Grand 734bb18ee55SArmin Le Grand // I have to get the image here directly since GetMarkedObjBitmapEx works 735ddde725dSArmin Le Grand // based on Bitmaps, but not on BitmapEx, thus throwing away the alpha 736bb18ee55SArmin Le Grand // channel. Argh! GetMarkedObjBitmapEx itself is too widely used to safely 737ddde725dSArmin Le Grand // change that, e.g. in the exchange formats. For now I can only add this 738ddde725dSArmin Le Grand // exception to get good results for Svgs. This is how the code gets more 739ddde725dSArmin Le Grand // and more crowded, at last I made a remark for myself to change this 740ddde725dSArmin Le Grand // as one of the next tasks. 741ddde725dSArmin Le Grand if(1 == mpDrawView->GetMarkedObjectCount()) 742ddde725dSArmin Le Grand { 743ddde725dSArmin Le Grand const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->GetMarkedObjectByIndex(0)); 744ddde725dSArmin Le Grand 745ddde725dSArmin Le Grand if(pSdrGrafObj && pSdrGrafObj->isEmbeddedSvg()) 746ddde725dSArmin Le Grand { 747ddde725dSArmin Le Grand aGraphic = Graphic(pSdrGrafObj->GetGraphic().getSvgData()->getReplacement()); 748ddde725dSArmin Le Grand bDone = true; 749ddde725dSArmin Le Grand } 750ddde725dSArmin Le Grand } 751ddde725dSArmin Le Grand 752ddde725dSArmin Le Grand if(!bDone) 753ddde725dSArmin Le Grand { 754bb18ee55SArmin Le Grand aGraphic = Graphic(mpDrawView->GetMarkedObjBitmapEx()); 755ddde725dSArmin Le Grand } 756cdf0e10cSrcweir } 757cdf0e10cSrcweir break; 758cdf0e10cSrcweir } 759cdf0e10cSrcweir 760cdf0e10cSrcweir // create new object 761cdf0e10cSrcweir SdrGrafObj* pGraphicObj = new SdrGrafObj (aGraphic); 762cdf0e10cSrcweir 763cdf0e10cSrcweir // get some necessary info and ensure it 764cdf0e10cSrcweir const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList()); 765cdf0e10cSrcweir const sal_uInt32 nMarkCount(rMarkList.GetMarkCount()); 766cdf0e10cSrcweir SdrPageView* pPageView = mpDrawView->GetSdrPageView(); 767cdf0e10cSrcweir OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)"); 768cdf0e10cSrcweir OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)"); 769cdf0e10cSrcweir 770cdf0e10cSrcweir // fit rectangle of new graphic object to selection's mark rect 771cdf0e10cSrcweir Rectangle aAllMarkedRect; 772cdf0e10cSrcweir rMarkList.TakeBoundRect(pPageView, aAllMarkedRect); 773cdf0e10cSrcweir pGraphicObj->SetLogicRect(aAllMarkedRect); 774cdf0e10cSrcweir 775cdf0e10cSrcweir // #i71540# to keep the order, it is necessary to replace the lowest object 776cdf0e10cSrcweir // of the selection with the new object. This also means that with multi 777cdf0e10cSrcweir // selection, all other objects need to be deleted first 778cdf0e10cSrcweir SdrMark* pFirstMark = rMarkList.GetMark(0L); 779cdf0e10cSrcweir SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj(); 780cdf0e10cSrcweir 781cdf0e10cSrcweir if(nMarkCount > 1L) 782cdf0e10cSrcweir { 783cdf0e10cSrcweir // take first object out of selection 784cdf0e10cSrcweir mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true); 785cdf0e10cSrcweir 786cdf0e10cSrcweir // clear remaining selection 787cdf0e10cSrcweir mpDrawView->DeleteMarkedObj(); 788cdf0e10cSrcweir } 789cdf0e10cSrcweir 790cdf0e10cSrcweir // now replace lowest object with new one 791cdf0e10cSrcweir mpDrawView->ReplaceObjectAtView(pReplacementCandidate, *pPageView, pGraphicObj); 792cdf0e10cSrcweir 793cdf0e10cSrcweir // switch off undo 794cdf0e10cSrcweir mpDrawView->EndUndo(); 795cdf0e10cSrcweir } 796cdf0e10cSrcweir } 797cdf0e10cSrcweir 798cdf0e10cSrcweir Cancel(); 799cdf0e10cSrcweir 800cdf0e10cSrcweir rReq.Done (); 801cdf0e10cSrcweir break; 802cdf0e10cSrcweir 803cdf0e10cSrcweir case SID_SET_DEFAULT: 804cdf0e10cSrcweir { 805cdf0e10cSrcweir SfxItemSet* pSet = NULL; 806cdf0e10cSrcweir 807cdf0e10cSrcweir if (mpDrawView->IsTextEdit()) 808cdf0e10cSrcweir { 809cdf0e10cSrcweir ::Outliner* pOutl = mpDrawView->GetTextEditOutliner(); 810cdf0e10cSrcweir if (pOutl) 811cdf0e10cSrcweir { 812cdf0e10cSrcweir pOutl->RemoveFields(sal_True, (TypeId) SvxURLField::StaticType()); 813cdf0e10cSrcweir } 814cdf0e10cSrcweir 815cdf0e10cSrcweir pSet = new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END ); 816cdf0e10cSrcweir mpDrawView->SetAttributes( *pSet, sal_True ); 817cdf0e10cSrcweir } 818cdf0e10cSrcweir else 819cdf0e10cSrcweir { 820cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 821cdf0e10cSrcweir sal_uLong nCount = rMarkList.GetMarkCount(); 822cdf0e10cSrcweir 823cdf0e10cSrcweir // In diese Liste werden fuer jedes Praesentationsobjekt ein SfxItemSet 824cdf0e10cSrcweir // der harten Attribute sowie der UserCall eingetragen, da diese beim nachfolgenden 825cdf0e10cSrcweir // mpDrawView->SetAttributes( *pSet, sal_True ) verloren gehen und spaeter restauriert 826cdf0e10cSrcweir // werden muessen 827cdf0e10cSrcweir List* pAttrList = new List(); 828cdf0e10cSrcweir SdPage* pPresPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage(); 829cdf0e10cSrcweir sal_uLong i; 830cdf0e10cSrcweir 831cdf0e10cSrcweir for ( i = 0; i < nCount; i++ ) 832cdf0e10cSrcweir { 833cdf0e10cSrcweir SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); 834cdf0e10cSrcweir 835cdf0e10cSrcweir if( pPresPage->IsPresObj( pObj ) ) 836cdf0e10cSrcweir { 837cdf0e10cSrcweir SfxItemSet* pNewSet = new SfxItemSet( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 ); 838cdf0e10cSrcweir pNewSet->Put(pObj->GetMergedItemSet()); 839cdf0e10cSrcweir pAttrList->Insert( pNewSet, LIST_APPEND ); 840cdf0e10cSrcweir pAttrList->Insert( pObj->GetUserCall(), LIST_APPEND ); 841cdf0e10cSrcweir } 842cdf0e10cSrcweir } 843cdf0e10cSrcweir 844cdf0e10cSrcweir pSet = new SfxItemSet( GetPool() ); 845cdf0e10cSrcweir mpDrawView->SetAttributes( *pSet, sal_True ); 846cdf0e10cSrcweir 847cdf0e10cSrcweir sal_uLong j = 0; 848cdf0e10cSrcweir 849cdf0e10cSrcweir for ( i = 0; i < nCount; i++ ) 850cdf0e10cSrcweir { 851cdf0e10cSrcweir SfxStyleSheet* pSheet = NULL; 852cdf0e10cSrcweir SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); 853cdf0e10cSrcweir 854cdf0e10cSrcweir if (pObj->GetObjIdentifier() == OBJ_TITLETEXT) 855cdf0e10cSrcweir { 856cdf0e10cSrcweir pSheet = mpActualPage->GetStyleSheetForPresObj(PRESOBJ_TITLE); 857cdf0e10cSrcweir if (pSheet) 858cdf0e10cSrcweir pObj->SetStyleSheet(pSheet, sal_False); 859cdf0e10cSrcweir } 860cdf0e10cSrcweir else if(pObj->GetObjIdentifier() == OBJ_OUTLINETEXT) 861cdf0e10cSrcweir { 862cdf0e10cSrcweir for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++) 863cdf0e10cSrcweir { 864cdf0e10cSrcweir pSheet = mpActualPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE ); 865cdf0e10cSrcweir DBG_ASSERT(pSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden"); 866cdf0e10cSrcweir if (pSheet) 867cdf0e10cSrcweir { 868cdf0e10cSrcweir pObj->StartListening(*pSheet); 869cdf0e10cSrcweir 870cdf0e10cSrcweir if( nLevel == 1 ) 871cdf0e10cSrcweir // Textrahmen hoert auf StyleSheet der Ebene1 872cdf0e10cSrcweir pObj->NbcSetStyleSheet(pSheet, sal_False); 873cdf0e10cSrcweir 874cdf0e10cSrcweir } 875cdf0e10cSrcweir } 876cdf0e10cSrcweir } 877cdf0e10cSrcweir 878cdf0e10cSrcweir if( pPresPage->IsPresObj( pObj ) ) 879cdf0e10cSrcweir { 880cdf0e10cSrcweir SfxItemSet* pNewSet = (SfxItemSet*) pAttrList->GetObject(j++); 881cdf0e10cSrcweir SdrObjUserCall* pUserCall = (SdrObjUserCall*) pAttrList->GetObject(j++); 882cdf0e10cSrcweir 883cdf0e10cSrcweir if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SFX_ITEM_ON ) 884cdf0e10cSrcweir { 885cdf0e10cSrcweir pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_MINFRAMEHEIGHT)); 886cdf0e10cSrcweir } 887cdf0e10cSrcweir 888cdf0e10cSrcweir if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) == SFX_ITEM_ON ) 889cdf0e10cSrcweir { 890cdf0e10cSrcweir pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_AUTOGROWHEIGHT)); 891cdf0e10cSrcweir } 892cdf0e10cSrcweir 893cdf0e10cSrcweir if( pUserCall ) 894cdf0e10cSrcweir pObj->SetUserCall( pUserCall ); 895cdf0e10cSrcweir 896cdf0e10cSrcweir delete pNewSet; 897cdf0e10cSrcweir } 898cdf0e10cSrcweir } 899cdf0e10cSrcweir 900cdf0e10cSrcweir delete pAttrList; 901cdf0e10cSrcweir } 902cdf0e10cSrcweir 903cdf0e10cSrcweir delete pSet; 904cdf0e10cSrcweir Cancel(); 905cdf0e10cSrcweir } 906cdf0e10cSrcweir break; 907cdf0e10cSrcweir 908cdf0e10cSrcweir case SID_DELETE_SNAPITEM: 909cdf0e10cSrcweir { 910cdf0e10cSrcweir SdrPageView* pPV; 911cdf0e10cSrcweir Point aMPos = GetActiveWindow()->PixelToLogic( maMousePos ); 912cdf0e10cSrcweir sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( Size( 913cdf0e10cSrcweir FuPoor::HITPIX, 0 ) ).Width(); 914cdf0e10cSrcweir sal_uInt16 nHelpLine; 915cdf0e10cSrcweir 916cdf0e10cSrcweir mbMousePosFreezed = sal_False; 917cdf0e10cSrcweir 918cdf0e10cSrcweir if( mpDrawView->PickHelpLine( aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) ) 919cdf0e10cSrcweir { 920cdf0e10cSrcweir pPV->DeleteHelpLine( nHelpLine ); 921cdf0e10cSrcweir } 922cdf0e10cSrcweir Cancel(); 923cdf0e10cSrcweir rReq.Ignore (); 924cdf0e10cSrcweir } 925cdf0e10cSrcweir break; 926cdf0e10cSrcweir 927cdf0e10cSrcweir case SID_DELETE_PAGE: 928cdf0e10cSrcweir case SID_DELETE_MASTER_PAGE: 929cdf0e10cSrcweir DeleteActualPage(); 930cdf0e10cSrcweir Cancel(); 931cdf0e10cSrcweir rReq.Ignore (); 932cdf0e10cSrcweir break; 933cdf0e10cSrcweir 934cdf0e10cSrcweir case SID_DELETE_LAYER: 935cdf0e10cSrcweir DeleteActualLayer(); 936cdf0e10cSrcweir Cancel(); 937cdf0e10cSrcweir rReq.Ignore (); 938cdf0e10cSrcweir break; 939cdf0e10cSrcweir 940cdf0e10cSrcweir case SID_ORIGINAL_SIZE: 941cdf0e10cSrcweir mpDrawView->SetMarkedOriginalSize(); 942cdf0e10cSrcweir Cancel(); 943cdf0e10cSrcweir rReq.Done(); 944cdf0e10cSrcweir break; 945cdf0e10cSrcweir 946cdf0e10cSrcweir case SID_DRAW_FONTWORK: 947cdf0e10cSrcweir case SID_DRAW_FONTWORK_VERTICAL: 948cdf0e10cSrcweir { 949cdf0e10cSrcweir svx::FontworkBar::execute( mpView, rReq, GetViewFrame()->GetBindings() ); // SJ: can be removed (I think) 950cdf0e10cSrcweir Cancel(); 951cdf0e10cSrcweir rReq.Done(); 952cdf0e10cSrcweir } 953cdf0e10cSrcweir break; 954cdf0e10cSrcweir 955cdf0e10cSrcweir case SID_SAVEGRAPHIC: 956cdf0e10cSrcweir { 957cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 958cdf0e10cSrcweir if( rMarkList.GetMarkCount() == 1 ) 959cdf0e10cSrcweir { 960cdf0e10cSrcweir SdrGrafObj *pGrafObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark( 0 )->GetMarkedSdrObj() ); 961cdf0e10cSrcweir if(pGrafObj ) 962cdf0e10cSrcweir { 963cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape( pGrafObj->getUnoShape(), com::sun::star::uno::UNO_QUERY ); 964cdf0e10cSrcweir SdGRFFilter::SaveGraphic( xShape ); 965cdf0e10cSrcweir } 966cdf0e10cSrcweir } 967cdf0e10cSrcweir Cancel(); 968cdf0e10cSrcweir rReq.Ignore(); 969cdf0e10cSrcweir } 970cdf0e10cSrcweir break; 971cdf0e10cSrcweir 972cdf0e10cSrcweir default: 973cdf0e10cSrcweir { 974cdf0e10cSrcweir // switch Anweisung wegen CLOOKS aufgeteilt. Alle case-Anweisungen die 975cdf0e10cSrcweir // eine Fu???? -Funktion aufrufen, sind in die Methode FuTemp01 (drviews8) 976cdf0e10cSrcweir // gewandert. 977cdf0e10cSrcweir FuTemp01(rReq); 978cdf0e10cSrcweir } 979cdf0e10cSrcweir break; 980cdf0e10cSrcweir } 981cdf0e10cSrcweir 982cdf0e10cSrcweir if(HasCurrentFunction()) 983cdf0e10cSrcweir { 984cdf0e10cSrcweir GetCurrentFunction()->Activate(); 985cdf0e10cSrcweir } 986cdf0e10cSrcweir } 987cdf0e10cSrcweir 988cdf0e10cSrcweir 989cdf0e10cSrcweir 990cdf0e10cSrcweir 991cdf0e10cSrcweir /** This method consists basically of three parts: 992cdf0e10cSrcweir 1. Process the arguments of the SFX request. 993cdf0e10cSrcweir 2. Use the model to create a new page or duplicate an existing one. 994cdf0e10cSrcweir 3. Update the tab control and switch to the new page. 995cdf0e10cSrcweir */ 996cdf0e10cSrcweir SdPage* DrawViewShell::CreateOrDuplicatePage ( 997cdf0e10cSrcweir SfxRequest& rRequest, 998cdf0e10cSrcweir PageKind ePageKind, 999cdf0e10cSrcweir SdPage* pPage, 1000cdf0e10cSrcweir const sal_Int32 nInsertPosition) 1001cdf0e10cSrcweir { 1002cdf0e10cSrcweir SdPage* pNewPage = NULL; 1003cdf0e10cSrcweir if (ePageKind == PK_STANDARD && meEditMode != EM_MASTERPAGE) 1004cdf0e10cSrcweir { 1005cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 1006cdf0e10cSrcweir { 1007cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 1008cdf0e10cSrcweir } 1009cdf0e10cSrcweir pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition); 1010cdf0e10cSrcweir } 1011cdf0e10cSrcweir return pNewPage; 1012cdf0e10cSrcweir } 1013cdf0e10cSrcweir 1014cdf0e10cSrcweir } // end of namespace sd 1015