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 <com/sun/star/presentation/XPresentation2.hpp> 28cdf0e10cSrcweir #include <com/sun/star/form/FormButtonType.hpp> 29cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 30cdf0e10cSrcweir #include <com/sun/star/i18n/TransliterationModules.hpp> 31cdf0e10cSrcweir #include <com/sun/star/i18n/TransliterationModulesExtra.hpp> 32*597a4c59SAriel Constenla-Haile #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <comphelper/processfactory.hxx> 35cdf0e10cSrcweir 36cdf0e10cSrcweir #include "undo/undomanager.hxx" 37cdf0e10cSrcweir #include <vcl/waitobj.hxx> 38cdf0e10cSrcweir #include <svl/aeitem.hxx> 39cdf0e10cSrcweir #include <editeng/editstat.hxx> 40cdf0e10cSrcweir #include <vcl/msgbox.hxx> 41cdf0e10cSrcweir #include <svl/urlbmk.hxx> 42cdf0e10cSrcweir #include <svx/svdpagv.hxx> 43cdf0e10cSrcweir #include <svx/fmshell.hxx> 44cdf0e10cSrcweir #include <vcl/scrbar.hxx> 45cdf0e10cSrcweir #include <svx/svdopath.hxx> 46cdf0e10cSrcweir #include <svx/svdundo.hxx> 47cdf0e10cSrcweir #include <svx/svdorect.hxx> 48cdf0e10cSrcweir #include <svx/svdograf.hxx> 49cdf0e10cSrcweir #include <svl/eitem.hxx> 50cdf0e10cSrcweir #include <editeng/eeitem.hxx> 51cdf0e10cSrcweir #include <sfx2/dispatch.hxx> 52cdf0e10cSrcweir #include <sfx2/viewfrm.hxx> 53cdf0e10cSrcweir #include <sfx2/request.hxx> 54cdf0e10cSrcweir #include <svx/svxids.hrc> 55cdf0e10cSrcweir #include <editeng/flditem.hxx> 56cdf0e10cSrcweir #include <svx/ruler.hxx> 57cdf0e10cSrcweir #include <svx/obj3d.hxx> 58cdf0e10cSrcweir #include <svx/fmglob.hxx> 59cdf0e10cSrcweir #include <svx/svdouno.hxx> 60cdf0e10cSrcweir #include <svx/dataaccessdescriptor.hxx> 61cdf0e10cSrcweir #include <tools/urlobj.hxx> 62cdf0e10cSrcweir #include <svl/slstitm.hxx> 63cdf0e10cSrcweir #include <sfx2/ipclient.hxx> 64cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx> 65cdf0e10cSrcweir #include <avmedia/mediawindow.hxx> 66cdf0e10cSrcweir #include <svl/urihelper.hxx> 67cdf0e10cSrcweir #include <sfx2/docfile.hxx> 68cdf0e10cSrcweir 69cdf0e10cSrcweir #include "DrawViewShell.hxx" 70cdf0e10cSrcweir #include "slideshow.hxx" 71cdf0e10cSrcweir #include "ViewShellImplementation.hxx" 72cdf0e10cSrcweir #include "ViewShellHint.hxx" 73cdf0e10cSrcweir #include "framework/FrameworkHelper.hxx" 74cdf0e10cSrcweir #include "app.hrc" 75cdf0e10cSrcweir #include "glob.hrc" 76cdf0e10cSrcweir #include "strings.hrc" 77cdf0e10cSrcweir #include "res_bmp.hrc" 78cdf0e10cSrcweir #include "drawdoc.hxx" 79cdf0e10cSrcweir #include "fusel.hxx" 80cdf0e10cSrcweir #include "futext.hxx" 81cdf0e10cSrcweir #include "fuconrec.hxx" 82cdf0e10cSrcweir #include "fuconcs.hxx" 83cdf0e10cSrcweir #include "fuconuno.hxx" 84cdf0e10cSrcweir #include "fuconbez.hxx" 85cdf0e10cSrcweir #include "fuediglu.hxx" 86cdf0e10cSrcweir #include "fuconarc.hxx" 87cdf0e10cSrcweir #include "fucon3d.hxx" 88cdf0e10cSrcweir #include "sdresid.hxx" 89cdf0e10cSrcweir #include "slideshow.hxx" 90cdf0e10cSrcweir #include "Outliner.hxx" 91cdf0e10cSrcweir #include "PresentationViewShell.hxx" 92cdf0e10cSrcweir #include "sdpage.hxx" 93cdf0e10cSrcweir #include "FrameView.hxx" 94cdf0e10cSrcweir #include "zoomlist.hxx" 95cdf0e10cSrcweir #include "drawview.hxx" 96cdf0e10cSrcweir #include "DrawDocShell.hxx" 97cdf0e10cSrcweir #include "sdattr.hxx" 98cdf0e10cSrcweir #include "ViewShellBase.hxx" 99cdf0e10cSrcweir #include "ToolBarManager.hxx" 100cdf0e10cSrcweir #include "anminfo.hxx" 101cdf0e10cSrcweir #include "optsitem.hxx" 102cdf0e10cSrcweir #include "Window.hxx" 103cdf0e10cSrcweir #include "fuformatpaintbrush.hxx" 104cdf0e10cSrcweir 105cdf0e10cSrcweir using ::rtl::OUString; 106*597a4c59SAriel Constenla-Haile using com::sun::star::ui::dialogs::XExecutableDialog; 107cdf0e10cSrcweir using namespace ::com::sun::star; 108cdf0e10cSrcweir using namespace ::com::sun::star::uno; 109cdf0e10cSrcweir using namespace ::com::sun::star::presentation; 110cdf0e10cSrcweir 111cdf0e10cSrcweir namespace sd { 112cdf0e10cSrcweir 113cdf0e10cSrcweir #ifdef _MSC_VER 114cdf0e10cSrcweir #pragma optimize ( "", off ) 115cdf0e10cSrcweir #endif 116cdf0e10cSrcweir 117cdf0e10cSrcweir /************************************************************************* 118cdf0e10cSrcweir |* 119cdf0e10cSrcweir |* Permanente Funktionen 120cdf0e10cSrcweir |* 121cdf0e10cSrcweir \************************************************************************/ 122cdf0e10cSrcweir 123cdf0e10cSrcweir void ImpAddPrintableCharactersToTextEdit(SfxRequest& rReq, ::sd::View* pView) 124cdf0e10cSrcweir { 125cdf0e10cSrcweir // #98198# evtl. feed characters to activated textedit 126cdf0e10cSrcweir const SfxItemSet* pSet = rReq.GetArgs(); 127cdf0e10cSrcweir 128cdf0e10cSrcweir if(pSet) 129cdf0e10cSrcweir { 130cdf0e10cSrcweir String aInputString; 131cdf0e10cSrcweir 132cdf0e10cSrcweir if(SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR)) 133cdf0e10cSrcweir aInputString = ((SfxStringItem&)pSet->Get(SID_ATTR_CHAR)).GetValue(); 134cdf0e10cSrcweir 135cdf0e10cSrcweir if(aInputString.Len()) 136cdf0e10cSrcweir { 137cdf0e10cSrcweir OutlinerView* pOLV = pView->GetTextEditOutlinerView(); 138cdf0e10cSrcweir 139cdf0e10cSrcweir if(pOLV) 140cdf0e10cSrcweir { 141cdf0e10cSrcweir for(sal_uInt16 a(0); a < aInputString.Len(); a++) 142cdf0e10cSrcweir { 143cdf0e10cSrcweir sal_Char aChar = (sal_Char)aInputString.GetChar(a); 144cdf0e10cSrcweir KeyCode aKeyCode; 145cdf0e10cSrcweir KeyEvent aKeyEvent(aChar, aKeyCode); 146cdf0e10cSrcweir 147cdf0e10cSrcweir // add actual character 148cdf0e10cSrcweir pOLV->PostKeyEvent(aKeyEvent); 149cdf0e10cSrcweir } 150cdf0e10cSrcweir } 151cdf0e10cSrcweir } 152cdf0e10cSrcweir } 153cdf0e10cSrcweir } 154cdf0e10cSrcweir 155cdf0e10cSrcweir void DrawViewShell::FuPermanent(SfxRequest& rReq) 156cdf0e10cSrcweir { 157cdf0e10cSrcweir // Waehrend einer Native-Diashow wird nichts ausgefuehrt! 158cdf0e10cSrcweir 159cdf0e10cSrcweir if (SlideShow::IsRunning(GetViewShellBase())) 160cdf0e10cSrcweir return; 161cdf0e10cSrcweir 162cdf0e10cSrcweir sal_uInt16 nSId = rReq.GetSlot(); 163cdf0e10cSrcweir 164cdf0e10cSrcweir if( HasCurrentFunction() && 165cdf0e10cSrcweir ( nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE || 166cdf0e10cSrcweir nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL ) ) 167cdf0e10cSrcweir { 168cdf0e10cSrcweir FunctionReference xFunc( GetCurrentFunction() ); 169cdf0e10cSrcweir 170cdf0e10cSrcweir FuText* pFuText = dynamic_cast< FuText* >( xFunc.get() ); 171cdf0e10cSrcweir 172cdf0e10cSrcweir if( pFuText ) 173cdf0e10cSrcweir { 174cdf0e10cSrcweir pFuText->SetPermanent(sal_True); 175cdf0e10cSrcweir xFunc->ReceiveRequest( rReq ); 176cdf0e10cSrcweir 177cdf0e10cSrcweir MapSlot( nSId ); 178cdf0e10cSrcweir 179cdf0e10cSrcweir Invalidate(); 180cdf0e10cSrcweir 181cdf0e10cSrcweir Invalidate(); 182cdf0e10cSrcweir 183cdf0e10cSrcweir // #98198# evtl. feed characters to activated textedit 184cdf0e10cSrcweir if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit()) 185cdf0e10cSrcweir ImpAddPrintableCharactersToTextEdit(rReq, GetView()); 186cdf0e10cSrcweir 187cdf0e10cSrcweir rReq.Done(); 188cdf0e10cSrcweir return; 189cdf0e10cSrcweir } 190cdf0e10cSrcweir } 191cdf0e10cSrcweir 192cdf0e10cSrcweir CheckLineTo (rReq); 193cdf0e10cSrcweir sal_uInt16 nOldSId = 0; 194cdf0e10cSrcweir sal_Bool bPermanent = sal_False; 195cdf0e10cSrcweir 196cdf0e10cSrcweir if( !mpDrawView ) 197cdf0e10cSrcweir return; 198cdf0e10cSrcweir 199cdf0e10cSrcweir if(HasCurrentFunction()) 200cdf0e10cSrcweir { 201cdf0e10cSrcweir if( (nSId == SID_FORMATPAINTBRUSH) && (GetCurrentFunction()->GetSlotID() == SID_TEXTEDIT) ) 202cdf0e10cSrcweir { 203cdf0e10cSrcweir // save text edit mode for format paintbrush! 204cdf0e10cSrcweir SetOldFunction( GetCurrentFunction() ); 205cdf0e10cSrcweir } 206cdf0e10cSrcweir else 207cdf0e10cSrcweir { 208cdf0e10cSrcweir if(GetOldFunction() == GetCurrentFunction()) 209cdf0e10cSrcweir { 210cdf0e10cSrcweir SetOldFunction(0); 211cdf0e10cSrcweir } 212cdf0e10cSrcweir } 213cdf0e10cSrcweir 214cdf0e10cSrcweir if ( nSId != SID_TEXTEDIT && nSId != SID_ATTR_CHAR && nSId != SID_TEXT_FITTOSIZE && 215cdf0e10cSrcweir nSId != SID_ATTR_CHAR_VERTICAL && nSId != SID_TEXT_FITTOSIZE_VERTICAL && 216cdf0e10cSrcweir nSId != SID_FORMATPAINTBRUSH && 217cdf0e10cSrcweir mpDrawView->IsTextEdit() ) 218cdf0e10cSrcweir { 219cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 220cdf0e10cSrcweir } 221cdf0e10cSrcweir 222cdf0e10cSrcweir if( HasCurrentFunction() ) 223cdf0e10cSrcweir { 224cdf0e10cSrcweir nOldSId = GetCurrentFunction()->GetSlotID(); 225cdf0e10cSrcweir 226cdf0e10cSrcweir if (nOldSId == nSId || 227cdf0e10cSrcweir ((nOldSId == SID_TEXTEDIT || nOldSId == SID_ATTR_CHAR || nOldSId == SID_TEXT_FITTOSIZE || 228cdf0e10cSrcweir nOldSId == SID_ATTR_CHAR_VERTICAL || nOldSId == SID_TEXT_FITTOSIZE_VERTICAL) && 229cdf0e10cSrcweir (nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE || 230cdf0e10cSrcweir nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL ))) 231cdf0e10cSrcweir { 232cdf0e10cSrcweir bPermanent = sal_True; 233cdf0e10cSrcweir } 234cdf0e10cSrcweir 235cdf0e10cSrcweir GetCurrentFunction()->Deactivate(); 236cdf0e10cSrcweir } 237cdf0e10cSrcweir 238cdf0e10cSrcweir SetCurrentFunction(0); 239cdf0e10cSrcweir 240cdf0e10cSrcweir SfxBindings& rBind = GetViewFrame()->GetBindings(); 241cdf0e10cSrcweir rBind.Invalidate(nOldSId); 242cdf0e10cSrcweir rBind.Update(nOldSId); 243cdf0e10cSrcweir } 244cdf0e10cSrcweir 245cdf0e10cSrcweir // Slot wird gemapped (ToolboxImages/-Slots) 246cdf0e10cSrcweir MapSlot( nSId ); 247cdf0e10cSrcweir 248cdf0e10cSrcweir switch ( nSId ) 249cdf0e10cSrcweir { 250cdf0e10cSrcweir case SID_TEXTEDIT: // BASIC ??? 251cdf0e10cSrcweir case SID_ATTR_CHAR: 252cdf0e10cSrcweir case SID_ATTR_CHAR_VERTICAL: 253cdf0e10cSrcweir case SID_TEXT_FITTOSIZE: 254cdf0e10cSrcweir case SID_TEXT_FITTOSIZE_VERTICAL: 255cdf0e10cSrcweir { 256cdf0e10cSrcweir SetCurrentFunction( FuText::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) ); 257cdf0e10cSrcweir GetCurrentFunction()->DoExecute(rReq); 258cdf0e10cSrcweir 259cdf0e10cSrcweir SfxBindings& rBindings = GetViewFrame()->GetBindings(); 260cdf0e10cSrcweir rBindings.Invalidate( SID_ATTR_CHAR ); 261cdf0e10cSrcweir rBindings.Invalidate( SID_ATTR_CHAR_VERTICAL ); 262cdf0e10cSrcweir rBindings.Invalidate( SID_TEXT_FITTOSIZE ); 263cdf0e10cSrcweir rBindings.Invalidate( SID_TEXT_FITTOSIZE_VERTICAL ); 264cdf0e10cSrcweir 265cdf0e10cSrcweir // #98198# evtl. feed characters to activated textedit 266cdf0e10cSrcweir if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit()) 267cdf0e10cSrcweir ImpAddPrintableCharactersToTextEdit(rReq, GetView()); 268cdf0e10cSrcweir 269cdf0e10cSrcweir rReq.Done(); 270cdf0e10cSrcweir } 271cdf0e10cSrcweir break; 272cdf0e10cSrcweir 273cdf0e10cSrcweir case SID_FM_CREATE_CONTROL: 274cdf0e10cSrcweir { 275cdf0e10cSrcweir SetCurrentFunction( FuConstructUnoControl::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) ); 276cdf0e10cSrcweir rReq.Done(); 277cdf0e10cSrcweir } 278cdf0e10cSrcweir break; 279cdf0e10cSrcweir 280cdf0e10cSrcweir // #98721# 281cdf0e10cSrcweir case SID_FM_CREATE_FIELDCONTROL: 282cdf0e10cSrcweir { 283cdf0e10cSrcweir SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False ); 284cdf0e10cSrcweir DBG_ASSERT( pDescriptorItem, "DrawViewShell::FuPermanent(SID_FM_CREATE_FIELDCONTROL): invalid request args!" ); 285cdf0e10cSrcweir 286cdf0e10cSrcweir if(pDescriptorItem) 287cdf0e10cSrcweir { 288cdf0e10cSrcweir // get the form view 289cdf0e10cSrcweir FmFormView* pFormView = PTR_CAST(FmFormView, mpDrawView); 290cdf0e10cSrcweir SdrPageView* pPageView = pFormView ? pFormView->GetSdrPageView() : NULL; 291cdf0e10cSrcweir 292cdf0e10cSrcweir if(pPageView) 293cdf0e10cSrcweir { 294cdf0e10cSrcweir ::svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue()); 295cdf0e10cSrcweir SdrObject* pNewDBField = pFormView->CreateFieldControl(aDescriptor); 296cdf0e10cSrcweir 297cdf0e10cSrcweir if(pNewDBField) 298cdf0e10cSrcweir { 299cdf0e10cSrcweir Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel())); 300cdf0e10cSrcweir Point aObjPos(aVisArea.Center()); 301cdf0e10cSrcweir Size aObjSize(pNewDBField->GetLogicRect().GetSize()); 302cdf0e10cSrcweir aObjPos.X() -= aObjSize.Width() / 2; 303cdf0e10cSrcweir aObjPos.Y() -= aObjSize.Height() / 2; 304cdf0e10cSrcweir Rectangle aNewObjectRectangle(aObjPos, aObjSize); 305cdf0e10cSrcweir 306cdf0e10cSrcweir pNewDBField->SetLogicRect(aNewObjectRectangle); 307cdf0e10cSrcweir 308cdf0e10cSrcweir GetView()->InsertObjectAtView(pNewDBField, *pPageView); 309cdf0e10cSrcweir } 310cdf0e10cSrcweir } 311cdf0e10cSrcweir } 312cdf0e10cSrcweir rReq.Done(); 313cdf0e10cSrcweir } 314cdf0e10cSrcweir break; 315cdf0e10cSrcweir 316cdf0e10cSrcweir case SID_OBJECT_SELECT: 317cdf0e10cSrcweir case SID_OBJECT_ROTATE: 318cdf0e10cSrcweir case SID_OBJECT_MIRROR: 319cdf0e10cSrcweir case SID_OBJECT_CROP: 320cdf0e10cSrcweir case SID_OBJECT_TRANSPARENCE: 321cdf0e10cSrcweir case SID_OBJECT_GRADIENT: 322cdf0e10cSrcweir case SID_OBJECT_SHEAR: 323cdf0e10cSrcweir case SID_OBJECT_CROOK_ROTATE: 324cdf0e10cSrcweir case SID_OBJECT_CROOK_SLANT: 325cdf0e10cSrcweir case SID_OBJECT_CROOK_STRETCH: 326cdf0e10cSrcweir case SID_CONVERT_TO_3D_LATHE: 327cdf0e10cSrcweir { 328cdf0e10cSrcweir short nSlotId = rReq.GetSlot(); 329cdf0e10cSrcweir 330cdf0e10cSrcweir if( nSlotId == SID_OBJECT_ROTATE ) 331cdf0e10cSrcweir { 332cdf0e10cSrcweir // togle rotation 333cdf0e10cSrcweir if( nOldSId == nSlotId ) 334cdf0e10cSrcweir { 335cdf0e10cSrcweir nSlotId = SID_OBJECT_SELECT; 336cdf0e10cSrcweir rReq.SetSlot( nSlotId ); 337cdf0e10cSrcweir } 338cdf0e10cSrcweir } 339cdf0e10cSrcweir 340cdf0e10cSrcweir if (nSlotId == SID_OBJECT_CROOK_ROTATE || 341cdf0e10cSrcweir nSlotId == SID_OBJECT_CROOK_SLANT || 342cdf0e10cSrcweir nSlotId == SID_OBJECT_CROOK_STRETCH) 343cdf0e10cSrcweir { 344cdf0e10cSrcweir if ( mpDrawView->GetMarkedObjectList().GetMarkCount() > 0 && 345cdf0e10cSrcweir !mpDrawView->IsCrookAllowed( mpDrawView->IsCrookNoContortion() ) ) 346cdf0e10cSrcweir { 347cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 348cdf0e10cSrcweir { 349cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 350cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 351cdf0e10cSrcweir } 352cdf0e10cSrcweir else if ( QueryBox(GetActiveWindow(), WB_YES_NO, 353cdf0e10cSrcweir String(SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) ) 354cdf0e10cSrcweir ).Execute() == RET_YES ) 355cdf0e10cSrcweir { 356cdf0e10cSrcweir // Implizite Wandlung in Bezier 357cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 358cdf0e10cSrcweir mpDrawView->ConvertMarkedToPathObj(sal_False); 359cdf0e10cSrcweir } 360cdf0e10cSrcweir } 361cdf0e10cSrcweir } 362cdf0e10cSrcweir else if (nSlotId == SID_OBJECT_SHEAR) 363cdf0e10cSrcweir { 364cdf0e10cSrcweir sal_uLong i = 0; 365cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 366cdf0e10cSrcweir sal_uLong nMarkCnt = rMarkList.GetMarkCount(); 367cdf0e10cSrcweir sal_Bool b3DObjMarked = sal_False; 368cdf0e10cSrcweir 369cdf0e10cSrcweir while (i < nMarkCnt && !b3DObjMarked) 370cdf0e10cSrcweir { 371cdf0e10cSrcweir if (rMarkList.GetMark(i)->GetMarkedSdrObj()->ISA(E3dObject)) 372cdf0e10cSrcweir { 373cdf0e10cSrcweir b3DObjMarked = sal_True; 374cdf0e10cSrcweir } 375cdf0e10cSrcweir else 376cdf0e10cSrcweir { 377cdf0e10cSrcweir i++; 378cdf0e10cSrcweir } 379cdf0e10cSrcweir } 380cdf0e10cSrcweir 381cdf0e10cSrcweir if ( nMarkCnt > 0 && !b3DObjMarked && 382cdf0e10cSrcweir (!mpDrawView->IsShearAllowed() || !mpDrawView->IsDistortAllowed()) ) 383cdf0e10cSrcweir { 384cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected() ) 385cdf0e10cSrcweir { 386cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 387cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 388cdf0e10cSrcweir } 389cdf0e10cSrcweir else if ( QueryBox(GetActiveWindow(), WB_YES_NO, 390cdf0e10cSrcweir String(SdResId(STR_ASK_FOR_CONVERT_TO_BEZIER) ) 391cdf0e10cSrcweir ).Execute() == RET_YES ) 392cdf0e10cSrcweir { 393cdf0e10cSrcweir // Implizite Wandlung in Bezier 394cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 395cdf0e10cSrcweir mpDrawView->ConvertMarkedToPathObj(sal_False); 396cdf0e10cSrcweir } 397cdf0e10cSrcweir } 398cdf0e10cSrcweir } 399cdf0e10cSrcweir 400cdf0e10cSrcweir SetCurrentFunction( FuSelection::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) ); 401cdf0e10cSrcweir rReq.Done(); 402cdf0e10cSrcweir Invalidate( SID_OBJECT_SELECT ); 403cdf0e10cSrcweir } 404cdf0e10cSrcweir break; 405cdf0e10cSrcweir 406cdf0e10cSrcweir case SID_DRAW_LINE: 407cdf0e10cSrcweir case SID_DRAW_XLINE: 408cdf0e10cSrcweir case SID_DRAW_MEASURELINE: 409cdf0e10cSrcweir case SID_LINE_ARROW_START: 410cdf0e10cSrcweir case SID_LINE_ARROW_END: 411cdf0e10cSrcweir case SID_LINE_ARROWS: 412cdf0e10cSrcweir case SID_LINE_ARROW_CIRCLE: 413cdf0e10cSrcweir case SID_LINE_CIRCLE_ARROW: 414cdf0e10cSrcweir case SID_LINE_ARROW_SQUARE: 415cdf0e10cSrcweir case SID_LINE_SQUARE_ARROW: 416cdf0e10cSrcweir 417cdf0e10cSrcweir case SID_DRAW_RECT: 418cdf0e10cSrcweir case SID_DRAW_RECT_NOFILL: 419cdf0e10cSrcweir case SID_DRAW_RECT_ROUND: 420cdf0e10cSrcweir case SID_DRAW_RECT_ROUND_NOFILL: 421cdf0e10cSrcweir case SID_DRAW_SQUARE: 422cdf0e10cSrcweir case SID_DRAW_SQUARE_NOFILL: 423cdf0e10cSrcweir case SID_DRAW_SQUARE_ROUND: 424cdf0e10cSrcweir case SID_DRAW_SQUARE_ROUND_NOFILL: 425cdf0e10cSrcweir case SID_DRAW_ELLIPSE: 426cdf0e10cSrcweir case SID_DRAW_ELLIPSE_NOFILL: 427cdf0e10cSrcweir case SID_DRAW_CIRCLE: 428cdf0e10cSrcweir case SID_DRAW_CIRCLE_NOFILL: 429cdf0e10cSrcweir case SID_DRAW_CAPTION: 430cdf0e10cSrcweir case SID_DRAW_CAPTION_VERTICAL: 431cdf0e10cSrcweir case SID_TOOL_CONNECTOR: 432cdf0e10cSrcweir case SID_CONNECTOR_ARROW_START: 433cdf0e10cSrcweir case SID_CONNECTOR_ARROW_END: 434cdf0e10cSrcweir case SID_CONNECTOR_ARROWS: 435cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_START: 436cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_END: 437cdf0e10cSrcweir case SID_CONNECTOR_CIRCLES: 438cdf0e10cSrcweir case SID_CONNECTOR_LINE: 439cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_START: 440cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_END: 441cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROWS: 442cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_START: 443cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_END: 444cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLES: 445cdf0e10cSrcweir case SID_CONNECTOR_CURVE: 446cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_START: 447cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_END: 448cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROWS: 449cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_START: 450cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_END: 451cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLES: 452cdf0e10cSrcweir case SID_CONNECTOR_LINES: 453cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_START: 454cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_END: 455cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROWS: 456cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_START: 457cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_END: 458cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLES: 459cdf0e10cSrcweir { 460cdf0e10cSrcweir SetCurrentFunction( FuConstructRectangle::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) ); 461cdf0e10cSrcweir rReq.Done(); 462cdf0e10cSrcweir } 463cdf0e10cSrcweir break; 464cdf0e10cSrcweir case SID_DRAW_POLYGON: 465cdf0e10cSrcweir case SID_DRAW_POLYGON_NOFILL: 466cdf0e10cSrcweir case SID_DRAW_XPOLYGON: 467cdf0e10cSrcweir case SID_DRAW_XPOLYGON_NOFILL: 468cdf0e10cSrcweir case SID_DRAW_FREELINE: 469cdf0e10cSrcweir case SID_DRAW_FREELINE_NOFILL: 470cdf0e10cSrcweir case SID_DRAW_BEZIER_FILL: // BASIC 471cdf0e10cSrcweir case SID_DRAW_BEZIER_NOFILL: // BASIC 472cdf0e10cSrcweir { 473cdf0e10cSrcweir SetCurrentFunction( FuConstructBezierPolygon::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent) ); 474cdf0e10cSrcweir rReq.Done(); 475cdf0e10cSrcweir } 476cdf0e10cSrcweir break; 477cdf0e10cSrcweir 478cdf0e10cSrcweir case SID_GLUE_EDITMODE: 479cdf0e10cSrcweir { 480cdf0e10cSrcweir if (nOldSId != SID_GLUE_EDITMODE) 481cdf0e10cSrcweir { 482cdf0e10cSrcweir SetCurrentFunction( FuEditGluePoints::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) ); 483cdf0e10cSrcweir } 484cdf0e10cSrcweir else 485cdf0e10cSrcweir { 486cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); 487cdf0e10cSrcweir } 488cdf0e10cSrcweir 489cdf0e10cSrcweir rReq.Done(); 490cdf0e10cSrcweir } 491cdf0e10cSrcweir break; 492cdf0e10cSrcweir 493cdf0e10cSrcweir case SID_DRAW_ARC: 494cdf0e10cSrcweir case SID_DRAW_CIRCLEARC: 495cdf0e10cSrcweir case SID_DRAW_PIE: 496cdf0e10cSrcweir case SID_DRAW_PIE_NOFILL: 497cdf0e10cSrcweir case SID_DRAW_CIRCLEPIE: 498cdf0e10cSrcweir case SID_DRAW_CIRCLEPIE_NOFILL: 499cdf0e10cSrcweir case SID_DRAW_ELLIPSECUT: 500cdf0e10cSrcweir case SID_DRAW_ELLIPSECUT_NOFILL: 501cdf0e10cSrcweir case SID_DRAW_CIRCLECUT: 502cdf0e10cSrcweir case SID_DRAW_CIRCLECUT_NOFILL: 503cdf0e10cSrcweir { 504cdf0e10cSrcweir SetCurrentFunction( FuConstructArc::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent) ); 505cdf0e10cSrcweir rReq.Done(); 506cdf0e10cSrcweir } 507cdf0e10cSrcweir break; 508cdf0e10cSrcweir 509cdf0e10cSrcweir case SID_3D_CUBE: 510cdf0e10cSrcweir case SID_3D_SHELL: 511cdf0e10cSrcweir case SID_3D_SPHERE: 512cdf0e10cSrcweir case SID_3D_TORUS: 513cdf0e10cSrcweir case SID_3D_HALF_SPHERE: 514cdf0e10cSrcweir case SID_3D_CYLINDER: 515cdf0e10cSrcweir case SID_3D_CONE: 516cdf0e10cSrcweir case SID_3D_PYRAMID: 517cdf0e10cSrcweir { 518cdf0e10cSrcweir SetCurrentFunction( FuConstruct3dObject::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) ); 519cdf0e10cSrcweir rReq.Done(); 520cdf0e10cSrcweir } 521cdf0e10cSrcweir break; 522cdf0e10cSrcweir 523cdf0e10cSrcweir case SID_DRAWTBX_CS_BASIC : 524cdf0e10cSrcweir case SID_DRAWTBX_CS_SYMBOL : 525cdf0e10cSrcweir case SID_DRAWTBX_CS_ARROW : 526cdf0e10cSrcweir case SID_DRAWTBX_CS_FLOWCHART : 527cdf0e10cSrcweir case SID_DRAWTBX_CS_CALLOUT : 528cdf0e10cSrcweir case SID_DRAWTBX_CS_STAR : 529cdf0e10cSrcweir case SID_DRAW_CS_ID : 530cdf0e10cSrcweir { 531cdf0e10cSrcweir SetCurrentFunction( FuConstructCustomShape::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq, bPermanent ) ); 532cdf0e10cSrcweir rReq.Done(); 533cdf0e10cSrcweir 534cdf0e10cSrcweir if ( nSId != SID_DRAW_CS_ID ) 535cdf0e10cSrcweir { 536cdf0e10cSrcweir SfxBindings& rBind = GetViewFrame()->GetBindings(); 537cdf0e10cSrcweir rBind.Invalidate( nSId ); 538cdf0e10cSrcweir rBind.Update( nSId ); 539cdf0e10cSrcweir } 540cdf0e10cSrcweir } 541cdf0e10cSrcweir break; 542cdf0e10cSrcweir 543cdf0e10cSrcweir case SID_FORMATPAINTBRUSH: 544cdf0e10cSrcweir { 545cdf0e10cSrcweir SetCurrentFunction( FuFormatPaintBrush::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); 546cdf0e10cSrcweir rReq.Done(); 547cdf0e10cSrcweir SfxBindings& rBind = GetViewFrame()->GetBindings(); 548cdf0e10cSrcweir rBind.Invalidate( nSId ); 549cdf0e10cSrcweir rBind.Update( nSId ); 550cdf0e10cSrcweir break; 551cdf0e10cSrcweir } 552cdf0e10cSrcweir 553cdf0e10cSrcweir default: 554cdf0e10cSrcweir break; 555cdf0e10cSrcweir } 556cdf0e10cSrcweir 557cdf0e10cSrcweir if(HasOldFunction()) 558cdf0e10cSrcweir { 559cdf0e10cSrcweir sal_uInt16 nSlotId = GetOldFunction()->GetSlotID(); 560cdf0e10cSrcweir 561cdf0e10cSrcweir GetOldFunction()->Deactivate(); 562cdf0e10cSrcweir SetOldFunction(0); 563cdf0e10cSrcweir 564cdf0e10cSrcweir SfxBindings& rBind = GetViewFrame()->GetBindings(); 565cdf0e10cSrcweir rBind.Invalidate( nSlotId ); 566cdf0e10cSrcweir rBind.Update( nSlotId ); 567cdf0e10cSrcweir } 568cdf0e10cSrcweir 569cdf0e10cSrcweir if(HasCurrentFunction()) 570cdf0e10cSrcweir { 571cdf0e10cSrcweir GetCurrentFunction()->Activate(); 572cdf0e10cSrcweir SetOldFunction( GetCurrentFunction() ); 573cdf0e10cSrcweir 574cdf0e10cSrcweir SetHelpId( GetCurrentFunction()->GetSlotID() ); 575cdf0e10cSrcweir } 576cdf0e10cSrcweir 577cdf0e10cSrcweir // Shell wird invalidiert, schneller als einzeln (laut MI) 578cdf0e10cSrcweir // Jetzt explizit der letzte Slot incl. Update() 579cdf0e10cSrcweir Invalidate(); 580cdf0e10cSrcweir 581cdf0e10cSrcweir // #97016# III CTRL-SID_OBJECT_SELECT -> select first draw object if none is selected yet 582cdf0e10cSrcweir if(SID_OBJECT_SELECT == nSId && HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1)) 583cdf0e10cSrcweir { 584cdf0e10cSrcweir if(!GetView()->AreObjectsMarked()) 585cdf0e10cSrcweir { 586cdf0e10cSrcweir // select first object 587cdf0e10cSrcweir GetView()->UnmarkAllObj(); 588cdf0e10cSrcweir GetView()->MarkNextObj(sal_True); 589cdf0e10cSrcweir 590cdf0e10cSrcweir // ...and make it visible 591cdf0e10cSrcweir if(GetView()->AreObjectsMarked()) 592cdf0e10cSrcweir GetView()->MakeVisible(GetView()->GetAllMarkedRect(), *GetActiveWindow()); 593cdf0e10cSrcweir } 594cdf0e10cSrcweir } 595cdf0e10cSrcweir 596cdf0e10cSrcweir // #97016# with qualifier construct directly 597cdf0e10cSrcweir if(HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1)) 598cdf0e10cSrcweir { 599cdf0e10cSrcweir // get SdOptions 600cdf0e10cSrcweir SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType()); 601cdf0e10cSrcweir sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth()); 602cdf0e10cSrcweir sal_uInt32 nDefaultObjectSizeHeight(pOptions->GetDefaultObjectSizeHeight()); 603cdf0e10cSrcweir 604cdf0e10cSrcweir // calc position and size 605cdf0e10cSrcweir Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel())); 606cdf0e10cSrcweir Point aPagePos = aVisArea.Center(); 607cdf0e10cSrcweir aPagePos.X() -= nDefaultObjectSizeWidth / 2; 608cdf0e10cSrcweir aPagePos.Y() -= nDefaultObjectSizeHeight / 2; 609cdf0e10cSrcweir Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight)); 610cdf0e10cSrcweir SdrPageView* pPageView = mpDrawView->GetSdrPageView(); 611cdf0e10cSrcweir 612cdf0e10cSrcweir if(pPageView) 613cdf0e10cSrcweir { 614cdf0e10cSrcweir // create the default object 615cdf0e10cSrcweir SdrObject* pObj = GetCurrentFunction()->CreateDefaultObject(nSId, aNewObjectRectangle); 616cdf0e10cSrcweir 617cdf0e10cSrcweir if(pObj) 618cdf0e10cSrcweir { 619cdf0e10cSrcweir // insert into page 620cdf0e10cSrcweir GetView()->InsertObjectAtView(pObj, *pPageView); 621cdf0e10cSrcweir 622cdf0e10cSrcweir // Now that pFuActual has done what it was created for we 623cdf0e10cSrcweir // can switch on the edit mode for callout objects. 624cdf0e10cSrcweir switch (nSId) 625cdf0e10cSrcweir { 626cdf0e10cSrcweir case SID_DRAW_CAPTION: 627cdf0e10cSrcweir case SID_DRAW_CAPTION_VERTICAL: 628cdf0e10cSrcweir { 629cdf0e10cSrcweir // Make FuText the current function. 630cdf0e10cSrcweir SfxUInt16Item aItem (SID_TEXTEDIT, 1); 631cdf0e10cSrcweir GetViewFrame()->GetDispatcher()-> 632cdf0e10cSrcweir Execute(SID_TEXTEDIT, SFX_CALLMODE_SYNCHRON | 633cdf0e10cSrcweir SFX_CALLMODE_RECORD, &aItem, 0L); 634cdf0e10cSrcweir // Put text object into edit mode. 635cdf0e10cSrcweir GetView()->SdrBeginTextEdit(static_cast<SdrTextObj*>(pObj), pPageView); 636cdf0e10cSrcweir break; 637cdf0e10cSrcweir } 638cdf0e10cSrcweir } 639cdf0e10cSrcweir } 640cdf0e10cSrcweir } 641cdf0e10cSrcweir } 642cdf0e10cSrcweir } 643cdf0e10cSrcweir 644cdf0e10cSrcweir /************************************************************************* 645cdf0e10cSrcweir |* 646cdf0e10cSrcweir |* SfxRequests fuer Support-Funktionen 647cdf0e10cSrcweir |* 648cdf0e10cSrcweir \************************************************************************/ 649cdf0e10cSrcweir 650cdf0e10cSrcweir void DrawViewShell::FuSupport(SfxRequest& rReq) 651cdf0e10cSrcweir { 652cdf0e10cSrcweir if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) 653cdf0e10cSrcweir GetDocSh()->SetStyleFamily(((SfxUInt16Item&)rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); 654cdf0e10cSrcweir 655cdf0e10cSrcweir // Waehrend einer Native-Diashow wird nichts ausgefuehrt! 656cdf0e10cSrcweir if(SlideShow::IsRunning(GetViewShellBase()) && 657cdf0e10cSrcweir (rReq.GetSlot() != SID_PRESENTATION_END && 658cdf0e10cSrcweir rReq.GetSlot() != SID_SIZE_PAGE)) 659cdf0e10cSrcweir return; 660cdf0e10cSrcweir 661cdf0e10cSrcweir CheckLineTo (rReq); 662cdf0e10cSrcweir 663cdf0e10cSrcweir if( !mpDrawView ) 664cdf0e10cSrcweir return; 665cdf0e10cSrcweir 666cdf0e10cSrcweir sal_uInt16 nSId = rReq.GetSlot(); 667cdf0e10cSrcweir 668cdf0e10cSrcweir // Slot wird evtl. gemapped (ToolboxImages/-Slots) 669cdf0e10cSrcweir MapSlot( nSId ); 670cdf0e10cSrcweir 671cdf0e10cSrcweir switch ( nSId ) 672cdf0e10cSrcweir { 673cdf0e10cSrcweir case SID_CLEAR_UNDO_STACK: 674cdf0e10cSrcweir { 675cdf0e10cSrcweir GetDocSh()->ClearUndoBuffer(); 676cdf0e10cSrcweir rReq.Ignore (); 677cdf0e10cSrcweir } 678cdf0e10cSrcweir break; 679cdf0e10cSrcweir 680cdf0e10cSrcweir // Slots der ToolboxController gemapped ausfuehren 681cdf0e10cSrcweir case SID_OBJECT_CHOOSE_MODE: 682cdf0e10cSrcweir case SID_POSITION: 683cdf0e10cSrcweir case SID_OBJECT_ALIGN: 684cdf0e10cSrcweir case SID_ZOOM_TOOLBOX: 685cdf0e10cSrcweir case SID_DRAWTBX_TEXT: 686cdf0e10cSrcweir case SID_DRAWTBX_RECTANGLES: 687cdf0e10cSrcweir case SID_DRAWTBX_ELLIPSES: 688cdf0e10cSrcweir case SID_DRAWTBX_LINES: 689cdf0e10cSrcweir case SID_DRAWTBX_ARROWS: 690cdf0e10cSrcweir case SID_DRAWTBX_3D_OBJECTS: 691cdf0e10cSrcweir case SID_DRAWTBX_CONNECTORS: 692cdf0e10cSrcweir case SID_DRAWTBX_INSERT: 693cdf0e10cSrcweir { 694cdf0e10cSrcweir sal_uInt16 nMappedSlot = GetMappedSlot( nSId ); 695cdf0e10cSrcweir if( nMappedSlot > 0 ) 696cdf0e10cSrcweir { 697cdf0e10cSrcweir SfxRequest aReq( nMappedSlot, 0, GetDoc()->GetItemPool() ); 698cdf0e10cSrcweir ExecuteSlot( aReq ); 699cdf0e10cSrcweir } 700cdf0e10cSrcweir } 701cdf0e10cSrcweir break; 702cdf0e10cSrcweir 703cdf0e10cSrcweir case SID_PRESENTATION: 704cdf0e10cSrcweir case SID_REHEARSE_TIMINGS: 705cdf0e10cSrcweir { 706cdf0e10cSrcweir Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() ); 707cdf0e10cSrcweir if( xPresentation.is() ) 708cdf0e10cSrcweir { 709cdf0e10cSrcweir if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) ) 710cdf0e10cSrcweir xPresentation->start(); 711cdf0e10cSrcweir else 712cdf0e10cSrcweir xPresentation->rehearseTimings(); 713cdf0e10cSrcweir } 714cdf0e10cSrcweir rReq.Ignore (); 715cdf0e10cSrcweir } 716cdf0e10cSrcweir break; 717cdf0e10cSrcweir 718cdf0e10cSrcweir case SID_PRESENTATION_END: 719cdf0e10cSrcweir { 720cdf0e10cSrcweir StopSlideShow(true); 721cdf0e10cSrcweir 722cdf0e10cSrcweir rReq.Ignore (); 723cdf0e10cSrcweir } 724cdf0e10cSrcweir break; 725cdf0e10cSrcweir 726cdf0e10cSrcweir case SID_BEZIER_EDIT: 727cdf0e10cSrcweir { 728cdf0e10cSrcweir mpDrawView->SetFrameDragSingles(!mpDrawView->IsFrameDragSingles()); 729cdf0e10cSrcweir 730cdf0e10cSrcweir /****************************************************************** 731cdf0e10cSrcweir * ObjectBar einschalten 732cdf0e10cSrcweir ******************************************************************/ 733cdf0e10cSrcweir if( dynamic_cast< FuSelection* >( GetCurrentFunction().get() ) || dynamic_cast< FuConstructBezierPolygon* >( GetCurrentFunction().get() ) ) 734cdf0e10cSrcweir { 735cdf0e10cSrcweir // Tell the tool bar manager about the context change. 736cdf0e10cSrcweir GetViewShellBase().GetToolBarManager()->SelectionHasChanged(*this,*mpDrawView); 737cdf0e10cSrcweir } 738cdf0e10cSrcweir 739cdf0e10cSrcweir Invalidate(SID_BEZIER_EDIT); 740cdf0e10cSrcweir rReq.Ignore(); 741cdf0e10cSrcweir } 742cdf0e10cSrcweir break; 743cdf0e10cSrcweir 744cdf0e10cSrcweir case SID_OBJECT_CLOSE: 745cdf0e10cSrcweir { 746cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 747cdf0e10cSrcweir if ( rMarkList.GetMark(0) && !mpDrawView->IsAction() ) 748cdf0e10cSrcweir { 749cdf0e10cSrcweir SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetMarkedSdrObj(); 750cdf0e10cSrcweir const bool bUndo = mpDrawView->IsUndoEnabled(); 751cdf0e10cSrcweir if( bUndo ) 752cdf0e10cSrcweir mpDrawView->BegUndo(String(SdResId(STR_UNDO_BEZCLOSE))); 753cdf0e10cSrcweir 754cdf0e10cSrcweir mpDrawView->UnmarkAllPoints(); 755cdf0e10cSrcweir 756cdf0e10cSrcweir if( bUndo ) 757cdf0e10cSrcweir mpDrawView->AddUndo(new SdrUndoGeoObj(*pPathObj)); 758cdf0e10cSrcweir 759cdf0e10cSrcweir pPathObj->ToggleClosed(); 760cdf0e10cSrcweir 761cdf0e10cSrcweir if( bUndo ) 762cdf0e10cSrcweir mpDrawView->EndUndo(); 763cdf0e10cSrcweir } 764cdf0e10cSrcweir rReq.Done(); 765cdf0e10cSrcweir } 766cdf0e10cSrcweir break; 767cdf0e10cSrcweir 768cdf0e10cSrcweir case SID_CUT: 769cdf0e10cSrcweir { 770cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) ) 771cdf0e10cSrcweir { 772cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 773cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 774cdf0e10cSrcweir } 775cdf0e10cSrcweir else 776cdf0e10cSrcweir { 777cdf0e10cSrcweir if(HasCurrentFunction()) 778cdf0e10cSrcweir { 779cdf0e10cSrcweir GetCurrentFunction()->DoCut(); 780cdf0e10cSrcweir } 781cdf0e10cSrcweir else if(mpDrawView) 782cdf0e10cSrcweir { 783cdf0e10cSrcweir mpDrawView->DoCut(); 784cdf0e10cSrcweir } 785cdf0e10cSrcweir } 786cdf0e10cSrcweir rReq.Ignore (); 787cdf0e10cSrcweir } 788cdf0e10cSrcweir break; 789cdf0e10cSrcweir 790cdf0e10cSrcweir case SID_COPY: 791cdf0e10cSrcweir { 792cdf0e10cSrcweir if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) ) 793cdf0e10cSrcweir { 794cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 795cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 796cdf0e10cSrcweir } 797cdf0e10cSrcweir else 798cdf0e10cSrcweir { 799cdf0e10cSrcweir if(HasCurrentFunction()) 800cdf0e10cSrcweir { 801cdf0e10cSrcweir GetCurrentFunction()->DoCopy(); 802cdf0e10cSrcweir } 803cdf0e10cSrcweir else if( mpDrawView ) 804cdf0e10cSrcweir { 805cdf0e10cSrcweir mpDrawView->DoCopy(); 806cdf0e10cSrcweir } 807cdf0e10cSrcweir } 808cdf0e10cSrcweir rReq.Ignore (); 809cdf0e10cSrcweir } 810cdf0e10cSrcweir break; 811cdf0e10cSrcweir 812cdf0e10cSrcweir case SID_PASTE: 813cdf0e10cSrcweir { 814cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 815cdf0e10cSrcweir 816cdf0e10cSrcweir if(HasCurrentFunction()) 817cdf0e10cSrcweir { 818cdf0e10cSrcweir GetCurrentFunction()->DoPaste(); 819cdf0e10cSrcweir } 820cdf0e10cSrcweir else if(mpDrawView) 821cdf0e10cSrcweir { 822cdf0e10cSrcweir mpDrawView->DoPaste(); 823cdf0e10cSrcweir } 824cdf0e10cSrcweir 825cdf0e10cSrcweir rReq.Ignore (); 826cdf0e10cSrcweir } 827cdf0e10cSrcweir break; 828cdf0e10cSrcweir 829cdf0e10cSrcweir case SID_CLIPBOARD_FORMAT_ITEMS: 830cdf0e10cSrcweir { 831cdf0e10cSrcweir WaitObject aWait( (Window*)GetActiveWindow() ); 832cdf0e10cSrcweir TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) ); 833cdf0e10cSrcweir const SfxItemSet* pReqArgs = rReq.GetArgs(); 834cdf0e10cSrcweir sal_uInt32 nFormat = 0; 835cdf0e10cSrcweir 836cdf0e10cSrcweir if( pReqArgs ) 837cdf0e10cSrcweir { 838cdf0e10cSrcweir SFX_REQUEST_ARG( rReq, pIsActive, SfxUInt32Item, SID_CLIPBOARD_FORMAT_ITEMS, sal_False ); 839cdf0e10cSrcweir nFormat = pIsActive->GetValue(); 840cdf0e10cSrcweir } 841cdf0e10cSrcweir 842cdf0e10cSrcweir 843cdf0e10cSrcweir if( nFormat && aDataHelper.GetTransferable().is() ) 844cdf0e10cSrcweir { 845cdf0e10cSrcweir sal_Int8 nAction = DND_ACTION_COPY; 846cdf0e10cSrcweir 847cdf0e10cSrcweir if( !mpDrawView->InsertData( aDataHelper, 848cdf0e10cSrcweir GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ), 849cdf0e10cSrcweir nAction, sal_False, nFormat ) ) 850cdf0e10cSrcweir { 851cdf0e10cSrcweir INetBookmark aINetBookmark( aEmptyStr, aEmptyStr ); 852cdf0e10cSrcweir 853cdf0e10cSrcweir if( ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) && 854cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) ) || 855cdf0e10cSrcweir ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) && 856cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, aINetBookmark ) ) || 857cdf0e10cSrcweir ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) && 858cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) ) 859cdf0e10cSrcweir { 860cdf0e10cSrcweir InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL ); 861cdf0e10cSrcweir } 862cdf0e10cSrcweir } 863cdf0e10cSrcweir } 864cdf0e10cSrcweir } 865cdf0e10cSrcweir break; 866cdf0e10cSrcweir 867cdf0e10cSrcweir case SID_DELETE: 868cdf0e10cSrcweir { 869cdf0e10cSrcweir if ( mpDrawView->IsTextEdit() ) 870cdf0e10cSrcweir { 871cdf0e10cSrcweir OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView(); 872cdf0e10cSrcweir 873cdf0e10cSrcweir if (pOLV) 874cdf0e10cSrcweir { 875cdf0e10cSrcweir KeyCode aKCode(KEY_DELETE); 876cdf0e10cSrcweir KeyEvent aKEvt( 0, aKCode); 877cdf0e10cSrcweir pOLV->PostKeyEvent(aKEvt); 878cdf0e10cSrcweir } 879cdf0e10cSrcweir } 880cdf0e10cSrcweir else if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) ) 881cdf0e10cSrcweir { 882cdf0e10cSrcweir ::sd::Window* pWindow = GetActiveWindow(); 883cdf0e10cSrcweir InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute(); 884cdf0e10cSrcweir } 885cdf0e10cSrcweir else 886cdf0e10cSrcweir { 887cdf0e10cSrcweir KeyCode aKCode(KEY_DELETE); 888cdf0e10cSrcweir KeyEvent aKEvt( 0, aKCode); 889cdf0e10cSrcweir 890cdf0e10cSrcweir bool bConsumed = mpDrawView && mpDrawView->getSmartTags().KeyInput( aKEvt ); 891cdf0e10cSrcweir 892cdf0e10cSrcweir if( !bConsumed && HasCurrentFunction() ) 893cdf0e10cSrcweir bConsumed = GetCurrentFunction()->KeyInput(aKEvt); 894cdf0e10cSrcweir 895cdf0e10cSrcweir if( !bConsumed && mpDrawView ) 896cdf0e10cSrcweir mpDrawView->DeleteMarked(); 897cdf0e10cSrcweir } 898cdf0e10cSrcweir rReq.Ignore (); 899cdf0e10cSrcweir } 900cdf0e10cSrcweir break; 901cdf0e10cSrcweir 902cdf0e10cSrcweir case SID_NOTESMODE: 903cdf0e10cSrcweir case SID_HANDOUTMODE: 904cdf0e10cSrcweir // AutoLayouts have to be ready. 905cdf0e10cSrcweir GetDoc()->StopWorkStartupDelay(); 906cdf0e10cSrcweir // Fall through to following case statements. 907cdf0e10cSrcweir 908cdf0e10cSrcweir case SID_DRAWINGMODE: 909cdf0e10cSrcweir case SID_DIAMODE: 910cdf0e10cSrcweir case SID_OUTLINEMODE: 911cdf0e10cSrcweir // Let the sub-shell manager handle the slot handling. 912cdf0e10cSrcweir framework::FrameworkHelper::Instance(GetViewShellBase())->HandleModeChangeSlot( 913cdf0e10cSrcweir nSId, 914cdf0e10cSrcweir rReq); 915cdf0e10cSrcweir rReq.Ignore (); 916cdf0e10cSrcweir break; 917cdf0e10cSrcweir 918cdf0e10cSrcweir case SID_MASTERPAGE: // BASIC 919cdf0e10cSrcweir case SID_SLIDE_MASTERPAGE: // BASIC 920cdf0e10cSrcweir case SID_TITLE_MASTERPAGE: // BASIC 921cdf0e10cSrcweir case SID_NOTES_MASTERPAGE: // BASIC 922cdf0e10cSrcweir case SID_HANDOUT_MASTERPAGE: // BASIC 923cdf0e10cSrcweir { 924cdf0e10cSrcweir // AutoLayouts muessen fertig sein 925cdf0e10cSrcweir GetDoc()->StopWorkStartupDelay(); 926cdf0e10cSrcweir 927cdf0e10cSrcweir const SfxItemSet* pReqArgs = rReq.GetArgs(); 928cdf0e10cSrcweir 929cdf0e10cSrcweir if ( pReqArgs ) 930cdf0e10cSrcweir { 931cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_MASTERPAGE, sal_False); 932cdf0e10cSrcweir mbIsLayerModeActive = pIsActive->GetValue (); 933cdf0e10cSrcweir } 934cdf0e10cSrcweir 935cdf0e10cSrcweir Broadcast ( 936cdf0e10cSrcweir ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START)); 937cdf0e10cSrcweir 938cdf0e10cSrcweir if (nSId == SID_MASTERPAGE || 939cdf0e10cSrcweir (nSId == SID_SLIDE_MASTERPAGE && mePageKind == PK_STANDARD) || 940cdf0e10cSrcweir (nSId == SID_TITLE_MASTERPAGE && mePageKind == PK_STANDARD) || 941cdf0e10cSrcweir (nSId == SID_NOTES_MASTERPAGE && mePageKind == PK_NOTES) || 942cdf0e10cSrcweir (nSId == SID_HANDOUT_MASTERPAGE && mePageKind == PK_HANDOUT)) 943cdf0e10cSrcweir { 944cdf0e10cSrcweir if (nSId == SID_TITLE_MASTERPAGE || 945cdf0e10cSrcweir nSId == SID_SLIDE_MASTERPAGE) 946cdf0e10cSrcweir { 947cdf0e10cSrcweir // Gibt es eine Seite mit dem AutoLayout "Titel"? 948cdf0e10cSrcweir sal_Bool bFound = sal_False; 949cdf0e10cSrcweir sal_uInt16 i = 0; 950cdf0e10cSrcweir sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD); 951cdf0e10cSrcweir 952cdf0e10cSrcweir while (i < nCount && !bFound) 953cdf0e10cSrcweir { 954cdf0e10cSrcweir SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD); 955cdf0e10cSrcweir 956cdf0e10cSrcweir if (nSId == SID_TITLE_MASTERPAGE && pPage->GetAutoLayout() == AUTOLAYOUT_TITLE) 957cdf0e10cSrcweir { 958cdf0e10cSrcweir bFound = sal_True; 959cdf0e10cSrcweir SwitchPage((pPage->GetPageNum() - 1) / 2); 960cdf0e10cSrcweir } 961cdf0e10cSrcweir else if (nSId == SID_SLIDE_MASTERPAGE && pPage->GetAutoLayout() != AUTOLAYOUT_TITLE) 962cdf0e10cSrcweir { 963cdf0e10cSrcweir bFound = sal_True; 964cdf0e10cSrcweir SwitchPage((pPage->GetPageNum() - 1) / 2); 965cdf0e10cSrcweir } 966cdf0e10cSrcweir 967cdf0e10cSrcweir i++; 968cdf0e10cSrcweir } 969cdf0e10cSrcweir } 970cdf0e10cSrcweir 971cdf0e10cSrcweir // Default-Layer der MasterPage einschalten 972cdf0e10cSrcweir mpDrawView->SetActiveLayer( String( SdResId(STR_LAYER_BCKGRNDOBJ) ) ); 973cdf0e10cSrcweir 974cdf0e10cSrcweir ChangeEditMode(EM_MASTERPAGE, mbIsLayerModeActive); 975cdf0e10cSrcweir 976cdf0e10cSrcweir if(HasCurrentFunction(SID_BEZIER_EDIT)) 977cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); 978cdf0e10cSrcweir } 979cdf0e10cSrcweir else 980cdf0e10cSrcweir { 981cdf0e10cSrcweir // Switch to requested ViewShell. 982cdf0e10cSrcweir ::OUString sRequestedView; 983cdf0e10cSrcweir PageKind ePageKind; 984cdf0e10cSrcweir switch (nSId) 985cdf0e10cSrcweir { 986cdf0e10cSrcweir case SID_SLIDE_MASTERPAGE: 987cdf0e10cSrcweir case SID_TITLE_MASTERPAGE: 988cdf0e10cSrcweir default: 989cdf0e10cSrcweir sRequestedView = framework::FrameworkHelper::msImpressViewURL; 990cdf0e10cSrcweir ePageKind = PK_STANDARD; 991cdf0e10cSrcweir break; 992cdf0e10cSrcweir 993cdf0e10cSrcweir case SID_NOTES_MASTERPAGE: 994cdf0e10cSrcweir sRequestedView = framework::FrameworkHelper::msNotesViewURL; 995cdf0e10cSrcweir ePageKind = PK_NOTES; 996cdf0e10cSrcweir break; 997cdf0e10cSrcweir 998cdf0e10cSrcweir case SID_HANDOUT_MASTERPAGE: 999cdf0e10cSrcweir sRequestedView = framework::FrameworkHelper::msHandoutViewURL; 1000cdf0e10cSrcweir ePageKind = PK_HANDOUT; 1001cdf0e10cSrcweir break; 1002cdf0e10cSrcweir } 1003cdf0e10cSrcweir 1004cdf0e10cSrcweir mpFrameView->SetViewShEditMode(EM_MASTERPAGE, ePageKind); 1005cdf0e10cSrcweir mpFrameView->SetLayerMode(mbIsLayerModeActive); 1006cdf0e10cSrcweir framework::FrameworkHelper::Instance(GetViewShellBase())->RequestView( 1007cdf0e10cSrcweir sRequestedView, 1008cdf0e10cSrcweir framework::FrameworkHelper::msCenterPaneURL); 1009cdf0e10cSrcweir } 1010cdf0e10cSrcweir Broadcast ( 1011cdf0e10cSrcweir ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END)); 1012cdf0e10cSrcweir 1013cdf0e10cSrcweir InvalidateWindows(); 1014cdf0e10cSrcweir Invalidate(); 1015cdf0e10cSrcweir 1016cdf0e10cSrcweir rReq.Done(); 1017cdf0e10cSrcweir } 1018cdf0e10cSrcweir break; 1019cdf0e10cSrcweir 1020cdf0e10cSrcweir 1021cdf0e10cSrcweir case SID_CLOSE_MASTER_VIEW: 1022cdf0e10cSrcweir { 1023cdf0e10cSrcweir Broadcast ( 1024cdf0e10cSrcweir ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START)); 1025cdf0e10cSrcweir 1026cdf0e10cSrcweir // Switch page back to the first one. Not doing so leads to a 1027cdf0e10cSrcweir // crash. This seems to be some bug in the edit mode switching 1028cdf0e10cSrcweir // and page switching methods. 1029cdf0e10cSrcweir SwitchPage (0); 1030cdf0e10cSrcweir ChangeEditMode(EM_PAGE, IsLayerModeActive()); 1031cdf0e10cSrcweir Broadcast ( 1032cdf0e10cSrcweir ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END)); 1033cdf0e10cSrcweir 1034cdf0e10cSrcweir if(HasCurrentFunction(SID_BEZIER_EDIT)) 1035cdf0e10cSrcweir { 1036cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( 1037cdf0e10cSrcweir SID_OBJECT_SELECT, 1038cdf0e10cSrcweir SFX_CALLMODE_ASYNCHRON); 1039cdf0e10cSrcweir } 1040cdf0e10cSrcweir 1041cdf0e10cSrcweir 1042cdf0e10cSrcweir rReq.Done(); 1043cdf0e10cSrcweir } 1044cdf0e10cSrcweir break; 1045cdf0e10cSrcweir 1046cdf0e10cSrcweir 1047cdf0e10cSrcweir case SID_RULER: 1048cdf0e10cSrcweir { 1049cdf0e10cSrcweir const SfxItemSet* pReqArgs = rReq.GetArgs(); 1050cdf0e10cSrcweir 1051cdf0e10cSrcweir // #97516# Remember old ruler state 1052cdf0e10cSrcweir sal_Bool bOldHasRuler(HasRuler()); 1053cdf0e10cSrcweir 1054cdf0e10cSrcweir if ( pReqArgs ) 1055cdf0e10cSrcweir { 1056cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_RULER, sal_False); 1057cdf0e10cSrcweir SetRuler (pIsActive->GetValue ()); 1058cdf0e10cSrcweir } 1059cdf0e10cSrcweir else SetRuler (!HasRuler()); 1060cdf0e10cSrcweir 1061cdf0e10cSrcweir // #97516# Did ruler state change? Tell that to SdOptions, too. 1062cdf0e10cSrcweir sal_Bool bHasRuler(HasRuler()); 1063cdf0e10cSrcweir 1064cdf0e10cSrcweir if(bOldHasRuler != bHasRuler) 1065cdf0e10cSrcweir { 1066cdf0e10cSrcweir SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType()); 1067cdf0e10cSrcweir 1068cdf0e10cSrcweir if(pOptions && pOptions->IsRulerVisible() != bHasRuler) 1069cdf0e10cSrcweir { 1070cdf0e10cSrcweir pOptions->SetRulerVisible(bHasRuler); 1071cdf0e10cSrcweir } 1072cdf0e10cSrcweir } 1073cdf0e10cSrcweir 1074cdf0e10cSrcweir Invalidate (SID_RULER); 1075cdf0e10cSrcweir Resize(); 1076cdf0e10cSrcweir rReq.Done (); 1077cdf0e10cSrcweir } 1078cdf0e10cSrcweir break; 1079cdf0e10cSrcweir 1080cdf0e10cSrcweir case SID_SIZE_PAGE: 1081cdf0e10cSrcweir case SID_SIZE_PAGE_WIDTH: // BASIC 1082cdf0e10cSrcweir { 1083cdf0e10cSrcweir mbZoomOnPage = ( rReq.GetSlot() == SID_SIZE_PAGE ); 1084cdf0e10cSrcweir 1085cdf0e10cSrcweir SdrPageView* pPageView = mpDrawView->GetSdrPageView(); 1086cdf0e10cSrcweir 1087cdf0e10cSrcweir if ( pPageView ) 1088cdf0e10cSrcweir { 1089cdf0e10cSrcweir Point aPagePos(0, 0); // = pPageView->GetOffset(); 1090cdf0e10cSrcweir Size aPageSize = pPageView->GetPage()->GetSize(); 1091cdf0e10cSrcweir 1092cdf0e10cSrcweir aPagePos.X() += aPageSize.Width() / 2; 1093cdf0e10cSrcweir aPageSize.Width() = (long) (aPageSize.Width() * 1.03); 1094cdf0e10cSrcweir 1095cdf0e10cSrcweir if( rReq.GetSlot() == SID_SIZE_PAGE ) 1096cdf0e10cSrcweir { 1097cdf0e10cSrcweir aPagePos.Y() += aPageSize.Height() / 2; 1098cdf0e10cSrcweir aPageSize.Height() = (long) (aPageSize.Height() * 1.03); 1099cdf0e10cSrcweir aPagePos.Y() -= aPageSize.Height() / 2; 1100cdf0e10cSrcweir } 1101cdf0e10cSrcweir else 1102cdf0e10cSrcweir { 1103cdf0e10cSrcweir Point aPt = GetActiveWindow()->PixelToLogic( Point( 0, GetActiveWindow()->GetSizePixel().Height() / 2 ) ); 1104cdf0e10cSrcweir aPagePos.Y() += aPt.Y(); 1105cdf0e10cSrcweir aPageSize.Height() = 2; 1106cdf0e10cSrcweir } 1107cdf0e10cSrcweir 1108cdf0e10cSrcweir aPagePos.X() -= aPageSize.Width() / 2; 1109cdf0e10cSrcweir 1110cdf0e10cSrcweir SetZoomRect( Rectangle( aPagePos, aPageSize ) ); 1111cdf0e10cSrcweir 1112cdf0e10cSrcweir Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), 1113cdf0e10cSrcweir GetActiveWindow()->GetOutputSizePixel()) ); 1114cdf0e10cSrcweir mpZoomList->InsertZoomRect(aVisAreaWin); 1115cdf0e10cSrcweir } 1116cdf0e10cSrcweir Invalidate( SID_ZOOM_IN ); 1117cdf0e10cSrcweir Invalidate( SID_ZOOM_OUT ); 1118cdf0e10cSrcweir Invalidate( SID_ZOOM_PANNING ); 1119cdf0e10cSrcweir Invalidate( SID_ZOOM_TOOLBOX ); 1120cdf0e10cSrcweir rReq.Done (); 1121cdf0e10cSrcweir } 1122cdf0e10cSrcweir break; 1123cdf0e10cSrcweir 1124cdf0e10cSrcweir case SID_SIZE_REAL: // BASIC 1125cdf0e10cSrcweir { 1126cdf0e10cSrcweir mbZoomOnPage = sal_False; 1127cdf0e10cSrcweir SetZoom( 100 ); 1128cdf0e10cSrcweir Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), 1129cdf0e10cSrcweir GetActiveWindow()->GetOutputSizePixel()) ); 1130cdf0e10cSrcweir mpZoomList->InsertZoomRect(aVisAreaWin); 1131cdf0e10cSrcweir Invalidate( SID_ZOOM_IN ); 1132cdf0e10cSrcweir Invalidate( SID_ZOOM_OUT ); 1133cdf0e10cSrcweir Invalidate( SID_ZOOM_PANNING ); 1134cdf0e10cSrcweir Invalidate( SID_ZOOM_TOOLBOX ); 1135cdf0e10cSrcweir rReq.Done (); 1136cdf0e10cSrcweir } 1137cdf0e10cSrcweir break; 1138cdf0e10cSrcweir 1139cdf0e10cSrcweir case SID_ZOOM_IN: // BASIC 1140cdf0e10cSrcweir { 1141cdf0e10cSrcweir mbZoomOnPage = sal_False; 1142cdf0e10cSrcweir SetZoom( Max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) ); 1143cdf0e10cSrcweir Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), 1144cdf0e10cSrcweir GetActiveWindow()->GetOutputSizePixel()) ); 1145cdf0e10cSrcweir mpZoomList->InsertZoomRect(aVisAreaWin); 1146cdf0e10cSrcweir Invalidate( SID_ZOOM_IN ); 1147cdf0e10cSrcweir Invalidate( SID_ZOOM_OUT ); 1148cdf0e10cSrcweir Invalidate( SID_ZOOM_PANNING ); 1149cdf0e10cSrcweir Invalidate( SID_ZOOM_TOOLBOX ); 1150cdf0e10cSrcweir rReq.Done (); 1151cdf0e10cSrcweir } 1152cdf0e10cSrcweir break; 1153cdf0e10cSrcweir 1154cdf0e10cSrcweir case SID_SIZE_VISAREA: 1155cdf0e10cSrcweir { 1156cdf0e10cSrcweir Rectangle aVisArea = mpFrameView->GetVisArea(); 1157cdf0e10cSrcweir Size aVisAreaSize = aVisArea.GetSize(); 1158cdf0e10cSrcweir 1159cdf0e10cSrcweir if (aVisAreaSize.Height()!=0 && aVisAreaSize.Width()!=0) 1160cdf0e10cSrcweir { 1161cdf0e10cSrcweir mbZoomOnPage = sal_False; 1162cdf0e10cSrcweir SetZoomRect(aVisArea); 1163cdf0e10cSrcweir Invalidate( SID_ZOOM_IN ); 1164cdf0e10cSrcweir Invalidate( SID_ZOOM_OUT ); 1165cdf0e10cSrcweir Invalidate( SID_ZOOM_PANNING ); 1166cdf0e10cSrcweir Invalidate( SID_ZOOM_TOOLBOX ); 1167cdf0e10cSrcweir } 1168cdf0e10cSrcweir rReq.Done (); 1169cdf0e10cSrcweir } 1170cdf0e10cSrcweir break; 1171cdf0e10cSrcweir 1172cdf0e10cSrcweir // Namensverwirrung: SID_SIZE_OPTIMAL -> Zoom auf selektierte Objekte 1173cdf0e10cSrcweir // --> Wird als Objektzoom im Programm angeboten 1174cdf0e10cSrcweir case SID_SIZE_OPTIMAL: // BASIC 1175cdf0e10cSrcweir { 1176cdf0e10cSrcweir mbZoomOnPage = sal_False; 1177cdf0e10cSrcweir if ( mpDrawView->AreObjectsMarked() ) 1178cdf0e10cSrcweir { 1179cdf0e10cSrcweir maMarkRect = mpDrawView->GetAllMarkedRect(); 1180cdf0e10cSrcweir long nW = (long) (maMarkRect.GetWidth() * 1.03); 1181cdf0e10cSrcweir long nH = (long) (maMarkRect.GetHeight() * 1.03); 1182cdf0e10cSrcweir Point aPos = maMarkRect.Center(); 1183cdf0e10cSrcweir aPos.X() -= nW / 2; 1184cdf0e10cSrcweir aPos.Y() -= nH / 2; 1185cdf0e10cSrcweir if ( nW && nH ) 1186cdf0e10cSrcweir { 1187cdf0e10cSrcweir SetZoomRect(Rectangle(aPos, Size(nW, nH))); 1188cdf0e10cSrcweir 1189cdf0e10cSrcweir Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), 1190cdf0e10cSrcweir GetActiveWindow()->GetOutputSizePixel()) ); 1191cdf0e10cSrcweir mpZoomList->InsertZoomRect(aVisAreaWin); 1192cdf0e10cSrcweir } 1193cdf0e10cSrcweir } 1194cdf0e10cSrcweir Invalidate( SID_ZOOM_IN ); 1195cdf0e10cSrcweir Invalidate( SID_ZOOM_OUT ); 1196cdf0e10cSrcweir Invalidate( SID_ZOOM_PANNING ); 1197cdf0e10cSrcweir Invalidate( SID_ZOOM_TOOLBOX ); 1198cdf0e10cSrcweir rReq.Done (); 1199cdf0e10cSrcweir } 1200cdf0e10cSrcweir break; 1201cdf0e10cSrcweir 1202cdf0e10cSrcweir // Namensverwirrung: SID_SIZE_ALL -> Zoom auf alle Objekte 1203cdf0e10cSrcweir // --> Wird als Optimal im Programm angeboten 1204cdf0e10cSrcweir case SID_SIZE_ALL: // BASIC 1205cdf0e10cSrcweir { 1206cdf0e10cSrcweir mbZoomOnPage = sal_False; 1207cdf0e10cSrcweir SdrPageView* pPageView = mpDrawView->GetSdrPageView(); 1208cdf0e10cSrcweir 1209cdf0e10cSrcweir if( pPageView ) 1210cdf0e10cSrcweir { 1211cdf0e10cSrcweir Rectangle aBoundRect( pPageView->GetObjList()->GetAllObjBoundRect() ); 1212cdf0e10cSrcweir 1213cdf0e10cSrcweir long nW = (long) (aBoundRect.GetWidth() * 1.03); 1214cdf0e10cSrcweir long nH = (long) (aBoundRect.GetHeight() * 1.03); 1215cdf0e10cSrcweir Point aPos = aBoundRect.Center(); 1216cdf0e10cSrcweir aPos.X() -= nW / 2; 1217cdf0e10cSrcweir aPos.Y() -= nH / 2; 1218cdf0e10cSrcweir if ( nW && nH ) 1219cdf0e10cSrcweir { 1220cdf0e10cSrcweir SetZoomRect( Rectangle( aPos, Size( nW, nH ) ) ); 1221cdf0e10cSrcweir 1222cdf0e10cSrcweir Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), 1223cdf0e10cSrcweir GetActiveWindow()->GetOutputSizePixel()) ); 1224cdf0e10cSrcweir mpZoomList->InsertZoomRect(aVisAreaWin); 1225cdf0e10cSrcweir } 1226cdf0e10cSrcweir 1227cdf0e10cSrcweir Invalidate( SID_ZOOM_IN ); 1228cdf0e10cSrcweir Invalidate( SID_ZOOM_OUT ); 1229cdf0e10cSrcweir Invalidate( SID_ZOOM_PANNING ); 1230cdf0e10cSrcweir Invalidate( SID_ZOOM_TOOLBOX ); 1231cdf0e10cSrcweir } 1232cdf0e10cSrcweir rReq.Done (); 1233cdf0e10cSrcweir } 1234cdf0e10cSrcweir break; 1235cdf0e10cSrcweir 1236cdf0e10cSrcweir case SID_ZOOM_PREV: 1237cdf0e10cSrcweir { 1238cdf0e10cSrcweir if (mpDrawView->IsTextEdit()) 1239cdf0e10cSrcweir { 1240cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 1241cdf0e10cSrcweir } 1242cdf0e10cSrcweir 1243cdf0e10cSrcweir if (mpZoomList->IsPreviousPossible()) 1244cdf0e10cSrcweir { 1245cdf0e10cSrcweir // Vorheriges ZoomRect einstellen 1246cdf0e10cSrcweir SetZoomRect(mpZoomList->GetPreviousZoomRect()); 1247cdf0e10cSrcweir } 1248cdf0e10cSrcweir rReq.Done (); 1249cdf0e10cSrcweir Invalidate( SID_ZOOM_TOOLBOX ); 1250cdf0e10cSrcweir } 1251cdf0e10cSrcweir break; 1252cdf0e10cSrcweir 1253cdf0e10cSrcweir case SID_ZOOM_NEXT: 1254cdf0e10cSrcweir { 1255cdf0e10cSrcweir if (mpDrawView->IsTextEdit()) 1256cdf0e10cSrcweir { 1257cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 1258cdf0e10cSrcweir } 1259cdf0e10cSrcweir 1260cdf0e10cSrcweir if (mpZoomList->IsNextPossible()) 1261cdf0e10cSrcweir { 1262cdf0e10cSrcweir // Naechstes ZoomRect einstellen 1263cdf0e10cSrcweir SetZoomRect(mpZoomList->GetNextZoomRect()); 1264cdf0e10cSrcweir } 1265cdf0e10cSrcweir rReq.Done (); 1266cdf0e10cSrcweir Invalidate( SID_ZOOM_TOOLBOX ); 1267cdf0e10cSrcweir } 1268cdf0e10cSrcweir break; 1269cdf0e10cSrcweir 1270cdf0e10cSrcweir case SID_GLUE_INSERT_POINT: 1271cdf0e10cSrcweir case SID_GLUE_PERCENT: 1272cdf0e10cSrcweir case SID_GLUE_ESCDIR: 1273cdf0e10cSrcweir case SID_GLUE_ESCDIR_LEFT: 1274cdf0e10cSrcweir case SID_GLUE_ESCDIR_RIGHT: 1275cdf0e10cSrcweir case SID_GLUE_ESCDIR_TOP: 1276cdf0e10cSrcweir case SID_GLUE_ESCDIR_BOTTOM: 1277cdf0e10cSrcweir case SID_GLUE_HORZALIGN_CENTER: 1278cdf0e10cSrcweir case SID_GLUE_HORZALIGN_LEFT: 1279cdf0e10cSrcweir case SID_GLUE_HORZALIGN_RIGHT: 1280cdf0e10cSrcweir case SID_GLUE_VERTALIGN_CENTER: 1281cdf0e10cSrcweir case SID_GLUE_VERTALIGN_TOP: 1282cdf0e10cSrcweir case SID_GLUE_VERTALIGN_BOTTOM: 1283cdf0e10cSrcweir { 1284cdf0e10cSrcweir FunctionReference xFunc( GetCurrentFunction() ); 1285cdf0e10cSrcweir FuEditGluePoints* pFunc = dynamic_cast< FuEditGluePoints* >( xFunc.get() ); 1286cdf0e10cSrcweir 1287cdf0e10cSrcweir if(pFunc) 1288cdf0e10cSrcweir pFunc->ReceiveRequest(rReq); 1289cdf0e10cSrcweir 1290cdf0e10cSrcweir rReq.Done(); 1291cdf0e10cSrcweir } 1292cdf0e10cSrcweir break; 1293cdf0e10cSrcweir 1294cdf0e10cSrcweir #ifdef DBG_UTIL 1295cdf0e10cSrcweir case SID_SHOW_ITEMBROWSER: 1296cdf0e10cSrcweir { 1297cdf0e10cSrcweir mpDrawView->ShowItemBrowser( !mpDrawView->IsItemBrowserVisible() ); 1298cdf0e10cSrcweir rReq.Done (); 1299cdf0e10cSrcweir } 1300cdf0e10cSrcweir break; 1301cdf0e10cSrcweir #endif 1302cdf0e10cSrcweir 1303cdf0e10cSrcweir case SID_AUTOSPELL_CHECK: 1304cdf0e10cSrcweir { 1305cdf0e10cSrcweir sal_Bool bOnlineSpell = !GetDoc()->GetOnlineSpell(); 1306cdf0e10cSrcweir GetDoc()->SetOnlineSpell(bOnlineSpell); 1307cdf0e10cSrcweir 1308cdf0e10cSrcweir ::Outliner* pOL = mpDrawView->GetTextEditOutliner(); 1309cdf0e10cSrcweir 1310cdf0e10cSrcweir if (pOL) 1311cdf0e10cSrcweir { 1312cdf0e10cSrcweir sal_uLong nCntrl = pOL->GetControlWord(); 1313cdf0e10cSrcweir 1314cdf0e10cSrcweir if (bOnlineSpell) 1315cdf0e10cSrcweir nCntrl |= EE_CNTRL_ONLINESPELLING; 1316cdf0e10cSrcweir else 1317cdf0e10cSrcweir nCntrl &= ~EE_CNTRL_ONLINESPELLING; 1318cdf0e10cSrcweir 1319cdf0e10cSrcweir pOL->SetControlWord(nCntrl); 1320cdf0e10cSrcweir } 1321cdf0e10cSrcweir 1322cdf0e10cSrcweir GetActiveWindow()->Invalidate(); 1323cdf0e10cSrcweir rReq.Done (); 1324cdf0e10cSrcweir } 1325cdf0e10cSrcweir break; 1326cdf0e10cSrcweir 1327cdf0e10cSrcweir case SID_CONVERT_TO_1BIT_THRESHOLD: 1328cdf0e10cSrcweir case SID_CONVERT_TO_1BIT_MATRIX: 1329cdf0e10cSrcweir case SID_CONVERT_TO_4BIT_GRAYS: 1330cdf0e10cSrcweir case SID_CONVERT_TO_4BIT_COLORS: 1331cdf0e10cSrcweir case SID_CONVERT_TO_8BIT_GRAYS: 1332cdf0e10cSrcweir case SID_CONVERT_TO_8BIT_COLORS: 1333cdf0e10cSrcweir case SID_CONVERT_TO_24BIT: 1334cdf0e10cSrcweir { 1335cdf0e10cSrcweir BmpConversion eBmpConvert = BMP_CONVERSION_NONE; 1336cdf0e10cSrcweir 1337cdf0e10cSrcweir switch( nSId ) 1338cdf0e10cSrcweir { 1339cdf0e10cSrcweir case SID_CONVERT_TO_1BIT_THRESHOLD: 1340cdf0e10cSrcweir eBmpConvert = BMP_CONVERSION_1BIT_THRESHOLD; 1341cdf0e10cSrcweir break; 1342cdf0e10cSrcweir 1343cdf0e10cSrcweir case SID_CONVERT_TO_1BIT_MATRIX: 1344cdf0e10cSrcweir eBmpConvert = BMP_CONVERSION_1BIT_MATRIX; 1345cdf0e10cSrcweir break; 1346cdf0e10cSrcweir 1347cdf0e10cSrcweir case SID_CONVERT_TO_4BIT_GRAYS: 1348cdf0e10cSrcweir eBmpConvert = BMP_CONVERSION_4BIT_GREYS; 1349cdf0e10cSrcweir break; 1350cdf0e10cSrcweir 1351cdf0e10cSrcweir case SID_CONVERT_TO_4BIT_COLORS: 1352cdf0e10cSrcweir eBmpConvert = BMP_CONVERSION_4BIT_COLORS; 1353cdf0e10cSrcweir break; 1354cdf0e10cSrcweir 1355cdf0e10cSrcweir case SID_CONVERT_TO_8BIT_GRAYS: 1356cdf0e10cSrcweir eBmpConvert = BMP_CONVERSION_8BIT_GREYS; 1357cdf0e10cSrcweir break; 1358cdf0e10cSrcweir 1359cdf0e10cSrcweir case SID_CONVERT_TO_8BIT_COLORS: 1360cdf0e10cSrcweir eBmpConvert = BMP_CONVERSION_8BIT_COLORS; 1361cdf0e10cSrcweir break; 1362cdf0e10cSrcweir 1363cdf0e10cSrcweir case SID_CONVERT_TO_24BIT: 1364cdf0e10cSrcweir eBmpConvert = BMP_CONVERSION_24BIT; 1365cdf0e10cSrcweir break; 1366cdf0e10cSrcweir } 1367cdf0e10cSrcweir 1368cdf0e10cSrcweir mpDrawView->BegUndo(String(SdResId(STR_UNDO_COLORRESOLUTION))); 1369cdf0e10cSrcweir const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); 1370cdf0e10cSrcweir 1371cdf0e10cSrcweir for (sal_uLong i=0; i<rMarkList.GetMarkCount(); i++) 1372cdf0e10cSrcweir { 1373cdf0e10cSrcweir SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); 1374cdf0e10cSrcweir 1375cdf0e10cSrcweir if (pObj->GetObjInventor() == SdrInventor) 1376cdf0e10cSrcweir { 1377cdf0e10cSrcweir if (pObj->GetObjIdentifier() == OBJ_GRAF && !((SdrGrafObj*) pObj)->IsLinkedGraphic()) 1378cdf0e10cSrcweir { 1379cdf0e10cSrcweir const Graphic& rGraphic = ((SdrGrafObj*) pObj)->GetGraphic(); 1380cdf0e10cSrcweir 1381cdf0e10cSrcweir if( rGraphic.GetType() == GRAPHIC_BITMAP ) 1382cdf0e10cSrcweir { 1383cdf0e10cSrcweir SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->Clone(); 1384cdf0e10cSrcweir 1385cdf0e10cSrcweir if( rGraphic.IsAnimated() ) 1386cdf0e10cSrcweir { 1387cdf0e10cSrcweir Animation aAnim( rGraphic.GetAnimation() ); 1388cdf0e10cSrcweir aAnim.Convert( eBmpConvert ); 1389cdf0e10cSrcweir pNewObj->SetGraphic( aAnim ); 1390cdf0e10cSrcweir } 1391cdf0e10cSrcweir else 1392cdf0e10cSrcweir { 1393cdf0e10cSrcweir BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); 1394cdf0e10cSrcweir aBmpEx.Convert( eBmpConvert ); 1395cdf0e10cSrcweir pNewObj->SetGraphic( aBmpEx ); 1396cdf0e10cSrcweir } 1397cdf0e10cSrcweir 1398cdf0e10cSrcweir mpDrawView->ReplaceObjectAtView( pObj, *mpDrawView->GetSdrPageView(), pNewObj ); 1399cdf0e10cSrcweir } 1400cdf0e10cSrcweir } 1401cdf0e10cSrcweir } 1402cdf0e10cSrcweir } 1403cdf0e10cSrcweir 1404cdf0e10cSrcweir mpDrawView->EndUndo(); 1405cdf0e10cSrcweir rReq.Done (); 1406cdf0e10cSrcweir } 1407cdf0e10cSrcweir break; 1408cdf0e10cSrcweir 1409cdf0e10cSrcweir case SID_TRANSLITERATE_SENTENCE_CASE: 1410cdf0e10cSrcweir case SID_TRANSLITERATE_TITLE_CASE: 1411cdf0e10cSrcweir case SID_TRANSLITERATE_TOGGLE_CASE: 1412cdf0e10cSrcweir case SID_TRANSLITERATE_UPPER: 1413cdf0e10cSrcweir case SID_TRANSLITERATE_LOWER: 1414cdf0e10cSrcweir case SID_TRANSLITERATE_HALFWIDTH: 1415cdf0e10cSrcweir case SID_TRANSLITERATE_FULLWIDTH: 1416cdf0e10cSrcweir case SID_TRANSLITERATE_HIRAGANA: 1417cdf0e10cSrcweir case SID_TRANSLITERATE_KATAGANA: 1418cdf0e10cSrcweir { 1419cdf0e10cSrcweir OutlinerView* pOLV = GetView()->GetTextEditOutlinerView(); 1420cdf0e10cSrcweir if( pOLV ) 1421cdf0e10cSrcweir { 1422cdf0e10cSrcweir using namespace ::com::sun::star::i18n; 1423cdf0e10cSrcweir sal_Int32 nType = 0; 1424cdf0e10cSrcweir 1425cdf0e10cSrcweir switch( nSId ) 1426cdf0e10cSrcweir { 1427cdf0e10cSrcweir case SID_TRANSLITERATE_SENTENCE_CASE: 1428cdf0e10cSrcweir nType = TransliterationModulesExtra::SENTENCE_CASE; 1429cdf0e10cSrcweir break; 1430cdf0e10cSrcweir case SID_TRANSLITERATE_TITLE_CASE: 1431cdf0e10cSrcweir nType = TransliterationModulesExtra::TITLE_CASE; 1432cdf0e10cSrcweir break; 1433cdf0e10cSrcweir case SID_TRANSLITERATE_TOGGLE_CASE: 1434cdf0e10cSrcweir nType = TransliterationModulesExtra::TOGGLE_CASE; 1435cdf0e10cSrcweir break; 1436cdf0e10cSrcweir case SID_TRANSLITERATE_UPPER: 1437cdf0e10cSrcweir nType = TransliterationModules_LOWERCASE_UPPERCASE; 1438cdf0e10cSrcweir break; 1439cdf0e10cSrcweir case SID_TRANSLITERATE_LOWER: 1440cdf0e10cSrcweir nType = TransliterationModules_UPPERCASE_LOWERCASE; 1441cdf0e10cSrcweir break; 1442cdf0e10cSrcweir case SID_TRANSLITERATE_HALFWIDTH: 1443cdf0e10cSrcweir nType = TransliterationModules_FULLWIDTH_HALFWIDTH; 1444cdf0e10cSrcweir break; 1445cdf0e10cSrcweir case SID_TRANSLITERATE_FULLWIDTH: 1446cdf0e10cSrcweir nType = TransliterationModules_HALFWIDTH_FULLWIDTH; 1447cdf0e10cSrcweir break; 1448cdf0e10cSrcweir case SID_TRANSLITERATE_HIRAGANA: 1449cdf0e10cSrcweir nType = TransliterationModules_KATAKANA_HIRAGANA; 1450cdf0e10cSrcweir break; 1451cdf0e10cSrcweir case SID_TRANSLITERATE_KATAGANA: 1452cdf0e10cSrcweir nType = TransliterationModules_HIRAGANA_KATAKANA; 1453cdf0e10cSrcweir break; 1454cdf0e10cSrcweir } 1455cdf0e10cSrcweir 1456cdf0e10cSrcweir pOLV->TransliterateText( nType ); 1457cdf0e10cSrcweir } 1458cdf0e10cSrcweir 1459cdf0e10cSrcweir rReq.Done(); 1460cdf0e10cSrcweir } 1461cdf0e10cSrcweir break; 1462cdf0e10cSrcweir 1463cdf0e10cSrcweir // #UndoRedo# 1464cdf0e10cSrcweir case SID_UNDO : 1465cdf0e10cSrcweir { 1466cdf0e10cSrcweir // #96090# moved implementation to BaseClass 1467cdf0e10cSrcweir ImpSidUndo(sal_True, rReq); 1468cdf0e10cSrcweir } 1469cdf0e10cSrcweir break; 1470cdf0e10cSrcweir case SID_REDO : 1471cdf0e10cSrcweir { 1472cdf0e10cSrcweir // #96090# moved implementation to BaseClass 1473cdf0e10cSrcweir ImpSidRedo(sal_True, rReq); 1474cdf0e10cSrcweir } 1475cdf0e10cSrcweir break; 1476cdf0e10cSrcweir 1477*597a4c59SAriel Constenla-Haile case SID_PRESENTATION_MINIMIZER: 1478*597a4c59SAriel Constenla-Haile { 1479*597a4c59SAriel Constenla-Haile if ( GetDoc()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS && 1480*597a4c59SAriel Constenla-Haile GetViewShellBase().GetController() != NULL ) 1481*597a4c59SAriel Constenla-Haile { 1482*597a4c59SAriel Constenla-Haile try 1483*597a4c59SAriel Constenla-Haile { 1484*597a4c59SAriel Constenla-Haile uno::Reference< uno::XComponentContext > xContext( 1485*597a4c59SAriel Constenla-Haile ::comphelper::getProcessComponentContext() ); 1486*597a4c59SAriel Constenla-Haile uno::Sequence< uno::Any > aArgs(1); 1487*597a4c59SAriel Constenla-Haile aArgs[0] <<= GetViewShellBase().GetController(); 1488*597a4c59SAriel Constenla-Haile 1489*597a4c59SAriel Constenla-Haile uno::Reference< XExecutableDialog > xDialog( 1490*597a4c59SAriel Constenla-Haile xContext->getServiceManager()-> 1491*597a4c59SAriel Constenla-Haile createInstanceWithArgumentsAndContext( 1492*597a4c59SAriel Constenla-Haile rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( 1493*597a4c59SAriel Constenla-Haile "com.sun.star.ui.dialogs.PresentationMinimizerDialog")), 1494*597a4c59SAriel Constenla-Haile aArgs, xContext), uno::UNO_QUERY_THROW ); 1495*597a4c59SAriel Constenla-Haile xDialog->execute(); 1496*597a4c59SAriel Constenla-Haile } 1497*597a4c59SAriel Constenla-Haile catch (...) 1498*597a4c59SAriel Constenla-Haile {} 1499*597a4c59SAriel Constenla-Haile } 1500*597a4c59SAriel Constenla-Haile 1501*597a4c59SAriel Constenla-Haile rReq.Done(); 1502*597a4c59SAriel Constenla-Haile } 1503*597a4c59SAriel Constenla-Haile break; 1504*597a4c59SAriel Constenla-Haile 1505cdf0e10cSrcweir default: 1506cdf0e10cSrcweir break; 1507cdf0e10cSrcweir } 1508cdf0e10cSrcweir } 1509cdf0e10cSrcweir 1510cdf0e10cSrcweir /************************************************************************* 1511cdf0e10cSrcweir |* 1512cdf0e10cSrcweir |* URL-Feld einfuegen 1513cdf0e10cSrcweir |* 1514cdf0e10cSrcweir \************************************************************************/ 1515cdf0e10cSrcweir 1516cdf0e10cSrcweir void DrawViewShell::InsertURLField(const String& rURL, const String& rText, 1517cdf0e10cSrcweir const String& rTarget, const Point* pPos) 1518cdf0e10cSrcweir { 1519cdf0e10cSrcweir OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView(); 1520cdf0e10cSrcweir 1521cdf0e10cSrcweir if (pOLV) 1522cdf0e10cSrcweir { 1523cdf0e10cSrcweir ESelection aSel( pOLV->GetSelection() ); 1524cdf0e10cSrcweir SvxFieldItem aURLItem( SvxURLField( rURL, rText, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD ); 1525cdf0e10cSrcweir pOLV->InsertField( aURLItem ); 1526cdf0e10cSrcweir if ( aSel.nStartPos <= aSel.nEndPos ) 1527cdf0e10cSrcweir aSel.nEndPos = aSel.nStartPos + 1; 1528cdf0e10cSrcweir else 1529cdf0e10cSrcweir aSel.nStartPos = aSel.nEndPos + 1; 1530cdf0e10cSrcweir pOLV->SetSelection( aSel ); 1531cdf0e10cSrcweir } 1532cdf0e10cSrcweir else 1533cdf0e10cSrcweir { 1534cdf0e10cSrcweir Outliner* pOutl = GetDoc()->GetInternalOutliner(); 1535cdf0e10cSrcweir pOutl->Init( OUTLINERMODE_TEXTOBJECT ); 1536cdf0e10cSrcweir sal_uInt16 nOutlMode = pOutl->GetMode(); 1537cdf0e10cSrcweir 1538cdf0e10cSrcweir SvxURLField aURLField(rURL, rText, SVXURLFORMAT_REPR); 1539cdf0e10cSrcweir aURLField.SetTargetFrame(rTarget); 1540cdf0e10cSrcweir SvxFieldItem aURLItem(aURLField, EE_FEATURE_FIELD); 1541cdf0e10cSrcweir pOutl->QuickInsertField( aURLItem, ESelection() ); 1542cdf0e10cSrcweir OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject(); 1543cdf0e10cSrcweir 1544cdf0e10cSrcweir SdrRectObj* pRectObj = new SdrRectObj(OBJ_TEXT); 1545cdf0e10cSrcweir 1546cdf0e10cSrcweir pOutl->UpdateFields(); 1547cdf0e10cSrcweir pOutl->SetUpdateMode( sal_True ); 1548cdf0e10cSrcweir Size aSize(pOutl->CalcTextSize()); 1549cdf0e10cSrcweir pOutl->SetUpdateMode( sal_False ); 1550cdf0e10cSrcweir 1551cdf0e10cSrcweir Point aPos; 1552cdf0e10cSrcweir 1553cdf0e10cSrcweir if (pPos) 1554cdf0e10cSrcweir { 1555cdf0e10cSrcweir aPos = *pPos; 1556cdf0e10cSrcweir } 1557cdf0e10cSrcweir else 1558cdf0e10cSrcweir { 1559cdf0e10cSrcweir Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() ); 1560cdf0e10cSrcweir aPos = aRect.Center(); 1561cdf0e10cSrcweir aPos = GetActiveWindow()->PixelToLogic(aPos); 1562cdf0e10cSrcweir aPos.X() -= aSize.Width() / 2; 1563cdf0e10cSrcweir aPos.Y() -= aSize.Height() / 2; 1564cdf0e10cSrcweir } 1565cdf0e10cSrcweir 1566cdf0e10cSrcweir Rectangle aLogicRect(aPos, aSize); 1567cdf0e10cSrcweir pRectObj->SetLogicRect(aLogicRect); 1568cdf0e10cSrcweir pRectObj->SetOutlinerParaObject( pOutlParaObject ); 1569cdf0e10cSrcweir mpDrawView->InsertObjectAtView(pRectObj, *mpDrawView->GetSdrPageView()); 1570cdf0e10cSrcweir pOutl->Init( nOutlMode ); 1571cdf0e10cSrcweir } 1572cdf0e10cSrcweir } 1573cdf0e10cSrcweir 1574cdf0e10cSrcweir /************************************************************************* 1575cdf0e10cSrcweir |* 1576cdf0e10cSrcweir |* URL-Button einfuegen 1577cdf0e10cSrcweir |* 1578cdf0e10cSrcweir \************************************************************************/ 1579cdf0e10cSrcweir 1580cdf0e10cSrcweir void DrawViewShell::InsertURLButton(const String& rURL, const String& rText, 1581cdf0e10cSrcweir const String& rTarget, const Point* pPos) 1582cdf0e10cSrcweir { 1583cdf0e10cSrcweir sal_Bool bNewObj = sal_True; 1584cdf0e10cSrcweir 1585cdf0e10cSrcweir const OUString sTargetURL( ::URIHelper::SmartRel2Abs( INetURLObject( GetDocSh()->GetMedium()->GetBaseURL() ), rURL, URIHelper::GetMaybeFileHdl(), true, false, 1586cdf0e10cSrcweir INetURLObject::WAS_ENCODED, 1587cdf0e10cSrcweir INetURLObject::DECODE_UNAMBIGUOUS ) ); 1588cdf0e10cSrcweir if (mpDrawView->GetMarkedObjectList().GetMarkCount() > 0) 1589cdf0e10cSrcweir { 1590cdf0e10cSrcweir SdrObject* pMarkedObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); 1591cdf0e10cSrcweir if( pMarkedObj ) try 1592cdf0e10cSrcweir { 1593cdf0e10cSrcweir // change first marked object 1594cdf0e10cSrcweir if( (FmFormInventor == pMarkedObj->GetObjInventor() && pMarkedObj->GetObjIdentifier() == OBJ_FM_BUTTON) ) 1595cdf0e10cSrcweir { 1596cdf0e10cSrcweir bNewObj = sal_False; 1597cdf0e10cSrcweir 1598cdf0e10cSrcweir SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pMarkedObj ); 1599cdf0e10cSrcweir 1600cdf0e10cSrcweir Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), UNO_QUERY_THROW ); 1601cdf0e10cSrcweir Reference< beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY_THROW ); 1602cdf0e10cSrcweir 1603cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), Any( OUString( rText ) ) ); 1604cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), Any( sTargetURL ) ); 1605cdf0e10cSrcweir 1606cdf0e10cSrcweir if( rTarget.Len() ) 1607cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), Any( OUString( rTarget ) ) ); 1608cdf0e10cSrcweir 1609cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), Any( form::FormButtonType_URL ) ); 1610cdf0e10cSrcweir if ( ::avmedia::MediaWindow::isMediaURL( rURL ) ) 1611cdf0e10cSrcweir { 1612cdf0e10cSrcweir // #105638# OJ 1613cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), Any( sal_True ) ); 1614cdf0e10cSrcweir } 1615cdf0e10cSrcweir } 1616cdf0e10cSrcweir else 1617cdf0e10cSrcweir { 1618cdf0e10cSrcweir // add url as interaction for first selected shape 1619cdf0e10cSrcweir bNewObj = sal_False; 1620cdf0e10cSrcweir 1621cdf0e10cSrcweir SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pMarkedObj, true); 1622cdf0e10cSrcweir pInfo->meClickAction = presentation::ClickAction_DOCUMENT; 1623cdf0e10cSrcweir pInfo->SetBookmark( sTargetURL ); 1624cdf0e10cSrcweir } 1625cdf0e10cSrcweir } 1626cdf0e10cSrcweir catch( uno::Exception& ) 1627cdf0e10cSrcweir { 1628cdf0e10cSrcweir } 1629cdf0e10cSrcweir } 1630cdf0e10cSrcweir 1631cdf0e10cSrcweir if (bNewObj) try 1632cdf0e10cSrcweir { 1633cdf0e10cSrcweir SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( SdrObjFactory::MakeNewObject(FmFormInventor, OBJ_FM_BUTTON, 1634cdf0e10cSrcweir mpDrawView->GetSdrPageView()->GetPage(), GetDoc()) ); 1635cdf0e10cSrcweir 1636cdf0e10cSrcweir Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), uno::UNO_QUERY_THROW ); 1637cdf0e10cSrcweir Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW ); 1638cdf0e10cSrcweir 1639cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), Any( OUString( rText ) ) ); 1640cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), Any( sTargetURL ) ); 1641cdf0e10cSrcweir 1642cdf0e10cSrcweir if( rTarget.Len() ) 1643cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), Any( OUString( rTarget ) ) ); 1644cdf0e10cSrcweir 1645cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), Any( form::FormButtonType_URL ) ); 1646cdf0e10cSrcweir // #105638# OJ 1647cdf0e10cSrcweir if ( ::avmedia::MediaWindow::isMediaURL( rURL ) ) 1648cdf0e10cSrcweir xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), Any( sal_True ) ); 1649cdf0e10cSrcweir 1650cdf0e10cSrcweir Point aPos; 1651cdf0e10cSrcweir 1652cdf0e10cSrcweir if (pPos) 1653cdf0e10cSrcweir { 1654cdf0e10cSrcweir aPos = *pPos; 1655cdf0e10cSrcweir } 1656cdf0e10cSrcweir else 1657cdf0e10cSrcweir { 1658cdf0e10cSrcweir aPos = Rectangle(aPos, GetActiveWindow()->GetOutputSizePixel()).Center(); 1659cdf0e10cSrcweir aPos = GetActiveWindow()->PixelToLogic(aPos); 1660cdf0e10cSrcweir } 1661cdf0e10cSrcweir 1662cdf0e10cSrcweir Size aSize(4000, 1000); 1663cdf0e10cSrcweir aPos.X() -= aSize.Width() / 2; 1664cdf0e10cSrcweir aPos.Y() -= aSize.Height() / 2; 1665cdf0e10cSrcweir pUnoCtrl->SetLogicRect(Rectangle(aPos, aSize)); 1666cdf0e10cSrcweir 1667cdf0e10cSrcweir sal_uLong nOptions = SDRINSERT_SETDEFLAYER; 1668cdf0e10cSrcweir 1669cdf0e10cSrcweir OSL_ASSERT (GetViewShell()!=NULL); 1670cdf0e10cSrcweir SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient(); 1671cdf0e10cSrcweir if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) 1672cdf0e10cSrcweir { 1673cdf0e10cSrcweir nOptions |= SDRINSERT_DONTMARK; 1674cdf0e10cSrcweir } 1675cdf0e10cSrcweir 1676cdf0e10cSrcweir mpDrawView->InsertObjectAtView(pUnoCtrl, *mpDrawView->GetSdrPageView(), nOptions); 1677cdf0e10cSrcweir } 1678cdf0e10cSrcweir catch( Exception& ) 1679cdf0e10cSrcweir { 1680cdf0e10cSrcweir } 1681cdf0e10cSrcweir } 1682cdf0e10cSrcweir 1683cdf0e10cSrcweir /************************************************************************* 1684cdf0e10cSrcweir |* 1685cdf0e10cSrcweir |* 1686cdf0e10cSrcweir |* 1687cdf0e10cSrcweir \************************************************************************/ 1688cdf0e10cSrcweir 1689cdf0e10cSrcweir void DrawViewShell::ShowUIControls (bool bVisible) 1690cdf0e10cSrcweir { 1691cdf0e10cSrcweir ViewShell::ShowUIControls (bVisible); 1692cdf0e10cSrcweir 1693cdf0e10cSrcweir //AF: The LayerDialogChildWindow is not used anymore (I hope). 1694cdf0e10cSrcweir // GetViewFrame()->SetChildWindow( 1695cdf0e10cSrcweir // LayerDialogChildWindow::GetChildWindowId(), 1696cdf0e10cSrcweir // IsLayerModeActive() && bVisible); 1697cdf0e10cSrcweir maTabControl.Show (bVisible); 1698cdf0e10cSrcweir } 1699cdf0e10cSrcweir 1700cdf0e10cSrcweir void DrawViewShell::StopSlideShow (bool /*bCloseFrame*/) 1701cdf0e10cSrcweir { 1702cdf0e10cSrcweir Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() ); 1703cdf0e10cSrcweir if(xPresentation.is() && xPresentation->isRunning()) 1704cdf0e10cSrcweir { 1705cdf0e10cSrcweir if( mpDrawView->IsTextEdit() ) 1706cdf0e10cSrcweir mpDrawView->SdrEndTextEdit(); 1707cdf0e10cSrcweir 1708cdf0e10cSrcweir xPresentation->end(); 1709cdf0e10cSrcweir } 1710cdf0e10cSrcweir } 1711cdf0e10cSrcweir 1712cdf0e10cSrcweir #ifdef _MSC_VER 1713cdf0e10cSrcweir #pragma optimize ( "", on ) 1714cdf0e10cSrcweir #endif 1715cdf0e10cSrcweir 1716cdf0e10cSrcweir } // end of namespace sd 1717