1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_basctl.hxx" 26 27 28 #include <ide_pch.hxx> 29 #include <svx/svxids.hrc> 30 31 #define GLOBALOVERFLOW2 32 33 #include <sfx2/docfac.hxx> 34 #include <sfx2/sfxmodelfactory.hxx> 35 #include <vcl/status.hxx> 36 37 #include <svx/xmlsecctrl.hxx> 38 39 #include <basdoc.hxx> 40 41 #define BasicDocShell 42 #include <basslots.hxx> 43 44 #include "basicmod.hxx" 45 #include "unomodel.hxx" 46 47 TYPEINIT1(BasicDocShell, SfxObjectShell); 48 DBG_NAME(BasicDocShell); 49 50 SFX_IMPL_OBJECTFACTORY( BasicDocShell, SvGlobalName(), SFXOBJECTSHELL_STD_NORMAL, "sbasic" ) 51 52 SFX_IMPL_INTERFACE( BasicDocShell, SfxObjectShell, IDEResId( 0 ) ) 53 { 54 SFX_STATUSBAR_REGISTRATION( IDEResId( SID_BASICIDE_STATUSBAR ) ); 55 } 56 57 BasicDocShell::BasicDocShell() 58 :SfxObjectShell( SFXMODEL_DISABLE_EMBEDDED_SCRIPTS | SFXMODEL_DISABLE_DOCUMENT_RECOVERY ) 59 { 60 pPrinter = 0; 61 SetPool( &SFX_APP()->GetPool() ); 62 SetBaseModel( new SIDEModel(this) ); 63 } 64 65 __EXPORT BasicDocShell::~BasicDocShell() 66 { 67 delete pPrinter; 68 } 69 70 SfxPrinter* BasicDocShell::GetPrinter( sal_Bool bCreate ) 71 { 72 if ( !pPrinter && bCreate ) 73 pPrinter = new SfxPrinter( new SfxItemSet( GetPool(), SID_PRINTER_NOTFOUND_WARN , SID_PRINTER_NOTFOUND_WARN ) ); 74 75 return pPrinter; 76 } 77 78 void BasicDocShell::SetPrinter( SfxPrinter* pPr ) 79 { 80 if ( pPr != pPrinter ) 81 { 82 delete pPrinter; 83 pPrinter = pPr; 84 } 85 } 86 87 void BasicDocShell::FillClass( SvGlobalName*, sal_uInt32*, String*, String*, String*, sal_Int32, sal_Bool bTemplate) const 88 { 89 (void)bTemplate; 90 DBG_ASSERT( bTemplate == sal_False, "No template for Basic" ); 91 } 92 93 void BasicDocShell::Draw( OutputDevice *, const JobSetup &, sal_uInt16 ) 94 {} 95 96