xref: /trunk/main/basctl/source/basicide/basdoc.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_basctl.hxx"
30 
31 
32 #include <ide_pch.hxx>
33 #include <svx/svxids.hrc>
34 
35 #define GLOBALOVERFLOW2
36 
37 #include <sfx2/docfac.hxx>
38 #include <sfx2/sfxmodelfactory.hxx>
39 #include <vcl/status.hxx>
40 
41 #include <svx/xmlsecctrl.hxx>
42 
43 #include <basdoc.hxx>
44 
45 #define BasicDocShell
46 #include <basslots.hxx>
47 
48 #include "basicmod.hxx"
49 #include "unomodel.hxx"
50 
51 TYPEINIT1(BasicDocShell, SfxObjectShell);
52 DBG_NAME(BasicDocShell);
53 
54 SFX_IMPL_OBJECTFACTORY( BasicDocShell, SvGlobalName(), SFXOBJECTSHELL_STD_NORMAL, "sbasic" )
55 
56 SFX_IMPL_INTERFACE( BasicDocShell, SfxObjectShell, IDEResId( 0 ) )
57 {
58 	SFX_STATUSBAR_REGISTRATION( IDEResId( SID_BASICIDE_STATUSBAR ) );
59 }
60 
61 BasicDocShell::BasicDocShell()
62     :SfxObjectShell( SFXMODEL_DISABLE_EMBEDDED_SCRIPTS | SFXMODEL_DISABLE_DOCUMENT_RECOVERY )
63 {
64 	pPrinter = 0;
65 	SetPool( &SFX_APP()->GetPool() );
66 	SetBaseModel( new SIDEModel(this) );
67 }
68 
69 __EXPORT BasicDocShell::~BasicDocShell()
70 {
71 	delete pPrinter;
72 }
73 
74 SfxPrinter* BasicDocShell::GetPrinter( sal_Bool bCreate )
75 {
76 	if ( !pPrinter && bCreate )
77 		pPrinter = new SfxPrinter( new SfxItemSet( GetPool(), SID_PRINTER_NOTFOUND_WARN , SID_PRINTER_NOTFOUND_WARN ) );
78 
79 	return pPrinter;
80 }
81 
82 void BasicDocShell::SetPrinter( SfxPrinter* pPr )
83 {
84 	if ( pPr != pPrinter )
85 	{
86 		delete pPrinter;
87 		pPrinter = pPr;
88 	}
89 }
90 
91 void BasicDocShell::FillClass( SvGlobalName*, sal_uInt32*, String*, String*, String*, sal_Int32, sal_Bool bTemplate) const
92 {
93     (void)bTemplate;
94     DBG_ASSERT( bTemplate == sal_False, "No template for Basic" );
95 }
96 
97 void BasicDocShell::Draw( OutputDevice *, const JobSetup &, sal_uInt16 )
98 {}
99 
100