2000-09-29 10:02:42 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 09:32:11 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-29 10:02:42 +00:00
|
|
|
*
|
2008-04-11 09:32:11 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-29 10:02:42 +00:00
|
|
|
*
|
2008-04-11 09:32:11 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-29 10:02:42 +00:00
|
|
|
*
|
2008-04-11 09:32:11 +00:00
|
|
|
* $RCSfile: basdoc.cxx,v $
|
2008-12-12 12:52:51 +00:00
|
|
|
* $Revision: 1.21.22.2 $
|
2000-09-29 10:02:42 +00:00
|
|
|
*
|
2008-04-11 09:32:11 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-29 10:02:42 +00:00
|
|
|
*
|
2008-04-11 09:32:11 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-29 10:02:42 +00:00
|
|
|
*
|
2008-04-11 09:32:11 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-29 10:02:42 +00:00
|
|
|
*
|
2008-04-11 09:32:11 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-29 10:02:42 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 23:24:07 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_basctl.hxx"
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
#include <ide_pch.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
#define GLOBALOVERFLOW2
|
|
|
|
|
|
|
|
#include <sfx2/docfac.hxx>
|
|
|
|
#include <vcl/status.hxx>
|
|
|
|
|
2004-08-31 11:20:06 +00:00
|
|
|
#include <svx/xmlsecctrl.hxx>
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <basdoc.hxx>
|
|
|
|
|
|
|
|
#define BasicDocShell
|
2002-05-08 15:39:23 +00:00
|
|
|
#include <basslots.hxx>
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-07-20 09:49:36 +00:00
|
|
|
#include "basicmod.hxx"
|
2003-09-19 07:29:10 +00:00
|
|
|
#include "unomodel.hxx"
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-06-15 07:45:19 +00:00
|
|
|
TYPEINIT1(BasicDocShell, SfxObjectShell);
|
|
|
|
DBG_NAME(BasicDocShell);
|
|
|
|
|
2004-10-04 18:39:11 +00:00
|
|
|
SFX_IMPL_OBJECTFACTORY( BasicDocShell, SvGlobalName(), SFXOBJECTSHELL_STD_NORMAL, "sbasic" )
|
2003-09-19 07:29:10 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
SFX_IMPL_INTERFACE( BasicDocShell, SfxObjectShell, IDEResId( 0 ) )
|
|
|
|
{
|
2007-04-26 08:33:22 +00:00
|
|
|
SFX_STATUSBAR_REGISTRATION( IDEResId( SID_BASICIDE_STATUSBAR ) );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BasicDocShell::BasicDocShell( SfxObjectCreateMode eMode ) : SfxObjectShell( eMode )
|
|
|
|
{
|
|
|
|
pPrinter = 0;
|
|
|
|
SetPool( &SFX_APP()->GetPool() );
|
2007-03-15 14:51:10 +00:00
|
|
|
SetHasNoBasic();
|
2007-10-09 14:20:43 +00:00
|
|
|
SetModel( new SIDEModel(this) );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
__EXPORT BasicDocShell::~BasicDocShell()
|
|
|
|
{
|
|
|
|
delete pPrinter;
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxPrinter* BasicDocShell::GetPrinter( BOOL bCreate )
|
|
|
|
{
|
|
|
|
if ( !pPrinter && bCreate )
|
|
|
|
pPrinter = new SfxPrinter( new SfxItemSet( GetPool(), SID_PRINTER_NOTFOUND_WARN , SID_PRINTER_NOTFOUND_WARN ) );
|
|
|
|
|
|
|
|
return pPrinter;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BasicDocShell::SetPrinter( SfxPrinter* pPr )
|
|
|
|
{
|
|
|
|
if ( pPr != pPrinter )
|
|
|
|
{
|
|
|
|
delete pPrinter;
|
|
|
|
pPrinter = pPr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void BasicDocShell::FillStatusBar( StatusBar& rStatusBar )
|
|
|
|
{
|
|
|
|
String aTmp;
|
|
|
|
|
|
|
|
// Titel
|
|
|
|
aTmp.Fill( 30, 'X' );
|
|
|
|
rStatusBar.InsertItem( SID_BASICIDE_STAT_TITLE,
|
|
|
|
rStatusBar.GetTextWidth( aTmp ), SIB_AUTOSIZE | SIB_LEFT);
|
|
|
|
|
|
|
|
// Modify
|
|
|
|
rStatusBar.InsertItem( SID_DOC_MODIFIED,
|
|
|
|
rStatusBar.GetTextWidth( '*' ) );
|
|
|
|
|
2004-08-31 11:20:06 +00:00
|
|
|
// signatures
|
|
|
|
rStatusBar.InsertItem( SID_SIGNATURE, XmlSecStatusBarControl::GetDefItemWidth( rStatusBar ), SIB_USERDRAW );
|
|
|
|
rStatusBar.SetHelpId(SID_SIGNATURE, SID_SIGNATURE);
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
// Position
|
|
|
|
aTmp.Erase();
|
|
|
|
aTmp.Fill( 15, 'X' );
|
|
|
|
rStatusBar.InsertItem( SID_BASICIDE_STAT_POS,
|
|
|
|
rStatusBar.GetTextWidth( aTmp ), SIB_LEFT);
|
|
|
|
|
|
|
|
// Insert/Overwrite
|
|
|
|
rStatusBar.InsertItem( SID_ATTR_INSERT,
|
|
|
|
rStatusBar.GetTextWidth( String( RTL_CONSTASCII_USTRINGPARAM( "XXXXX" /* "EINFG" */ ) ) ) );
|
|
|
|
|
|
|
|
// Uhrzeit
|
|
|
|
aTmp.Fill( 20, 'X' );
|
|
|
|
rStatusBar.InsertItem( SID_ATTR_SIZE,
|
|
|
|
rStatusBar.GetTextWidth( aTmp ), SIB_AUTOSIZE | SIB_LEFT | SIB_USERDRAW );
|
|
|
|
|
|
|
|
// return pStatusBar;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-12-12 12:52:51 +00:00
|
|
|
void BasicDocShell::FillClass( SvGlobalName*, sal_uInt32*, String*, String*, String*, sal_Int32, sal_Bool bTemplate) const
|
|
|
|
{
|
|
|
|
(void)bTemplate;
|
|
|
|
DBG_ASSERT( bTemplate == sal_False, "No template for Basic" );
|
|
|
|
}
|
2004-10-04 18:39:11 +00:00
|
|
|
|
2007-01-16 15:27:22 +00:00
|
|
|
void BasicDocShell::Draw( OutputDevice *, const JobSetup &, USHORT )
|
2004-10-04 18:39:11 +00:00
|
|
|
{}
|
2000-09-29 10:02:42 +00:00
|
|
|
|