Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #include <sfx2/app.hxx>
21 : : #include <sfx2/docfac.hxx>
22 : : #include <sfx2/printer.hxx>
23 : : #include <sfx2/objface.hxx>
24 : : #include <sfx2/objsh.hxx>
25 : : #include <svl/itemset.hxx>
26 : :
27 : : #include "unomodel.hxx"
28 : :
29 : : #include <basdoc.hxx>
30 : : #define BasicDocShell // This CANNOT come before basdoc apparently
31 : : #include <basslots.hxx>
32 : : #include <sfx2/sfxmodelfactory.hxx>
33 : : #include <svx/svxids.hrc>
34 : :
35 : 0 : TYPEINIT1(BasicDocShell, SfxObjectShell);
36 : : DBG_NAME(BasicDocShell);
37 : :
38 : 0 : SFX_IMPL_OBJECTFACTORY( BasicDocShell, SvGlobalName(), SFXOBJECTSHELL_STD_NORMAL, "sbasic" )
39 : :
40 : 0 : SFX_IMPL_INTERFACE( BasicDocShell, SfxObjectShell, IDEResId( 0 ) )
41 : : {
42 : 0 : SFX_STATUSBAR_REGISTRATION( IDEResId( SID_BASICIDE_STATUSBAR ) );
43 : 0 : }
44 : :
45 : 0 : BasicDocShell::BasicDocShell()
46 : 0 : :SfxObjectShell( SFXMODEL_DISABLE_EMBEDDED_SCRIPTS | SFXMODEL_DISABLE_DOCUMENT_RECOVERY )
47 : : {
48 : 0 : pPrinter = 0;
49 : 0 : SetPool( &SFX_APP()->GetPool() );
50 : 0 : SetBaseModel( new SIDEModel(this) );
51 : 0 : }
52 : :
53 : 0 : BasicDocShell::~BasicDocShell()
54 : : {
55 : 0 : delete pPrinter;
56 : 0 : }
57 : :
58 : 0 : SfxPrinter* BasicDocShell::GetPrinter( bool bCreate )
59 : : {
60 : 0 : if ( !pPrinter && bCreate )
61 : 0 : pPrinter = new SfxPrinter( new SfxItemSet( GetPool(), SID_PRINTER_NOTFOUND_WARN , SID_PRINTER_NOTFOUND_WARN ) );
62 : :
63 : 0 : return pPrinter;
64 : : }
65 : :
66 : 0 : void BasicDocShell::SetPrinter( SfxPrinter* pPr )
67 : : {
68 : 0 : if ( pPr != pPrinter )
69 : : {
70 : 0 : delete pPrinter;
71 : 0 : pPrinter = pPr;
72 : : }
73 : 0 : }
74 : :
75 : 0 : void BasicDocShell::FillClass( SvGlobalName*, sal_uInt32*, String*, String*, String*, sal_Int32, sal_Bool bTemplate) const
76 : : {
77 : : (void)bTemplate;
78 : : DBG_ASSERT( !bTemplate, "No template for Basic" );
79 : 0 : }
80 : :
81 : 0 : void BasicDocShell::Draw( OutputDevice *, const JobSetup &, sal_uInt16 )
82 : 0 : {}
83 : :
84 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|