1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_sd.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <svl/lckbitem.hxx> 32*cdf0e10cSrcweir #include <sfx2/frame.hxx> 33*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx> 34*cdf0e10cSrcweir #include <unotools/moduleoptions.hxx> 35*cdf0e10cSrcweir #include "framework/FrameworkHelper.hxx" 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir #include <svx/dialogs.hrc> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir #include <editeng/langitem.hxx> 40*cdf0e10cSrcweir #include <editeng/editdata.hxx> 41*cdf0e10cSrcweir #include <vcl/msgbox.hxx> 42*cdf0e10cSrcweir #include <editeng/svxenum.hxx> 43*cdf0e10cSrcweir #include <sfx2/dispatch.hxx> 44*cdf0e10cSrcweir #include <sfx2/request.hxx> 45*cdf0e10cSrcweir #include <sfx2/printer.hxx> 46*cdf0e10cSrcweir #include <sfx2/docfile.hxx> 47*cdf0e10cSrcweir #include <editeng/paperinf.hxx> 48*cdf0e10cSrcweir #include <editeng/eeitem.hxx> 49*cdf0e10cSrcweir #include <unotools/useroptions.hxx> 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir #include "app.hrc" 52*cdf0e10cSrcweir #include "glob.hrc" 53*cdf0e10cSrcweir #include "strings.hrc" 54*cdf0e10cSrcweir #include "res_bmp.hrc" 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir #define _SD_DLL // fuer SD_MOD() 57*cdf0e10cSrcweir #include "sdmod.hxx" 58*cdf0e10cSrcweir #include "sddll.hxx" 59*cdf0e10cSrcweir #include "pres.hxx" 60*cdf0e10cSrcweir #include "optsitem.hxx" 61*cdf0e10cSrcweir #include "ViewShell.hxx" 62*cdf0e10cSrcweir #include "sdattr.hxx" 63*cdf0e10cSrcweir #include "sdpage.hxx" 64*cdf0e10cSrcweir #include "DrawDocShell.hxx" 65*cdf0e10cSrcweir #include "drawdoc.hxx" 66*cdf0e10cSrcweir #include "assclass.hxx" 67*cdf0e10cSrcweir #include "sdenumdef.hxx" 68*cdf0e10cSrcweir #include "sdresid.hxx" 69*cdf0e10cSrcweir #include "OutlineViewShell.hxx" 70*cdf0e10cSrcweir #include "ViewShellBase.hxx" 71*cdf0e10cSrcweir #ifndef SD_FRAMW_VIEW_HXX 72*cdf0e10cSrcweir #include "FrameView.hxx" 73*cdf0e10cSrcweir #endif 74*cdf0e10cSrcweir #include "FactoryIds.hxx" 75*cdf0e10cSrcweir #include "sdabstdlg.hxx" 76*cdf0e10cSrcweir #include <memory> 77*cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 78*cdf0e10cSrcweir #include <boost/scoped_array.hpp> 79*cdf0e10cSrcweir #include "slideshow.hxx" 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> 82*cdf0e10cSrcweir #include <com/sun/star/document/XDocumentProperties.hpp> 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir using ::sd::framework::FrameworkHelper; 86*cdf0e10cSrcweir using ::com::sun::star::uno::Reference; 87*cdf0e10cSrcweir using ::com::sun::star::frame::XFrame; 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir namespace { 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir class OutlineToImpressFinalizer 92*cdf0e10cSrcweir { 93*cdf0e10cSrcweir public: 94*cdf0e10cSrcweir OutlineToImpressFinalizer ( 95*cdf0e10cSrcweir ::sd::ViewShellBase& rBase, 96*cdf0e10cSrcweir SdDrawDocument& rDocument, 97*cdf0e10cSrcweir SvLockBytes& rBytes); 98*cdf0e10cSrcweir virtual ~OutlineToImpressFinalizer (void) {}; 99*cdf0e10cSrcweir void operator() (bool bEventSeen); 100*cdf0e10cSrcweir private: 101*cdf0e10cSrcweir ::sd::ViewShellBase& mrBase; 102*cdf0e10cSrcweir SdDrawDocument& mrDocument; 103*cdf0e10cSrcweir ::boost::shared_ptr<SvMemoryStream> mpStream; 104*cdf0e10cSrcweir }; 105*cdf0e10cSrcweir 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir } //end of anonymous namespace 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir /************************************************************************* 111*cdf0e10cSrcweir |* 112*cdf0e10cSrcweir |* Execute 113*cdf0e10cSrcweir |* 114*cdf0e10cSrcweir \************************************************************************/ 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir void SdModule::Execute(SfxRequest& rReq) 117*cdf0e10cSrcweir { 118*cdf0e10cSrcweir const SfxItemSet* pSet = rReq.GetArgs(); 119*cdf0e10cSrcweir sal_uLong nSlotId = rReq.GetSlot(); 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir switch ( nSlotId ) 122*cdf0e10cSrcweir { 123*cdf0e10cSrcweir case SID_NEWDOC: 124*cdf0e10cSrcweir { 125*cdf0e10cSrcweir SFX_APP()->ExecuteSlot(rReq, SFX_APP()->GetInterface()); 126*cdf0e10cSrcweir } 127*cdf0e10cSrcweir break; 128*cdf0e10cSrcweir 129*cdf0e10cSrcweir case SID_AUTOSPELL_CHECK: 130*cdf0e10cSrcweir { 131*cdf0e10cSrcweir // automatische Rechtschreibpruefung 132*cdf0e10cSrcweir const SfxPoolItem* pItem; 133*cdf0e10cSrcweir if( pSet && SFX_ITEM_SET == pSet->GetItemState( 134*cdf0e10cSrcweir SID_AUTOSPELL_CHECK, sal_False, &pItem ) ) 135*cdf0e10cSrcweir { 136*cdf0e10cSrcweir sal_Bool bOnlineSpelling = ( (const SfxBoolItem*) pItem )->GetValue(); 137*cdf0e10cSrcweir // am Dokument sichern: 138*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 139*cdf0e10cSrcweir if( pDocSh ) 140*cdf0e10cSrcweir { 141*cdf0e10cSrcweir SdDrawDocument* pDoc = pDocSh->GetDoc(); 142*cdf0e10cSrcweir pDoc->SetOnlineSpell( bOnlineSpelling ); 143*cdf0e10cSrcweir } 144*cdf0e10cSrcweir } 145*cdf0e10cSrcweir } 146*cdf0e10cSrcweir break; 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir case SID_ATTR_METRIC: 149*cdf0e10cSrcweir { 150*cdf0e10cSrcweir const SfxPoolItem* pItem; 151*cdf0e10cSrcweir if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_ATTR_METRIC, sal_True, &pItem ) ) 152*cdf0e10cSrcweir { 153*cdf0e10cSrcweir FieldUnit eUnit = (FieldUnit)((const SfxUInt16Item*)pItem)->GetValue(); 154*cdf0e10cSrcweir switch( eUnit ) 155*cdf0e10cSrcweir { 156*cdf0e10cSrcweir case FUNIT_MM: // nur die Einheiten, die auch im Dialog stehen 157*cdf0e10cSrcweir case FUNIT_CM: 158*cdf0e10cSrcweir case FUNIT_INCH: 159*cdf0e10cSrcweir case FUNIT_PICA: 160*cdf0e10cSrcweir case FUNIT_POINT: 161*cdf0e10cSrcweir { 162*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); 163*cdf0e10cSrcweir if(pDocSh) 164*cdf0e10cSrcweir { 165*cdf0e10cSrcweir DocumentType eDocType = pDocSh->GetDoc()->GetDocumentType(); 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir PutItem( *pItem ); 168*cdf0e10cSrcweir SdOptions* pOptions = GetSdOptions( eDocType ); 169*cdf0e10cSrcweir if(pOptions) 170*cdf0e10cSrcweir pOptions->SetMetric( (sal_uInt16)eUnit ); 171*cdf0e10cSrcweir rReq.Done(); 172*cdf0e10cSrcweir } 173*cdf0e10cSrcweir } 174*cdf0e10cSrcweir break; 175*cdf0e10cSrcweir default: 176*cdf0e10cSrcweir break; 177*cdf0e10cSrcweir } 178*cdf0e10cSrcweir } 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir } 181*cdf0e10cSrcweir break; 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir case SID_ATTR_LANGUAGE: 184*cdf0e10cSrcweir case SID_ATTR_CHAR_CJK_LANGUAGE: 185*cdf0e10cSrcweir case SID_ATTR_CHAR_CTL_LANGUAGE: 186*cdf0e10cSrcweir { 187*cdf0e10cSrcweir const SfxPoolItem* pItem; 188*cdf0e10cSrcweir if( pSet && 189*cdf0e10cSrcweir ( 190*cdf0e10cSrcweir SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_LANGUAGE, sal_False, &pItem ) || 191*cdf0e10cSrcweir SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, sal_False, &pItem ) || 192*cdf0e10cSrcweir SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, sal_False, &pItem ) 193*cdf0e10cSrcweir ) 194*cdf0e10cSrcweir ) 195*cdf0e10cSrcweir { 196*cdf0e10cSrcweir // am Dokument sichern: 197*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 198*cdf0e10cSrcweir if ( pDocSh ) 199*cdf0e10cSrcweir { 200*cdf0e10cSrcweir LanguageType eLanguage = ( (SvxLanguageItem*)pItem )->GetValue(); 201*cdf0e10cSrcweir SdDrawDocument* pDoc = pDocSh->GetDoc(); 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir if( nSlotId == SID_ATTR_CHAR_CJK_LANGUAGE ) 204*cdf0e10cSrcweir pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE_CJK ); 205*cdf0e10cSrcweir else if( nSlotId == SID_ATTR_CHAR_CTL_LANGUAGE ) 206*cdf0e10cSrcweir pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE_CTL ); 207*cdf0e10cSrcweir else 208*cdf0e10cSrcweir pDoc->SetLanguage( eLanguage, EE_CHAR_LANGUAGE ); 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir if( pDoc->GetOnlineSpell() ) 211*cdf0e10cSrcweir { 212*cdf0e10cSrcweir pDoc->StopOnlineSpelling(); 213*cdf0e10cSrcweir pDoc->StartOnlineSpelling(); 214*cdf0e10cSrcweir } 215*cdf0e10cSrcweir } 216*cdf0e10cSrcweir } 217*cdf0e10cSrcweir } 218*cdf0e10cSrcweir break; 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir case SID_SD_AUTOPILOT: 221*cdf0e10cSrcweir case SID_NEWSD: 222*cdf0e10cSrcweir { 223*cdf0e10cSrcweir SfxFrame* pFrame = ExecuteNewDocument( rReq ); 224*cdf0e10cSrcweir // #94442# if a frame was created, set it as return value 225*cdf0e10cSrcweir if(pFrame) 226*cdf0e10cSrcweir rReq.SetReturnValue(SfxFrameItem(0, pFrame)); 227*cdf0e10cSrcweir } 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir break; 230*cdf0e10cSrcweir 231*cdf0e10cSrcweir case SID_OPENHYPERLINK: 232*cdf0e10cSrcweir case SID_OPENDOC: 233*cdf0e10cSrcweir { 234*cdf0e10cSrcweir sal_Bool bIntercept = sal_False; 235*cdf0e10cSrcweir ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 236*cdf0e10cSrcweir if (pDocShell) 237*cdf0e10cSrcweir { 238*cdf0e10cSrcweir ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); 239*cdf0e10cSrcweir if (pViewShell) 240*cdf0e10cSrcweir { 241*cdf0e10cSrcweir if( sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) ) 242*cdf0e10cSrcweir { 243*cdf0e10cSrcweir // Prevent documents from opening while the slide 244*cdf0e10cSrcweir // show is running, except when this request comes 245*cdf0e10cSrcweir // from a shape interaction. 246*cdf0e10cSrcweir if (rReq.GetArgs() == NULL) 247*cdf0e10cSrcweir { 248*cdf0e10cSrcweir bIntercept = sal_True; 249*cdf0e10cSrcweir } 250*cdf0e10cSrcweir } 251*cdf0e10cSrcweir } 252*cdf0e10cSrcweir } 253*cdf0e10cSrcweir 254*cdf0e10cSrcweir if (!bIntercept) 255*cdf0e10cSrcweir { 256*cdf0e10cSrcweir SFX_APP()->ExecuteSlot(rReq, SFX_APP()->GetInterface()); 257*cdf0e10cSrcweir } 258*cdf0e10cSrcweir else 259*cdf0e10cSrcweir { 260*cdf0e10cSrcweir ErrorBox(NULL, WB_OK, String(SdResId(STR_CANT_PERFORM_IN_LIVEMODE))).Execute(); 261*cdf0e10cSrcweir 262*cdf0e10cSrcweir SFX_REQUEST_ARG( rReq, pLinkItem, SfxLinkItem, SID_DONELINK, sal_False ); 263*cdf0e10cSrcweir if( pLinkItem ) 264*cdf0e10cSrcweir pLinkItem->GetValue().Call( 0 ); 265*cdf0e10cSrcweir } 266*cdf0e10cSrcweir } 267*cdf0e10cSrcweir break; 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir case SID_OUTLINE_TO_IMPRESS: 270*cdf0e10cSrcweir OutlineToImpress (rReq); 271*cdf0e10cSrcweir break; 272*cdf0e10cSrcweir 273*cdf0e10cSrcweir default: 274*cdf0e10cSrcweir break; 275*cdf0e10cSrcweir } 276*cdf0e10cSrcweir } 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir 281*cdf0e10cSrcweir void SdModule::OutlineToImpress (SfxRequest& rRequest) 282*cdf0e10cSrcweir { 283*cdf0e10cSrcweir const SfxItemSet* pSet = rRequest.GetArgs(); 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir if (pSet) 286*cdf0e10cSrcweir { 287*cdf0e10cSrcweir SvLockBytes* pBytes = ((SfxLockBytesItem&) pSet->Get(SID_OUTLINE_TO_IMPRESS)).GetValue(); 288*cdf0e10cSrcweir 289*cdf0e10cSrcweir if (pBytes) 290*cdf0e10cSrcweir { 291*cdf0e10cSrcweir SfxObjectShellLock xDocShell; 292*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh; 293*cdf0e10cSrcweir xDocShell = pDocSh = new ::sd::DrawDocShell( 294*cdf0e10cSrcweir SFX_CREATE_MODE_STANDARD, sal_False); 295*cdf0e10cSrcweir if(pDocSh) 296*cdf0e10cSrcweir { 297*cdf0e10cSrcweir pDocSh->DoInitNew(NULL); 298*cdf0e10cSrcweir SdDrawDocument* pDoc = pDocSh->GetDoc(); 299*cdf0e10cSrcweir if(pDoc) 300*cdf0e10cSrcweir { 301*cdf0e10cSrcweir pDoc->CreateFirstPages(); 302*cdf0e10cSrcweir pDoc->StopWorkStartupDelay(); 303*cdf0e10cSrcweir } 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir SFX_REQUEST_ARG( rRequest, pFrmItem, SfxFrameItem, SID_DOCFRAME, sal_False); 306*cdf0e10cSrcweir SfxViewFrame::LoadDocumentIntoFrame( *pDocSh, pFrmItem, ::sd::OUTLINE_FACTORY_ID ); 307*cdf0e10cSrcweir 308*cdf0e10cSrcweir ::sd::ViewShell* pViewSh = pDocSh->GetViewShell(); 309*cdf0e10cSrcweir 310*cdf0e10cSrcweir if (pViewSh) 311*cdf0e10cSrcweir { 312*cdf0e10cSrcweir // AutoLayouts muessen fertig sein 313*cdf0e10cSrcweir pDoc->StopWorkStartupDelay(); 314*cdf0e10cSrcweir 315*cdf0e10cSrcweir SfxViewFrame* pViewFrame = pViewSh->GetViewFrame(); 316*cdf0e10cSrcweir 317*cdf0e10cSrcweir // When the view frame has not been just created we have 318*cdf0e10cSrcweir // to switch synchronously to the outline view. 319*cdf0e10cSrcweir // (Otherwise the request will be ignored anyway.) 320*cdf0e10cSrcweir ::sd::ViewShellBase* pBase 321*cdf0e10cSrcweir = dynamic_cast< ::sd::ViewShellBase*>(pViewFrame->GetViewShell()); 322*cdf0e10cSrcweir if (pBase != NULL) 323*cdf0e10cSrcweir { 324*cdf0e10cSrcweir ::boost::shared_ptr<FrameworkHelper> pHelper ( 325*cdf0e10cSrcweir FrameworkHelper::Instance(*pBase)); 326*cdf0e10cSrcweir pHelper->RequestView( 327*cdf0e10cSrcweir FrameworkHelper::msOutlineViewURL, 328*cdf0e10cSrcweir FrameworkHelper::msCenterPaneURL); 329*cdf0e10cSrcweir 330*cdf0e10cSrcweir pHelper->RunOnResourceActivation( 331*cdf0e10cSrcweir FrameworkHelper::CreateResourceId( 332*cdf0e10cSrcweir FrameworkHelper::msOutlineViewURL, 333*cdf0e10cSrcweir FrameworkHelper::msCenterPaneURL), 334*cdf0e10cSrcweir OutlineToImpressFinalizer(*pBase, *pDoc, *pBytes)); 335*cdf0e10cSrcweir } 336*cdf0e10cSrcweir } 337*cdf0e10cSrcweir } 338*cdf0e10cSrcweir } 339*cdf0e10cSrcweir } 340*cdf0e10cSrcweir 341*cdf0e10cSrcweir rRequest.IsDone(); 342*cdf0e10cSrcweir } 343*cdf0e10cSrcweir 344*cdf0e10cSrcweir 345*cdf0e10cSrcweir 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir /************************************************************************* 348*cdf0e10cSrcweir |* 349*cdf0e10cSrcweir |* GetState 350*cdf0e10cSrcweir |* 351*cdf0e10cSrcweir \************************************************************************/ 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir static bool bOnce = false; 354*cdf0e10cSrcweir 355*cdf0e10cSrcweir void SdModule::GetState(SfxItemSet& rItemSet) 356*cdf0e10cSrcweir { 357*cdf0e10cSrcweir // Autopilot waehrend der Praesentation disablen 358*cdf0e10cSrcweir if (rItemSet.GetItemState(SID_SD_AUTOPILOT) != SFX_ITEM_UNKNOWN) 359*cdf0e10cSrcweir { 360*cdf0e10cSrcweir if (!SvtModuleOptions().IsImpress()) 361*cdf0e10cSrcweir { 362*cdf0e10cSrcweir rItemSet.DisableItem(SID_SD_AUTOPILOT); 363*cdf0e10cSrcweir } 364*cdf0e10cSrcweir else 365*cdf0e10cSrcweir { 366*cdf0e10cSrcweir ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 367*cdf0e10cSrcweir if (pDocShell) 368*cdf0e10cSrcweir { 369*cdf0e10cSrcweir ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); 370*cdf0e10cSrcweir if (pViewShell) 371*cdf0e10cSrcweir { 372*cdf0e10cSrcweir if( sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) ) 373*cdf0e10cSrcweir { 374*cdf0e10cSrcweir rItemSet.DisableItem(SID_SD_AUTOPILOT); 375*cdf0e10cSrcweir } 376*cdf0e10cSrcweir } 377*cdf0e10cSrcweir } 378*cdf0e10cSrcweir } 379*cdf0e10cSrcweir } 380*cdf0e10cSrcweir 381*cdf0e10cSrcweir if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_ATTR_METRIC ) ) 382*cdf0e10cSrcweir { 383*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() ); 384*cdf0e10cSrcweir if(pDocSh) 385*cdf0e10cSrcweir { 386*cdf0e10cSrcweir DocumentType eDocType = pDocSh->GetDoc()->GetDocumentType(); 387*cdf0e10cSrcweir 388*cdf0e10cSrcweir SdOptions* pOptions = GetSdOptions(eDocType); 389*cdf0e10cSrcweir rItemSet.Put( SfxUInt16Item( SID_ATTR_METRIC, pOptions->GetMetric() ) ); 390*cdf0e10cSrcweir } 391*cdf0e10cSrcweir } 392*cdf0e10cSrcweir 393*cdf0e10cSrcweir // der Status von SID_OPENDOC wird von der Basisklasse bestimmt 394*cdf0e10cSrcweir if (rItemSet.GetItemState(SID_OPENDOC) != SFX_ITEM_UNKNOWN) 395*cdf0e10cSrcweir { 396*cdf0e10cSrcweir const SfxPoolItem* pItem = SFX_APP()->GetSlotState(SID_OPENDOC, SFX_APP()->GetInterface()); 397*cdf0e10cSrcweir if (pItem) 398*cdf0e10cSrcweir rItemSet.Put(*pItem); 399*cdf0e10cSrcweir } 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir // der Status von SID_OPENHYPERLINK wird von der Basisklasse bestimmt 402*cdf0e10cSrcweir if (rItemSet.GetItemState(SID_OPENHYPERLINK) != SFX_ITEM_UNKNOWN) 403*cdf0e10cSrcweir { 404*cdf0e10cSrcweir const SfxPoolItem* pItem = SFX_APP()->GetSlotState(SID_OPENHYPERLINK, SFX_APP()->GetInterface()); 405*cdf0e10cSrcweir if (pItem) 406*cdf0e10cSrcweir rItemSet.Put(*pItem); 407*cdf0e10cSrcweir } 408*cdf0e10cSrcweir 409*cdf0e10cSrcweir if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_AUTOSPELL_CHECK ) ) 410*cdf0e10cSrcweir { 411*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh = 412*cdf0e10cSrcweir PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 413*cdf0e10cSrcweir if( pDocSh ) 414*cdf0e10cSrcweir { 415*cdf0e10cSrcweir SdDrawDocument* pDoc = pDocSh->GetDoc(); 416*cdf0e10cSrcweir rItemSet.Put( SfxBoolItem( SID_AUTOSPELL_CHECK, pDoc->GetOnlineSpell() ) ); 417*cdf0e10cSrcweir } 418*cdf0e10cSrcweir } 419*cdf0e10cSrcweir 420*cdf0e10cSrcweir if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_ATTR_LANGUAGE ) ) 421*cdf0e10cSrcweir { 422*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 423*cdf0e10cSrcweir if( pDocSh ) 424*cdf0e10cSrcweir rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ), SID_ATTR_LANGUAGE ) ); 425*cdf0e10cSrcweir } 426*cdf0e10cSrcweir 427*cdf0e10cSrcweir if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_ATTR_CHAR_CJK_LANGUAGE ) ) 428*cdf0e10cSrcweir { 429*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 430*cdf0e10cSrcweir if( pDocSh ) 431*cdf0e10cSrcweir rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE_CJK ), SID_ATTR_CHAR_CJK_LANGUAGE ) ); 432*cdf0e10cSrcweir } 433*cdf0e10cSrcweir 434*cdf0e10cSrcweir if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_ATTR_CHAR_CTL_LANGUAGE ) ) 435*cdf0e10cSrcweir { 436*cdf0e10cSrcweir ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 437*cdf0e10cSrcweir if( pDocSh ) 438*cdf0e10cSrcweir rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE_CTL ), SID_ATTR_CHAR_CTL_LANGUAGE ) ); 439*cdf0e10cSrcweir } 440*cdf0e10cSrcweir 441*cdf0e10cSrcweir if ( !bOnce ) 442*cdf0e10cSrcweir { 443*cdf0e10cSrcweir ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 444*cdf0e10cSrcweir if( pDocShell ) // Impress or Draw ? 445*cdf0e10cSrcweir { 446*cdf0e10cSrcweir ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); 447*cdf0e10cSrcweir 448*cdf0e10cSrcweir if( pViewShell && (pDocShell->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) ) 449*cdf0e10cSrcweir { 450*cdf0e10cSrcweir // add our event listener as soon as possible 451*cdf0e10cSrcweir Application::AddEventListener( LINK( this, SdModule, EventListenerHdl ) ); 452*cdf0e10cSrcweir bOnce = true; 453*cdf0e10cSrcweir } 454*cdf0e10cSrcweir } 455*cdf0e10cSrcweir } 456*cdf0e10cSrcweir } 457*cdf0e10cSrcweir 458*cdf0e10cSrcweir IMPL_LINK( SdModule, EventListenerHdl, VclSimpleEvent*, pEvent ) 459*cdf0e10cSrcweir { 460*cdf0e10cSrcweir if( pEvent && (pEvent->GetId() == VCLEVENT_WINDOW_COMMAND) && static_cast<VclWindowEvent*>(pEvent)->GetData() ) 461*cdf0e10cSrcweir { 462*cdf0e10cSrcweir const CommandEvent& rEvent = *(const CommandEvent*)static_cast<VclWindowEvent*>(pEvent)->GetData(); 463*cdf0e10cSrcweir 464*cdf0e10cSrcweir if( rEvent.GetCommand() == COMMAND_MEDIA ) 465*cdf0e10cSrcweir { 466*cdf0e10cSrcweir switch( rEvent.GetMediaCommand() ) 467*cdf0e10cSrcweir { 468*cdf0e10cSrcweir case MEDIA_COMMAND_PLAY: 469*cdf0e10cSrcweir { 470*cdf0e10cSrcweir ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); 471*cdf0e10cSrcweir if( pDocShell ) // Impress or Draw ? 472*cdf0e10cSrcweir { 473*cdf0e10cSrcweir ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); 474*cdf0e10cSrcweir 475*cdf0e10cSrcweir // #i97925# start the presentation if and only if an Impress document is focused 476*cdf0e10cSrcweir if( pViewShell && (pDocShell->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) ) 477*cdf0e10cSrcweir pViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION ); 478*cdf0e10cSrcweir } 479*cdf0e10cSrcweir } 480*cdf0e10cSrcweir break; 481*cdf0e10cSrcweir 482*cdf0e10cSrcweir default: 483*cdf0e10cSrcweir break; 484*cdf0e10cSrcweir } 485*cdf0e10cSrcweir } 486*cdf0e10cSrcweir } 487*cdf0e10cSrcweir return 0; 488*cdf0e10cSrcweir } 489*cdf0e10cSrcweir 490*cdf0e10cSrcweir 491*cdf0e10cSrcweir void SdModule::AddSummaryPage (SfxViewFrame* pViewFrame, SdDrawDocument* pDocument) 492*cdf0e10cSrcweir { 493*cdf0e10cSrcweir if( !pViewFrame || !pViewFrame->GetDispatcher() || !pDocument ) 494*cdf0e10cSrcweir return; 495*cdf0e10cSrcweir 496*cdf0e10cSrcweir pViewFrame->GetDispatcher()->Execute(SID_SUMMARY_PAGE, 497*cdf0e10cSrcweir SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD); 498*cdf0e10cSrcweir 499*cdf0e10cSrcweir OSL_ASSERT (pDocument!=NULL); 500*cdf0e10cSrcweir 501*cdf0e10cSrcweir sal_Int32 nPageCount = pDocument->GetSdPageCount (PK_STANDARD); 502*cdf0e10cSrcweir 503*cdf0e10cSrcweir // We need at least two pages: the summary page and one to use as 504*cdf0e10cSrcweir // template to take the transition parameters from. 505*cdf0e10cSrcweir if (nPageCount >= 2) 506*cdf0e10cSrcweir { 507*cdf0e10cSrcweir // Get a page from which to retrieve the transition parameters. 508*cdf0e10cSrcweir SdPage* pTemplatePage = pDocument->GetSdPage (0, PK_STANDARD); 509*cdf0e10cSrcweir OSL_ASSERT (pTemplatePage!=NULL); 510*cdf0e10cSrcweir 511*cdf0e10cSrcweir // The summary page, if it exists, is the last page. 512*cdf0e10cSrcweir SdPage* pSummaryPage = pDocument->GetSdPage ( 513*cdf0e10cSrcweir (sal_uInt16)nPageCount-1, PK_STANDARD); 514*cdf0e10cSrcweir OSL_ASSERT (pSummaryPage!=NULL); 515*cdf0e10cSrcweir 516*cdf0e10cSrcweir // Take the change mode of the template page as indication of the 517*cdf0e10cSrcweir // document's kiosk mode. 518*cdf0e10cSrcweir pSummaryPage->setTransitionDuration(pTemplatePage->getTransitionDuration()); 519*cdf0e10cSrcweir pSummaryPage->SetPresChange(pTemplatePage->GetPresChange()); 520*cdf0e10cSrcweir pSummaryPage->SetTime(pTemplatePage->GetTime()); 521*cdf0e10cSrcweir pSummaryPage->SetSound(pTemplatePage->IsSoundOn()); 522*cdf0e10cSrcweir pSummaryPage->SetSoundFile(pTemplatePage->GetSoundFile()); 523*cdf0e10cSrcweir pSummaryPage->setTransitionType(pTemplatePage->getTransitionType()); 524*cdf0e10cSrcweir pSummaryPage->setTransitionSubtype(pTemplatePage->getTransitionSubtype()); 525*cdf0e10cSrcweir pSummaryPage->setTransitionDirection(pTemplatePage->getTransitionDirection()); 526*cdf0e10cSrcweir pSummaryPage->setTransitionFadeColor(pTemplatePage->getTransitionFadeColor()); 527*cdf0e10cSrcweir pSummaryPage->setTransitionDuration(pTemplatePage->getTransitionDuration()); 528*cdf0e10cSrcweir } 529*cdf0e10cSrcweir } 530*cdf0e10cSrcweir 531*cdf0e10cSrcweir SfxFrame* SdModule::CreateFromTemplate( const String& rTemplatePath, const Reference< XFrame >& i_rFrame ) 532*cdf0e10cSrcweir { 533*cdf0e10cSrcweir SfxFrame* pFrame = 0; 534*cdf0e10cSrcweir 535*cdf0e10cSrcweir SfxObjectShellLock xDocShell; 536*cdf0e10cSrcweir 537*cdf0e10cSrcweir SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() ); 538*cdf0e10cSrcweir pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) ); 539*cdf0e10cSrcweir 540*cdf0e10cSrcweir sal_uLong lErr = SFX_APP()->LoadTemplate( xDocShell, rTemplatePath, sal_True, pSet ); 541*cdf0e10cSrcweir 542*cdf0e10cSrcweir SfxObjectShell* pDocShell = xDocShell; 543*cdf0e10cSrcweir 544*cdf0e10cSrcweir if( lErr ) 545*cdf0e10cSrcweir { 546*cdf0e10cSrcweir ErrorHandler::HandleError(lErr); 547*cdf0e10cSrcweir } 548*cdf0e10cSrcweir else if( pDocShell ) 549*cdf0e10cSrcweir { 550*cdf0e10cSrcweir SfxViewFrame* pViewFrame = SfxViewFrame::LoadDocumentIntoFrame( *pDocShell, i_rFrame ); 551*cdf0e10cSrcweir OSL_ENSURE( pViewFrame, "SdModule::CreateFromTemplate: no view frame - was the document really loaded?" ); 552*cdf0e10cSrcweir pFrame = pViewFrame ? &pViewFrame->GetFrame() : NULL; 553*cdf0e10cSrcweir } 554*cdf0e10cSrcweir 555*cdf0e10cSrcweir return pFrame; 556*cdf0e10cSrcweir 557*cdf0e10cSrcweir } 558*cdf0e10cSrcweir 559*cdf0e10cSrcweir SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq ) 560*cdf0e10cSrcweir { 561*cdf0e10cSrcweir SfxFrame* pFrame = 0; 562*cdf0e10cSrcweir if ( SvtModuleOptions().IsImpress() ) 563*cdf0e10cSrcweir { 564*cdf0e10cSrcweir Reference< XFrame > xTargetFrame; 565*cdf0e10cSrcweir SFX_REQUEST_ARG( rReq, pFrmItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False); 566*cdf0e10cSrcweir if ( pFrmItem ) 567*cdf0e10cSrcweir xTargetFrame = pFrmItem->GetFrame(); 568*cdf0e10cSrcweir 569*cdf0e10cSrcweir bool bMakeLayoutVisible = false; 570*cdf0e10cSrcweir SfxViewFrame* pViewFrame = NULL; 571*cdf0e10cSrcweir 572*cdf0e10cSrcweir SdOptions* pOpt = GetSdOptions(DOCUMENT_TYPE_IMPRESS); 573*cdf0e10cSrcweir bool bStartWithTemplate = pOpt->IsStartWithTemplate(); 574*cdf0e10cSrcweir 575*cdf0e10cSrcweir bool bNewDocDirect = rReq.GetSlot() == SID_NEWSD; 576*cdf0e10cSrcweir if( bNewDocDirect && !bStartWithTemplate ) 577*cdf0e10cSrcweir { 578*cdf0e10cSrcweir //we start without wizard 579*cdf0e10cSrcweir 580*cdf0e10cSrcweir //check wether we should load a template document 581*cdf0e10cSrcweir const ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ); 582*cdf0e10cSrcweir String aStandardTemplate( SfxObjectFactory::GetStandardTemplate( aServiceName ) ); 583*cdf0e10cSrcweir 584*cdf0e10cSrcweir if( aStandardTemplate.Len() > 0 ) 585*cdf0e10cSrcweir { 586*cdf0e10cSrcweir //load a template document 587*cdf0e10cSrcweir pFrame = CreateFromTemplate( aStandardTemplate, xTargetFrame ); 588*cdf0e10cSrcweir } 589*cdf0e10cSrcweir else 590*cdf0e10cSrcweir { 591*cdf0e10cSrcweir //create an empty document 592*cdf0e10cSrcweir pFrame = CreateEmptyDocument( DOCUMENT_TYPE_IMPRESS, xTargetFrame ); 593*cdf0e10cSrcweir bMakeLayoutVisible = true; 594*cdf0e10cSrcweir } 595*cdf0e10cSrcweir } 596*cdf0e10cSrcweir else 597*cdf0e10cSrcweir { 598*cdf0e10cSrcweir SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); 599*cdf0e10cSrcweir std::auto_ptr< AbstractAssistentDlg > pPilotDlg( pFact ? pFact->CreateAssistentDlg( NULL, !bNewDocDirect ) : 0 ); 600*cdf0e10cSrcweir 601*cdf0e10cSrcweir // Open the Pilot 602*cdf0e10cSrcweir if( pPilotDlg.get() && pPilotDlg->Execute()==RET_OK ) 603*cdf0e10cSrcweir { 604*cdf0e10cSrcweir const String aDocPath( pPilotDlg->GetDocPath()); 605*cdf0e10cSrcweir const sal_Bool bIsDocEmpty = pPilotDlg->IsDocEmpty(); 606*cdf0e10cSrcweir 607*cdf0e10cSrcweir // So that you can open the document without AutoLayout-Dialog 608*cdf0e10cSrcweir pOpt->SetStartWithTemplate(sal_False); 609*cdf0e10cSrcweir if(bNewDocDirect && !pPilotDlg->GetStartWithFlag()) 610*cdf0e10cSrcweir bStartWithTemplate = sal_False; 611*cdf0e10cSrcweir 612*cdf0e10cSrcweir if( pPilotDlg->GetStartType() == ST_OPEN ) 613*cdf0e10cSrcweir { 614*cdf0e10cSrcweir String aFileToOpen = aDocPath; 615*cdf0e10cSrcweir 616*cdf0e10cSrcweir DBG_ASSERT( aFileToOpen.Len()!=0, "The autopilot should have asked for a file itself already!" ); 617*cdf0e10cSrcweir if(aFileToOpen.Len() != 0) 618*cdf0e10cSrcweir { 619*cdf0e10cSrcweir const String aPasswrd( pPilotDlg->GetPassword() ); 620*cdf0e10cSrcweir 621*cdf0e10cSrcweir SfxStringItem aFile( SID_FILE_NAME, aFileToOpen ); 622*cdf0e10cSrcweir SfxStringItem aReferer( SID_REFERER, UniString() ); 623*cdf0e10cSrcweir SfxStringItem aPassword( SID_PASSWORD, aPasswrd ); 624*cdf0e10cSrcweir 625*cdf0e10cSrcweir if ( xTargetFrame.is() ) 626*cdf0e10cSrcweir { 627*cdf0e10cSrcweir SfxAllItemSet aSet( *rReq.GetArgs()->GetPool() ); 628*cdf0e10cSrcweir aSet.Put( aFile ); 629*cdf0e10cSrcweir aSet.Put( aReferer ); 630*cdf0e10cSrcweir // Put the password into the request 631*cdf0e10cSrcweir // only if it is not empty. 632*cdf0e10cSrcweir if (aPasswrd.Len() > 0) 633*cdf0e10cSrcweir aSet.Put( aPassword ); 634*cdf0e10cSrcweir 635*cdf0e10cSrcweir const SfxPoolItem* pRet = SfxFrame::OpenDocumentSynchron( aSet, xTargetFrame ); 636*cdf0e10cSrcweir const SfxViewFrameItem* pFrameItem = PTR_CAST( SfxViewFrameItem, pRet ); 637*cdf0e10cSrcweir if ( pFrameItem && pFrameItem->GetFrame() ) 638*cdf0e10cSrcweir pFrame = &pFrameItem->GetFrame()->GetFrame(); 639*cdf0e10cSrcweir } 640*cdf0e10cSrcweir else 641*cdf0e10cSrcweir { 642*cdf0e10cSrcweir SfxRequest aRequest (SID_OPENDOC, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool()); 643*cdf0e10cSrcweir aRequest.AppendItem (aFile); 644*cdf0e10cSrcweir aRequest.AppendItem (aReferer); 645*cdf0e10cSrcweir // Put the password into the request 646*cdf0e10cSrcweir // only if it is not empty. 647*cdf0e10cSrcweir if (aPasswrd.Len() > 0) 648*cdf0e10cSrcweir aRequest.AppendItem (aPassword); 649*cdf0e10cSrcweir aRequest.AppendItem (SfxStringItem ( 650*cdf0e10cSrcweir SID_TARGETNAME, 651*cdf0e10cSrcweir String (RTL_CONSTASCII_USTRINGPARAM ("_default")))); 652*cdf0e10cSrcweir try 653*cdf0e10cSrcweir { 654*cdf0e10cSrcweir const SfxPoolItem* pRet = SFX_APP()->ExecuteSlot (aRequest); 655*cdf0e10cSrcweir const SfxViewFrameItem* pFrameItem = PTR_CAST( SfxViewFrameItem, pRet ); 656*cdf0e10cSrcweir if ( pFrameItem ) 657*cdf0e10cSrcweir pFrame = &pFrameItem->GetFrame()->GetFrame(); 658*cdf0e10cSrcweir } 659*cdf0e10cSrcweir catch (::com::sun::star::uno::Exception e) 660*cdf0e10cSrcweir { 661*cdf0e10cSrcweir DBG_ASSERT (sal_False, "caught IllegalArgumentException while loading document from Impress autopilot"); 662*cdf0e10cSrcweir } 663*cdf0e10cSrcweir } 664*cdf0e10cSrcweir } 665*cdf0e10cSrcweir 666*cdf0e10cSrcweir pOpt->SetStartWithTemplate(bStartWithTemplate); 667*cdf0e10cSrcweir if(bNewDocDirect && !bStartWithTemplate) 668*cdf0e10cSrcweir { 669*cdf0e10cSrcweir std::auto_ptr< SfxItemSet > pRet( CreateItemSet( SID_SD_EDITOPTIONS ) ); 670*cdf0e10cSrcweir if(pRet.get()) 671*cdf0e10cSrcweir ApplyItemSet( SID_SD_EDITOPTIONS, *pRet.get() ); 672*cdf0e10cSrcweir 673*cdf0e10cSrcweir } 674*cdf0e10cSrcweir } 675*cdf0e10cSrcweir else 676*cdf0e10cSrcweir { 677*cdf0e10cSrcweir SfxObjectShellLock xShell( pPilotDlg->GetDocument() ); 678*cdf0e10cSrcweir SfxObjectShell* pShell = xShell; 679*cdf0e10cSrcweir if( pShell ) 680*cdf0e10cSrcweir { 681*cdf0e10cSrcweir pViewFrame = SfxViewFrame::LoadDocumentIntoFrame( *pShell, xTargetFrame ); 682*cdf0e10cSrcweir DBG_ASSERT( pViewFrame, "no ViewFrame!!" ); 683*cdf0e10cSrcweir pFrame = pViewFrame ? &pViewFrame->GetFrame() : NULL; 684*cdf0e10cSrcweir 685*cdf0e10cSrcweir if(bNewDocDirect && !bStartWithTemplate) 686*cdf0e10cSrcweir { 687*cdf0e10cSrcweir std::auto_ptr< SfxItemSet > pRet( CreateItemSet( SID_SD_EDITOPTIONS ) ); 688*cdf0e10cSrcweir if(pRet.get()) 689*cdf0e10cSrcweir ApplyItemSet( SID_SD_EDITOPTIONS, *pRet.get() ); 690*cdf0e10cSrcweir } 691*cdf0e10cSrcweir 692*cdf0e10cSrcweir if( pShell && pViewFrame ) 693*cdf0e10cSrcweir { 694*cdf0e10cSrcweir ::sd::DrawDocShell* pDocShell = 695*cdf0e10cSrcweir PTR_CAST(::sd::DrawDocShell,pShell); 696*cdf0e10cSrcweir SdDrawDocument* pDoc = pDocShell->GetDoc(); 697*cdf0e10cSrcweir 698*cdf0e10cSrcweir ::sd::ViewShellBase* pBase = 699*cdf0e10cSrcweir ::sd::ViewShellBase::GetViewShellBase ( 700*cdf0e10cSrcweir pViewFrame); 701*cdf0e10cSrcweir OSL_ASSERT (pBase!=NULL); 702*cdf0e10cSrcweir ::boost::shared_ptr<sd::ViewShell> pViewSh = pBase->GetMainViewShell(); 703*cdf0e10cSrcweir SdOptions* pOptions = GetSdOptions(pDoc->GetDocumentType()); 704*cdf0e10cSrcweir 705*cdf0e10cSrcweir if (pOptions && pViewSh.get()) 706*cdf0e10cSrcweir { 707*cdf0e10cSrcweir // The AutoPilot-document shall be open without its own options 708*cdf0e10cSrcweir ::sd::FrameView* pFrameView = pViewSh->GetFrameView(); 709*cdf0e10cSrcweir pFrameView->Update(pOptions); 710*cdf0e10cSrcweir pViewSh->ReadFrameViewData(pFrameView); 711*cdf0e10cSrcweir } 712*cdf0e10cSrcweir 713*cdf0e10cSrcweir ChangeMedium( pDocShell, pViewFrame, pPilotDlg->GetOutputMedium() ); 714*cdf0e10cSrcweir 715*cdf0e10cSrcweir if(pPilotDlg->IsSummary()) 716*cdf0e10cSrcweir AddSummaryPage(pViewFrame, pDoc); 717*cdf0e10cSrcweir 718*cdf0e10cSrcweir // empty document 719*cdf0e10cSrcweir if((aDocPath.Len() == 0) && pViewFrame && pViewFrame->GetDispatcher()) 720*cdf0e10cSrcweir { 721*cdf0e10cSrcweir SfxBoolItem aIsChangedItem(SID_MODIFYPAGE, !bIsDocEmpty); 722*cdf0e10cSrcweir SfxUInt32Item eAutoLayout( ID_VAL_WHATLAYOUT, (sal_uInt32) AUTOLAYOUT_TITLE ); 723*cdf0e10cSrcweir pViewFrame->GetDispatcher()->Execute(SID_MODIFYPAGE, 724*cdf0e10cSrcweir SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aIsChangedItem, &eAutoLayout, 0L); 725*cdf0e10cSrcweir } 726*cdf0e10cSrcweir 727*cdf0e10cSrcweir // clear document info 728*cdf0e10cSrcweir using namespace ::com::sun::star; 729*cdf0e10cSrcweir uno::Reference<document::XDocumentPropertiesSupplier> xDPS( 730*cdf0e10cSrcweir pDocShell->GetModel(), uno::UNO_QUERY_THROW); 731*cdf0e10cSrcweir uno::Reference<document::XDocumentProperties> 732*cdf0e10cSrcweir xDocProps(xDPS->getDocumentProperties()); 733*cdf0e10cSrcweir DBG_ASSERT(xDocProps.is(), "no DocumentProperties"); 734*cdf0e10cSrcweir xDocProps->resetUserData( 735*cdf0e10cSrcweir SvtUserOptions().GetFullName() ); 736*cdf0e10cSrcweir xDocProps->setTemplateName(xDocProps->getTitle()); 737*cdf0e10cSrcweir xDocProps->setTemplateURL(pPilotDlg->GetDocPath()); 738*cdf0e10cSrcweir 739*cdf0e10cSrcweir pDoc->SetChanged(!bIsDocEmpty); 740*cdf0e10cSrcweir 741*cdf0e10cSrcweir pDocShell->SetUseUserData(sal_True); 742*cdf0e10cSrcweir 743*cdf0e10cSrcweir // #94652# clear UNDO stack after autopilot 744*cdf0e10cSrcweir pDocShell->ClearUndoBuffer(); 745*cdf0e10cSrcweir 746*cdf0e10cSrcweir bMakeLayoutVisible = true; 747*cdf0e10cSrcweir } 748*cdf0e10cSrcweir } 749*cdf0e10cSrcweir pOpt->SetStartWithTemplate(bStartWithTemplate); 750*cdf0e10cSrcweir } 751*cdf0e10cSrcweir } 752*cdf0e10cSrcweir } 753*cdf0e10cSrcweir 754*cdf0e10cSrcweir if (bMakeLayoutVisible && pViewFrame!=NULL) 755*cdf0e10cSrcweir { 756*cdf0e10cSrcweir // Make the layout menu visible in the tool pane. 757*cdf0e10cSrcweir ::sd::ViewShellBase* pBase = ::sd::ViewShellBase::GetViewShellBase(pViewFrame); 758*cdf0e10cSrcweir if (pBase != NULL) 759*cdf0e10cSrcweir { 760*cdf0e10cSrcweir FrameworkHelper::Instance(*pBase)->RequestTaskPanel( 761*cdf0e10cSrcweir FrameworkHelper::msLayoutTaskPanelURL); 762*cdf0e10cSrcweir } 763*cdf0e10cSrcweir } 764*cdf0e10cSrcweir } 765*cdf0e10cSrcweir 766*cdf0e10cSrcweir return pFrame; 767*cdf0e10cSrcweir } 768*cdf0e10cSrcweir 769*cdf0e10cSrcweir SfxFrame* SdModule::CreateEmptyDocument( DocumentType eDocType, const Reference< XFrame >& i_rFrame ) 770*cdf0e10cSrcweir { 771*cdf0e10cSrcweir SfxFrame* pFrame = 0; 772*cdf0e10cSrcweir 773*cdf0e10cSrcweir SfxObjectShellLock xDocShell; 774*cdf0e10cSrcweir ::sd::DrawDocShell* pNewDocSh; 775*cdf0e10cSrcweir xDocShell = pNewDocSh = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD,sal_False,eDocType); 776*cdf0e10cSrcweir if(pNewDocSh) 777*cdf0e10cSrcweir { 778*cdf0e10cSrcweir pNewDocSh->DoInitNew(NULL); 779*cdf0e10cSrcweir SdDrawDocument* pDoc = pNewDocSh->GetDoc(); 780*cdf0e10cSrcweir if(pDoc) 781*cdf0e10cSrcweir { 782*cdf0e10cSrcweir pDoc->CreateFirstPages(); 783*cdf0e10cSrcweir pDoc->StopWorkStartupDelay(); 784*cdf0e10cSrcweir } 785*cdf0e10cSrcweir 786*cdf0e10cSrcweir SfxViewFrame* pViewFrame = SfxViewFrame::LoadDocumentIntoFrame( *pNewDocSh, i_rFrame ); 787*cdf0e10cSrcweir OSL_ENSURE( pViewFrame, "SdModule::CreateEmptyDocument: no view frame - was the document really loaded?" ); 788*cdf0e10cSrcweir pFrame = pViewFrame ? &pViewFrame->GetFrame() : NULL; 789*cdf0e10cSrcweir } 790*cdf0e10cSrcweir 791*cdf0e10cSrcweir return pFrame; 792*cdf0e10cSrcweir } 793*cdf0e10cSrcweir 794*cdf0e10cSrcweir void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewFrame, const sal_Int32 eMedium ) 795*cdf0e10cSrcweir { 796*cdf0e10cSrcweir if( !pDocShell ) 797*cdf0e10cSrcweir return; 798*cdf0e10cSrcweir 799*cdf0e10cSrcweir SdDrawDocument* pDoc = pDocShell->GetDoc(); 800*cdf0e10cSrcweir if( !pDoc ) 801*cdf0e10cSrcweir return; 802*cdf0e10cSrcweir 803*cdf0e10cSrcweir // settings for the Outputmedium 804*cdf0e10cSrcweir Size aNewSize; 805*cdf0e10cSrcweir sal_uInt32 nLeft = 0; 806*cdf0e10cSrcweir sal_uInt32 nRight = 0; 807*cdf0e10cSrcweir sal_uInt32 nLower = 0; 808*cdf0e10cSrcweir sal_uInt32 nUpper = 0; 809*cdf0e10cSrcweir switch(eMedium) 810*cdf0e10cSrcweir { 811*cdf0e10cSrcweir case OUTPUT_PAGE: 812*cdf0e10cSrcweir case OUTPUT_OVERHEAD: 813*cdf0e10cSrcweir { 814*cdf0e10cSrcweir SfxPrinter* pPrinter = pDocShell->GetPrinter(sal_True); 815*cdf0e10cSrcweir 816*cdf0e10cSrcweir if( pPrinter && pPrinter->IsValid()) 817*cdf0e10cSrcweir { 818*cdf0e10cSrcweir // Der Printer gibt leider kein exaktes 819*cdf0e10cSrcweir // Format (z.B. A4) zurueck 820*cdf0e10cSrcweir Size aSize(pPrinter->GetPaperSize()); 821*cdf0e10cSrcweir Paper ePaper = SvxPaperInfo::GetSvxPaper( aSize, MAP_100TH_MM, sal_True); 822*cdf0e10cSrcweir 823*cdf0e10cSrcweir if (ePaper != PAPER_USER) 824*cdf0e10cSrcweir { 825*cdf0e10cSrcweir // Korrekte Size holen 826*cdf0e10cSrcweir aSize = SvxPaperInfo::GetPaperSize(ePaper, MAP_100TH_MM); 827*cdf0e10cSrcweir } 828*cdf0e10cSrcweir 829*cdf0e10cSrcweir if (aSize.Height() > aSize.Width()) 830*cdf0e10cSrcweir { 831*cdf0e10cSrcweir // Stets Querformat 832*cdf0e10cSrcweir aNewSize.Width() = aSize.Height(); 833*cdf0e10cSrcweir aNewSize.Height() = aSize.Width(); 834*cdf0e10cSrcweir } 835*cdf0e10cSrcweir else 836*cdf0e10cSrcweir { 837*cdf0e10cSrcweir aNewSize = aSize; 838*cdf0e10cSrcweir } 839*cdf0e10cSrcweir } 840*cdf0e10cSrcweir else 841*cdf0e10cSrcweir { 842*cdf0e10cSrcweir aNewSize=Size(29700, 21000); 843*cdf0e10cSrcweir } 844*cdf0e10cSrcweir 845*cdf0e10cSrcweir if (eMedium == OUTPUT_PAGE) 846*cdf0e10cSrcweir { 847*cdf0e10cSrcweir nLeft =1000; 848*cdf0e10cSrcweir nRight=1000; 849*cdf0e10cSrcweir nUpper=1000; 850*cdf0e10cSrcweir nLower=1000; 851*cdf0e10cSrcweir } 852*cdf0e10cSrcweir else 853*cdf0e10cSrcweir { 854*cdf0e10cSrcweir nLeft =0; 855*cdf0e10cSrcweir nRight=0; 856*cdf0e10cSrcweir nUpper=0; 857*cdf0e10cSrcweir nLower=0; 858*cdf0e10cSrcweir } 859*cdf0e10cSrcweir } 860*cdf0e10cSrcweir break; 861*cdf0e10cSrcweir 862*cdf0e10cSrcweir case OUTPUT_SLIDE: 863*cdf0e10cSrcweir { 864*cdf0e10cSrcweir aNewSize = Size(27000, 18000); 865*cdf0e10cSrcweir nLeft =0; 866*cdf0e10cSrcweir nRight=0; 867*cdf0e10cSrcweir nUpper=0; 868*cdf0e10cSrcweir nLower=0; 869*cdf0e10cSrcweir } 870*cdf0e10cSrcweir break; 871*cdf0e10cSrcweir 872*cdf0e10cSrcweir case OUTPUT_PRESENTATION: 873*cdf0e10cSrcweir { 874*cdf0e10cSrcweir aNewSize = Size(28000, 21000); 875*cdf0e10cSrcweir nLeft =0; 876*cdf0e10cSrcweir nRight=0; 877*cdf0e10cSrcweir nUpper=0; 878*cdf0e10cSrcweir nLower=0; 879*cdf0e10cSrcweir } 880*cdf0e10cSrcweir break; 881*cdf0e10cSrcweir } 882*cdf0e10cSrcweir 883*cdf0e10cSrcweir sal_Bool bScaleAll = sal_True; 884*cdf0e10cSrcweir sal_uInt16 nPageCnt = pDoc->GetMasterSdPageCount(PK_STANDARD); 885*cdf0e10cSrcweir sal_uInt16 i; 886*cdf0e10cSrcweir SdPage* pPage; 887*cdf0e10cSrcweir 888*cdf0e10cSrcweir // master pages first 889*cdf0e10cSrcweir for (i = 0; i < nPageCnt; i++) 890*cdf0e10cSrcweir { 891*cdf0e10cSrcweir pPage = pDoc->GetMasterSdPage(i, PK_STANDARD); 892*cdf0e10cSrcweir 893*cdf0e10cSrcweir if (pPage) 894*cdf0e10cSrcweir { 895*cdf0e10cSrcweir if(eMedium != OUTPUT_ORIGINAL) 896*cdf0e10cSrcweir { 897*cdf0e10cSrcweir Rectangle aBorderRect(nLeft, nUpper, nRight, nLower); 898*cdf0e10cSrcweir pPage->ScaleObjects(aNewSize, aBorderRect, bScaleAll); 899*cdf0e10cSrcweir pPage->SetSize(aNewSize); 900*cdf0e10cSrcweir pPage->SetBorder(nLeft, nUpper, nRight, nLower); 901*cdf0e10cSrcweir } 902*cdf0e10cSrcweir SdPage* pNotesPage = pDoc->GetMasterSdPage(i, PK_NOTES); 903*cdf0e10cSrcweir DBG_ASSERT( pNotesPage, "Wrong page ordering!" ); 904*cdf0e10cSrcweir if( pNotesPage ) pNotesPage->CreateTitleAndLayout(); 905*cdf0e10cSrcweir pPage->CreateTitleAndLayout(); 906*cdf0e10cSrcweir } 907*cdf0e10cSrcweir } 908*cdf0e10cSrcweir 909*cdf0e10cSrcweir nPageCnt = pDoc->GetSdPageCount(PK_STANDARD); 910*cdf0e10cSrcweir 911*cdf0e10cSrcweir // then slides 912*cdf0e10cSrcweir for (i = 0; i < nPageCnt; i++) 913*cdf0e10cSrcweir { 914*cdf0e10cSrcweir pPage = pDoc->GetSdPage(i, PK_STANDARD); 915*cdf0e10cSrcweir 916*cdf0e10cSrcweir if (pPage) 917*cdf0e10cSrcweir { 918*cdf0e10cSrcweir if(eMedium != OUTPUT_ORIGINAL) 919*cdf0e10cSrcweir { 920*cdf0e10cSrcweir Rectangle aBorderRect(nLeft, nUpper, nRight, nLower); 921*cdf0e10cSrcweir pPage->ScaleObjects(aNewSize, aBorderRect, bScaleAll); 922*cdf0e10cSrcweir pPage->SetSize(aNewSize); 923*cdf0e10cSrcweir pPage->SetBorder(nLeft, nUpper, nRight, nLower); 924*cdf0e10cSrcweir } 925*cdf0e10cSrcweir SdPage* pNotesPage = pDoc->GetSdPage(i, PK_NOTES); 926*cdf0e10cSrcweir DBG_ASSERT( pNotesPage, "Wrong page ordering!" ); 927*cdf0e10cSrcweir if( pNotesPage ) pNotesPage->SetAutoLayout( pNotesPage->GetAutoLayout() ); 928*cdf0e10cSrcweir pPage->SetAutoLayout( pPage->GetAutoLayout() ); 929*cdf0e10cSrcweir } 930*cdf0e10cSrcweir } 931*cdf0e10cSrcweir 932*cdf0e10cSrcweir SdPage* pHandoutPage = pDoc->GetSdPage(0, PK_HANDOUT); 933*cdf0e10cSrcweir pHandoutPage->CreateTitleAndLayout(sal_True); 934*cdf0e10cSrcweir 935*cdf0e10cSrcweir if( (eMedium != OUTPUT_ORIGINAL) && pViewFrame && pViewFrame->GetDispatcher()) 936*cdf0e10cSrcweir { 937*cdf0e10cSrcweir pViewFrame->GetDispatcher()->Execute(SID_SIZE_PAGE, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD); 938*cdf0e10cSrcweir } 939*cdf0e10cSrcweir } 940*cdf0e10cSrcweir 941*cdf0e10cSrcweir 942*cdf0e10cSrcweir 943*cdf0e10cSrcweir 944*cdf0e10cSrcweir //===== OutlineToImpressFinalize ============================================== 945*cdf0e10cSrcweir 946*cdf0e10cSrcweir namespace { 947*cdf0e10cSrcweir 948*cdf0e10cSrcweir OutlineToImpressFinalizer::OutlineToImpressFinalizer ( 949*cdf0e10cSrcweir ::sd::ViewShellBase& rBase, 950*cdf0e10cSrcweir SdDrawDocument& rDocument, 951*cdf0e10cSrcweir SvLockBytes& rBytes) 952*cdf0e10cSrcweir : mrBase(rBase), 953*cdf0e10cSrcweir mrDocument(rDocument), 954*cdf0e10cSrcweir mpStream() 955*cdf0e10cSrcweir { 956*cdf0e10cSrcweir // The given stream has a lifetime shorter than this new 957*cdf0e10cSrcweir // OutlineToImpressFinalizer object. Therefore a local copy of the 958*cdf0e10cSrcweir // stream is created. 959*cdf0e10cSrcweir const SvStream* pStream (rBytes.GetStream()); 960*cdf0e10cSrcweir if (pStream != NULL) 961*cdf0e10cSrcweir { 962*cdf0e10cSrcweir // Create a memory stream and prepare to fill it with the content of 963*cdf0e10cSrcweir // the original stream. 964*cdf0e10cSrcweir mpStream.reset(new SvMemoryStream()); 965*cdf0e10cSrcweir static const sal_Size nBufferSize = 4096; 966*cdf0e10cSrcweir ::boost::scoped_array<sal_Int8> pBuffer (new sal_Int8[nBufferSize]); 967*cdf0e10cSrcweir 968*cdf0e10cSrcweir sal_Size nReadPosition (0); 969*cdf0e10cSrcweir bool bLoop (true); 970*cdf0e10cSrcweir while (bLoop) 971*cdf0e10cSrcweir { 972*cdf0e10cSrcweir // Read the next part of the original stream. 973*cdf0e10cSrcweir sal_Size nReadByteCount (0); 974*cdf0e10cSrcweir const ErrCode nErrorCode ( 975*cdf0e10cSrcweir rBytes.ReadAt( 976*cdf0e10cSrcweir nReadPosition, 977*cdf0e10cSrcweir reinterpret_cast<void*>(pBuffer.get()), 978*cdf0e10cSrcweir nBufferSize, 979*cdf0e10cSrcweir &nReadByteCount)); 980*cdf0e10cSrcweir 981*cdf0e10cSrcweir // Check the error code and stop copying the stream data when an 982*cdf0e10cSrcweir // error has occured. 983*cdf0e10cSrcweir switch (nErrorCode) 984*cdf0e10cSrcweir { 985*cdf0e10cSrcweir case ERRCODE_NONE: 986*cdf0e10cSrcweir if (nReadByteCount == 0) 987*cdf0e10cSrcweir bLoop = false; 988*cdf0e10cSrcweir break; 989*cdf0e10cSrcweir case ERRCODE_IO_PENDING: 990*cdf0e10cSrcweir break; 991*cdf0e10cSrcweir 992*cdf0e10cSrcweir default: 993*cdf0e10cSrcweir bLoop = false; 994*cdf0e10cSrcweir nReadByteCount = 0; 995*cdf0e10cSrcweir break; 996*cdf0e10cSrcweir } 997*cdf0e10cSrcweir 998*cdf0e10cSrcweir // Append the read bytes to the end of the memory stream. 999*cdf0e10cSrcweir if (nReadByteCount > 0) 1000*cdf0e10cSrcweir { 1001*cdf0e10cSrcweir mpStream->Write(reinterpret_cast<void*>(pBuffer.get()), nReadByteCount); 1002*cdf0e10cSrcweir nReadPosition += nReadByteCount; 1003*cdf0e10cSrcweir } 1004*cdf0e10cSrcweir } 1005*cdf0e10cSrcweir 1006*cdf0e10cSrcweir // Rewind the memory stream so that in the operator() method its 1007*cdf0e10cSrcweir // content is properly read. 1008*cdf0e10cSrcweir mpStream->Seek(STREAM_SEEK_TO_BEGIN); 1009*cdf0e10cSrcweir } 1010*cdf0e10cSrcweir } 1011*cdf0e10cSrcweir 1012*cdf0e10cSrcweir 1013*cdf0e10cSrcweir 1014*cdf0e10cSrcweir 1015*cdf0e10cSrcweir void OutlineToImpressFinalizer::operator() (bool) 1016*cdf0e10cSrcweir { 1017*cdf0e10cSrcweir // Fetch the new outline view shell. 1018*cdf0e10cSrcweir ::sd::OutlineViewShell* pOutlineShell 1019*cdf0e10cSrcweir = dynamic_cast<sd::OutlineViewShell*>(FrameworkHelper::Instance(mrBase)->GetViewShell(FrameworkHelper::msCenterPaneURL).get()); 1020*cdf0e10cSrcweir 1021*cdf0e10cSrcweir if (pOutlineShell != NULL && mpStream.get() != NULL) 1022*cdf0e10cSrcweir { 1023*cdf0e10cSrcweir sd::OutlineView* pView = static_cast<sd::OutlineView*>(pOutlineShell->GetView()); 1024*cdf0e10cSrcweir // mba: the stream can't contain any relative URLs, because we don't 1025*cdf0e10cSrcweir // have any information about a BaseURL! 1026*cdf0e10cSrcweir if ( pOutlineShell->Read(*mpStream, String(), EE_FORMAT_RTF) == 0 ) 1027*cdf0e10cSrcweir { 1028*cdf0e10cSrcweir /* 1029*cdf0e10cSrcweir sd::OutlineViewPageChangesGuard aGuard( pView ); 1030*cdf0e10cSrcweir 1031*cdf0e10cSrcweir // Remove the first empty pages 1032*cdf0e10cSrcweir sal_uInt16 nPageCount = mrDocument.GetPageCount(); 1033*cdf0e10cSrcweir mrDocument.RemovePage( --nPageCount ); // notes page 1034*cdf0e10cSrcweir mrDocument.RemovePage( --nPageCount ); // standard page 1035*cdf0e10cSrcweir */ 1036*cdf0e10cSrcweir } 1037*cdf0e10cSrcweir 1038*cdf0e10cSrcweir // Call UpdatePreview once for every slide to resync the 1039*cdf0e10cSrcweir // document with the outliner of the OutlineViewShell. 1040*cdf0e10cSrcweir sal_uInt16 nPageCount (mrDocument.GetSdPageCount(PK_STANDARD)); 1041*cdf0e10cSrcweir for (sal_uInt16 nIndex=0; nIndex<nPageCount; nIndex++) 1042*cdf0e10cSrcweir { 1043*cdf0e10cSrcweir SdPage* pPage = mrDocument.GetSdPage(nIndex, PK_STANDARD); 1044*cdf0e10cSrcweir // Make the page the actual page so that the 1045*cdf0e10cSrcweir // following UpdatePreview() call accesses the 1046*cdf0e10cSrcweir // correct paragraphs. 1047*cdf0e10cSrcweir pView->SetActualPage(pPage); 1048*cdf0e10cSrcweir pOutlineShell->UpdatePreview(pPage, true); 1049*cdf0e10cSrcweir } 1050*cdf0e10cSrcweir // Select the first slide. 1051*cdf0e10cSrcweir SdPage* pPage = mrDocument.GetSdPage(0, PK_STANDARD); 1052*cdf0e10cSrcweir pView->SetActualPage(pPage); 1053*cdf0e10cSrcweir pOutlineShell->UpdatePreview(pPage, true); 1054*cdf0e10cSrcweir } 1055*cdf0e10cSrcweir 1056*cdf0e10cSrcweir 1057*cdf0e10cSrcweir // #97231# Undo-Stack needs to be cleared, else the user may remove the 1058*cdf0e10cSrcweir // only drawpage and this is a state we cannot handle ATM. 1059*cdf0e10cSrcweir ::sd::DrawDocShell* pDocShell = mrDocument.GetDocSh(); 1060*cdf0e10cSrcweir if( pDocShell ) 1061*cdf0e10cSrcweir pDocShell->ClearUndoBuffer(); 1062*cdf0e10cSrcweir } 1063*cdf0e10cSrcweir 1064*cdf0e10cSrcweir 1065*cdf0e10cSrcweir } // end of anonymous namespace 1066