Files
libreoffice/basctl/source/basicide/basidesh.cxx

1028 lines
35 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-06-12 17:02:47 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-29 10:02:42 +00:00
// CLOOKS:
#define _SPIN_HXX
#define _SOLAR__PRIVATE 1
#include <tools/diagnose_ex.h>
#include <basic/basmgr.hxx>
2000-09-29 10:02:42 +00:00
#include <basidesh.hrc>
#include <baside2.hxx>
2000-09-29 10:02:42 +00:00
#include <basdoc.hxx>
#include <basicbox.hxx>
#include <editeng/sizeitem.hxx>
2000-09-29 10:02:42 +00:00
#include <objdlg.hxx>
#include <tbxctl.hxx>
#include <iderdll2.hxx>
#include <basidectrlr.hxx>
#include <localizationmgr.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dinfdlg.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/minfitem.hxx>
#include <sfx2/objface.hxx>
#include <svl/aeitem.hxx>
#include <svl/intitem.hxx>
#include <svl/srchitem.hxx>
2000-09-29 10:02:42 +00:00
#define BasicIDEShell
#define SFX_TYPEMAP
#include <idetemp.hxx>
#include <basslots.hxx>
2000-09-29 10:02:42 +00:00
#include <iderdll.hxx>
#include <svx/pszctrl.hxx>
#include <svx/insctrl.hxx>
#include <svx/srchdlg.hxx>
#include <svx/tbcontrl.hxx>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <svx/xmlsecctrl.hxx>
#include <sfx2/viewfac.hxx>
2011-11-21 23:33:54 -05:00
#include <vcl/msgbox.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
using ::rtl::OUString;
typedef ::cppu::WeakImplHelper1< container::XContainerListener > ContainerListenerBASE;
class ContainerListenerImpl : public ContainerListenerBASE
{
BasicIDEShell* mpShell;
public:
ContainerListenerImpl( BasicIDEShell* pShell ) : mpShell( pShell ) {}
~ContainerListenerImpl()
{
}
2011-12-09 01:58:49 -05:00
void addContainerListener( const ScriptDocument& rScriptDocument, const ::rtl::OUString& aLibName )
{
try
{
uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, aLibName, sal_False ), uno::UNO_QUERY );
2010-05-06 13:02:31 +01:00
if ( xContainer.is() )
{
uno::Reference< container::XContainerListener > xContainerListener( this );
xContainer->addContainerListener( xContainerListener );
}
}
catch(const uno::Exception& ) {}
}
2011-12-09 01:58:49 -05:00
void removeContainerListener( const ScriptDocument& rScriptDocument, const ::rtl::OUString& aLibName )
{
try
{
uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, aLibName, sal_False ), uno::UNO_QUERY );
2010-05-06 13:02:31 +01:00
if ( xContainer.is() )
{
uno::Reference< container::XContainerListener > xContainerListener( this );
xContainer->removeContainerListener( xContainerListener );
}
}
catch(const uno::Exception& ) {}
}
// XEventListener
virtual void SAL_CALL disposing( const lang::EventObject& ) throw( uno::RuntimeException ) {}
// XContainerListener
virtual void SAL_CALL elementInserted( const container::ContainerEvent& Event ) throw( uno::RuntimeException )
{
rtl::OUString sModuleName;
if( mpShell && ( Event.Accessor >>= sModuleName ) )
mpShell->FindBasWin( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, true, false );
}
virtual void SAL_CALL elementReplaced( const container::ContainerEvent& ) throw( com::sun::star::uno::RuntimeException ) { }
virtual void SAL_CALL elementRemoved( const container::ContainerEvent& Event ) throw( com::sun::star::uno::RuntimeException )
{
rtl::OUString sModuleName;
if( mpShell && ( Event.Accessor >>= sModuleName ) )
{
IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, BASICIDE_TYPE_MODULE, sal_True );
if( pWin )
mpShell->RemoveWindow( pWin, sal_True, sal_True );
}
}
};
2000-09-29 10:02:42 +00:00
TYPEINIT1( BasicIDEShell, SfxViewShell );
SFX_IMPL_NAMED_VIEWFACTORY( BasicIDEShell, "Default" )
2000-09-29 10:02:42 +00:00
{
SFX_VIEW_REGISTRATION( BasicDocShell );
}
SFX_IMPL_INTERFACE( BasicIDEShell, SfxViewShell, IDEResId( RID_STR_IDENAME ) )
{
SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG );
SFX_FEATURED_CHILDWINDOW_REGISTRATION(SID_SHOW_PROPERTYBROWSER, BASICIDE_UI_FEATURE_SHOW_BROWSER);
SFX_POPUPMENU_REGISTRATION( IDEResId( RID_POPUP_DLGED ) );
2000-09-29 10:02:42 +00:00
}
2009-11-30 17:25:18 +01:00
#define IDE_VIEWSHELL_FLAGS SFX_VIEW_CAN_PRINT|SFX_VIEW_NO_NEWWINDOW
2000-09-29 10:02:42 +00:00
static sal_Int32 GnBasicIDEShellCount;
sal_Int32 getBasicIDEShellCount( void )
{ return GnBasicIDEShellCount; }
BasicIDEShell::BasicIDEShell( SfxViewFrame* pFrame_, SfxViewShell* /* pOldShell */ ) :
SfxViewShell( pFrame_, IDE_VIEWSHELL_FLAGS ),
m_aCurDocument( ScriptDocument::getApplicationScriptDocument() ),
2000-09-29 10:02:42 +00:00
aHScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_HSCROLL | WB_DRAG ) ),
aVScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_VSCROLL | WB_DRAG ) ),
2001-09-25 08:14:46 +00:00
aScrollBarBox( &GetViewFrame()->GetWindow(), WinBits( WB_SIZEABLE ) ),
m_bAppBasicModified( sal_False ),
m_aNotifier( *this )
2000-09-29 10:02:42 +00:00
{
m_xLibListener = new ContainerListenerImpl( this );
2000-09-29 10:02:42 +00:00
Init();
GnBasicIDEShellCount++;
2000-09-29 10:02:42 +00:00
}
void BasicIDEShell::Init()
{
TbxControls::RegisterControl( SID_CHOOSE_CONTROLS );
2000-09-29 10:02:42 +00:00
SvxPosSizeStatusBarControl::RegisterControl();
SvxInsertStatusBarControl::RegisterControl();
XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE );
SvxSimpleUndoRedoController::RegisterControl( SID_UNDO );
SvxSimpleUndoRedoController::RegisterControl( SID_REDO );
SvxSearchDialogWrapper::RegisterChildWindow( sal_False );
2000-09-29 10:02:42 +00:00
BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = true;
2000-09-29 10:02:42 +00:00
2011-12-09 01:58:49 -05:00
SetName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicIDE" ) ) );
2000-09-29 10:02:42 +00:00
SetHelpId( SVX_INTERFACE_BASIDE_VIEWSH );
LibBoxControl::RegisterControl( SID_BASICIDE_LIBSELECTOR );
LanguageBoxControl::RegisterControl( SID_BASICIDE_CURRENT_LANG );
2000-09-29 10:02:42 +00:00
CreateModulWindowLayout();
GetViewFrame()->GetWindow().SetBackground();
pCurWin = 0;
m_aCurDocument = ScriptDocument::getApplicationScriptDocument();
2000-09-29 10:02:42 +00:00
pObjectCatalog = 0;
bCreatingWindow = sal_False;
2000-09-29 10:02:42 +00:00
pTabBar = new BasicIDETabBar( &GetViewFrame()->GetWindow() );
pTabBar->SetSplitHdl( LINK( this, BasicIDEShell, TabBarSplitHdl ) );
bTabBarSplitted = sal_False;
2000-09-29 10:02:42 +00:00
nCurKey = 100;
InitScrollBars();
InitTabBar();
2011-12-09 01:58:49 -05:00
SetCurLib( ScriptDocument::getApplicationScriptDocument(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Standard")), false, false );
2000-09-29 10:02:42 +00:00
2011-08-24 11:13:33 +01:00
BasicIDEGlobals::ShellCreated(this);
BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = false;
2001-06-20 08:27:37 +00:00
// It's enough to create the controller ...
// It will be public by using magic :-)
new BasicIDEController( this );
// Force updating the title ! Because it must be set to the controller
// it has to be called directly after creating those controller.
SetMDITitle ();
2001-06-20 08:27:37 +00:00
UpdateWindows();
2000-09-29 10:02:42 +00:00
}
2010-12-11 22:45:31 +01:00
BasicIDEShell::~BasicIDEShell()
2000-09-29 10:02:42 +00:00
{
m_aNotifier.dispose();
2011-08-24 11:13:33 +01:00
BasicIDEGlobals::ShellDestroyed(this);
2000-09-29 10:02:42 +00:00
// so that on a basic saving error, the shell doesn't pop right up again
BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = true;
2000-09-29 10:02:42 +00:00
SetWindow( 0 );
SetCurWindow( 0 );
for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
2000-09-29 10:02:42 +00:00
{
// no store; does already happen when the BasicManagers are destroyed
delete it->second;
2000-09-29 10:02:42 +00:00
}
aIDEWindowTable.clear();
2000-09-29 10:02:42 +00:00
delete pTabBar;
delete pObjectCatalog;
DestroyModulWindowLayout();
ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() );
// Destroy all ContainerListeners for Basic Container.
if ( pListener )
pListener->removeContainerListener( m_aCurDocument, m_aCurLibName );
BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = false;
GnBasicIDEShellCount--;
2000-09-29 10:02:42 +00:00
}
void BasicIDEShell::onDocumentCreated( const ScriptDocument& /*_rDocument*/ )
{
if(pCurWin && pCurWin->IsA( TYPE(ModulWindow)))
{
dynamic_cast<ModulWindow*>(pCurWin)->SetLineNumberDisplay(SourceLinesDisplayed());
}
UpdateWindows();
}
void BasicIDEShell::onDocumentOpened( const ScriptDocument& /*_rDocument*/ )
{
if(pCurWin && pCurWin->IsA( TYPE(ModulWindow)))
{
dynamic_cast<ModulWindow*>(pCurWin)->SetLineNumberDisplay(SourceLinesDisplayed());
}
UpdateWindows();
}
void BasicIDEShell::onDocumentSave( const ScriptDocument& /*_rDocument*/ )
{
StoreAllWindowData();
}
void BasicIDEShell::onDocumentSaveDone( const ScriptDocument& /*_rDocument*/ )
{
// #i115671: Update SID_SAVEDOC after saving is completed
SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
if ( pBindings )
pBindings->Invalidate( SID_SAVEDOC );
}
void BasicIDEShell::onDocumentSaveAs( const ScriptDocument& /*_rDocument*/ )
{
StoreAllWindowData();
}
void BasicIDEShell::onDocumentSaveAsDone( const ScriptDocument& /*_rDocument*/ )
{
// not interested in
}
void BasicIDEShell::onDocumentClosed( const ScriptDocument& _rDocument )
{
if ( !_rDocument.isValid() )
return;
bool bSetCurWindow = false;
2008-10-16 06:57:26 +00:00
bool bSetCurLib = ( _rDocument == m_aCurDocument );
std::vector<IDEBaseWindow*> aDeleteVec;
2008-10-16 06:57:26 +00:00
// remove all windows which belong to this document
for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
{
IDEBaseWindow* pWin = it->second;
2008-10-16 06:57:26 +00:00
if ( pWin->IsDocument( _rDocument ) )
{
2008-10-16 06:57:26 +00:00
if ( pWin->GetStatus() & (BASWIN_RUNNINGBASIC|BASWIN_INRESCHEDULE) )
{
2008-10-16 06:57:26 +00:00
pWin->AddStatus( BASWIN_TOBEKILLED );
pWin->Hide();
StarBASIC::Stop();
// there's no notify
pWin->BasicStopped();
}
else
aDeleteVec.push_back( pWin );
}
}
// delete windows outside main loop so we don't invalidate the original iterator
for( std::vector<IDEBaseWindow*>::const_iterator it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
{
IDEBaseWindow* pWin = *it;
pWin->StoreData();
if ( pWin == pCurWin )
bSetCurWindow = true;
RemoveWindow( pWin, sal_True, sal_False );
}
2008-10-16 06:57:26 +00:00
// remove lib info
2011-08-24 11:13:33 +01:00
BasicIDEData* pData = BasicIDEGlobals::GetExtraData();
2008-10-16 06:57:26 +00:00
if ( pData )
pData->GetLibInfos().RemoveInfoFor( _rDocument );
if ( bSetCurLib )
2011-12-09 01:58:49 -05:00
SetCurLib( ScriptDocument::getApplicationScriptDocument(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Standard")), true, false );
else if ( bSetCurWindow )
SetCurWindow( FindApplicationWindow(), true );
}
void BasicIDEShell::onDocumentTitleChanged( const ScriptDocument& /*_rDocument*/ )
{
SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
if ( pBindings )
pBindings->Invalidate( SID_BASICIDE_LIBSELECTOR, sal_True, sal_False );
SetMDITitle();
}
void BasicIDEShell::onDocumentModeChanged( const ScriptDocument& _rDocument )
{
for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
{
IDEBaseWindow* pWin = it->second;
if ( pWin->IsDocument( _rDocument ) && _rDocument.isDocument() )
pWin->SetReadOnly( _rDocument.isReadOnly() );
}
}
void BasicIDEShell::StoreAllWindowData( sal_Bool bPersistent )
2000-09-29 10:02:42 +00:00
{
for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
2000-09-29 10:02:42 +00:00
{
IDEBaseWindow* pWin = it->second;
2000-09-29 10:02:42 +00:00
DBG_ASSERT( pWin, "PrepareClose: NULL-Pointer in Table?" );
if ( !pWin->IsSuspended() )
pWin->StoreData();
}
if ( bPersistent )
2000-09-29 10:02:42 +00:00
{
SFX_APP()->SaveBasicAndDialogContainer();
SetAppBasicModified( sal_False );
2000-09-29 10:02:42 +00:00
SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
if ( pBindings )
{
pBindings->Invalidate( SID_SAVEDOC );
pBindings->Update( SID_SAVEDOC );
}
2000-09-29 10:02:42 +00:00
}
}
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101 * commit 'ooo/DEV300_m101': (185 commits) masterfix DEV300: #i10000# usage of L10N build_type masterfix: #i10000# INT16 -> sal_Int16 fixed compile errors after resync to m100, part2 gridsort: post-rebase fixes CWS gnumake3: found another tools integer type removetooltypes01: Fix build problems after rebase to DEV300m99 in basctl, cui, reportdesign, sw native359: #i114398# changing mac langpack icon native359: #i115669# fixing package description for solaris packages gnumake3: remove comphelper version; fix including extract.hxx locales34: #i106785# add Haitian_Haiti [ht-HT] to language list and locale data; locale data contributed by <jcpoulard> sb138: #i116659# timely termination of OnLogRotateThread accfixes: removed include of obsolete header file accfixes: removed obsolete file removetooltypes01: #i112600# Fix build problems on non-pro accfixes: moved some shared strings to svx part2 accfixes: moved some shared strings to svx accfixes: added more accessibility information and fixed tab orders in multiple dialogs (cui module) removetooltypes01: #i112600# Remove tools types for Mac specific parts fixed tab order in BasicIDE, Library dialog tab page added some accessible names in BasicIDE ... Conflicts: UnoControls/source/base/registercontrols.cxx accessibility/inc/accessibility/standard/vclxaccessiblelistboxlist.hxx automation/inc/automation/communi.hxx automation/inc/automation/simplecm.hxx automation/source/communi/communi.cxx automation/source/inc/rcontrol.hxx automation/source/miniapp/servuid.hxx automation/source/server/XMLParser.cxx automation/source/server/cmdbasestream.cxx automation/source/server/profiler.hxx automation/source/server/recorder.cxx automation/source/server/retstrm.hxx automation/source/server/server.cxx automation/source/server/sta_list.cxx automation/source/server/statemnt.cxx automation/source/server/statemnt.hxx automation/source/simplecm/packethandler.cxx automation/source/simplecm/simplecm.cxx automation/source/simplecm/tcpio.cxx automation/source/simplecm/tcpio.hxx automation/source/testtool/comm_bas.hxx automation/source/testtool/cretstrm.hxx automation/source/testtool/httprequest.cxx automation/source/testtool/httprequest.hxx automation/source/testtool/objtest.cxx automation/source/testtool/objtest.hxx basctl/source/basicide/baside2.cxx basctl/source/basicide/baside2.hxx basctl/source/basicide/baside2b.cxx basctl/source/basicide/baside3.cxx basctl/source/basicide/basides1.cxx basctl/source/basicide/basides2.cxx basctl/source/basicide/basidesh.cxx basctl/source/basicide/basidesh.src basctl/source/basicide/basobj3.cxx basctl/source/basicide/bastype2.cxx basctl/source/basicide/bastype3.cxx basctl/source/basicide/bastypes.cxx basctl/source/basicide/brkdlg.cxx basctl/source/basicide/iderdll.cxx basctl/source/basicide/macrodlg.cxx basctl/source/basicide/moduldl2.cxx basctl/source/basicide/moduldlg.cxx basctl/source/basicide/objdlg.cxx basctl/source/basicide/scriptdocument.cxx basctl/source/basicide/tbxctl.cxx basctl/source/basicide/tbxctl.hxx basctl/source/basicide/tbxctl.src basctl/source/dlged/dlged.cxx basctl/source/dlged/dlgedfunc.cxx basctl/source/dlged/dlgedobj.cxx basctl/source/inc/basidesh.hxx basctl/source/inc/bastypes.hxx basctl/source/inc/dlgedmod.hxx basctl/source/inc/dlgedpage.hxx crashrep/prj/build.lst cui/inc/pch/precompiled_cui.hxx cui/source/customize/acccfg.cxx cui/source/customize/acccfg.hrc cui/source/customize/acccfg.src cui/source/customize/cfg.cxx cui/source/customize/cfgutil.cxx cui/source/customize/macropg.cxx cui/source/customize/macropg.src cui/source/customize/selector.cxx cui/source/dialogs/SpellDialog.cxx cui/source/dialogs/commonlingui.cxx cui/source/dialogs/cuicharmap.cxx cui/source/dialogs/cuifmsearch.cxx cui/source/dialogs/cuigaldlg.cxx cui/source/dialogs/cuigrfflt.cxx cui/source/dialogs/hldocntp.cxx cui/source/dialogs/hldoctp.cxx cui/source/dialogs/hlinettp.cxx cui/source/dialogs/hlmailtp.cxx cui/source/dialogs/hlmarkwn.cxx cui/source/dialogs/hlmarkwn.src cui/source/dialogs/hltpbase.cxx cui/source/dialogs/iconcdlg.cxx cui/source/dialogs/passwdomdlg.cxx cui/source/dialogs/pastedlg.cxx cui/source/dialogs/scriptdlg.cxx cui/source/dialogs/thesdlg.cxx cui/source/dialogs/zoom.cxx cui/source/factory/dlgfact.hxx cui/source/inc/SpellDialog.hxx cui/source/inc/autocdlg.hxx cui/source/inc/backgrnd.hxx cui/source/inc/bbdlg.hxx cui/source/inc/cfg.hxx cui/source/inc/cfgutil.hxx cui/source/inc/cuigaldlg.hxx cui/source/inc/cuigrfflt.hxx cui/source/inc/cuitabarea.hxx cui/source/inc/cuitabline.hxx cui/source/inc/hldocntp.hxx cui/source/inc/hltpbase.hxx cui/source/inc/iconcdlg.hxx cui/source/inc/numpages.hxx cui/source/inc/page.hxx cui/source/inc/postdlg.hxx cui/source/inc/scriptdlg.hxx cui/source/inc/transfrm.hxx cui/source/inc/zoom.hxx cui/source/options/cfgchart.cxx cui/source/options/cuisrchdlg.cxx cui/source/options/dbregister.cxx cui/source/options/dbregister.src cui/source/options/fontsubs.cxx cui/source/options/internationaloptions.cxx cui/source/options/optasian.cxx cui/source/options/optchart.cxx cui/source/options/optcolor.cxx cui/source/options/optcolor.src cui/source/options/optfltr.cxx cui/source/options/optfltr.src cui/source/options/optgdlg.cxx cui/source/options/optgdlg.src cui/source/options/optgenrl.cxx cui/source/options/opthtml.cxx cui/source/options/optimprove.cxx cui/source/options/optinet2.cxx cui/source/options/optinet2.hxx cui/source/options/optjava.cxx cui/source/options/optlingu.cxx cui/source/options/optsave.cxx cui/source/options/optsave.hxx cui/source/options/treeopt.cxx cui/source/options/webconninfo.cxx cui/source/tabpages/autocdlg.cxx cui/source/tabpages/backgrnd.cxx cui/source/tabpages/border.cxx cui/source/tabpages/chardlg.cxx cui/source/tabpages/dstribut.cxx cui/source/tabpages/grfpage.cxx cui/source/tabpages/macroass.cxx cui/source/tabpages/measure.cxx cui/source/tabpages/numfmt.cxx cui/source/tabpages/numpages.cxx cui/source/tabpages/page.cxx cui/source/tabpages/paragrph.cxx cui/source/tabpages/swpossizetabpage.cxx cui/source/tabpages/tabarea.src cui/source/tabpages/textanim.cxx cui/source/tabpages/textattr.cxx cui/source/tabpages/tparea.cxx cui/source/tabpages/tpbitmap.cxx cui/source/tabpages/tpcolor.cxx cui/source/tabpages/tpgradnt.cxx cui/source/tabpages/tphatch.cxx cui/source/tabpages/tpline.cxx cui/source/tabpages/tplnedef.cxx cui/source/tabpages/tplneend.cxx cui/source/tabpages/tpshadow.cxx cui/source/tabpages/transfrm.cxx embedserv/source/embed/register.cxx extensions/inc/pch/precompiled_extensions.hxx extensions/inc/propctrlr.hrc extensions/source/abpilot/abpservices.cxx extensions/source/bibliography/bibload.cxx extensions/source/bibliography/datman.cxx extensions/source/bibliography/general.cxx extensions/source/dbpilots/dbpservices.cxx extensions/source/inc/componentmodule.cxx extensions/source/nsplugin/source/so_env.cxx extensions/source/ole/oleobjw.cxx extensions/source/ole/oleobjw.hxx extensions/source/oooimprovement/invite_job.cxx extensions/source/oooimprovement/onlogrotate_job.cxx extensions/source/plugin/base/service.cxx extensions/source/plugin/inc/plugin/unx/mediator.hxx extensions/source/plugin/inc/plugin/unx/plugcon.hxx extensions/source/plugin/unx/mediator.cxx extensions/source/plugin/unx/nppapi.cxx extensions/source/plugin/unx/plugcon.cxx extensions/source/preload/services.cxx extensions/source/propctrlr/formmetadata.cxx extensions/source/propctrlr/pcrservices.cxx extensions/source/resource/resource.cxx extensions/source/scanner/sane.hxx extensions/source/scanner/sanedlg.cxx extensions/source/scanner/scanunx.cxx extensions/source/scanner/scanwin.cxx extensions/source/scanner/twain.cxx extensions/source/scanner/twain.hxx extensions/source/update/check/updatecheckconfig.cxx extensions/test/stm/datatest.cxx extensions/test/stm/marktest.cxx extensions/test/stm/pipetest.cxx extensions/test/stm/testfactreg.cxx extensions/workben/testpgp.cxx forms/qa/complex/forms/CheckOGroupBoxModel.java forms/qa/makefile.mk forms/source/component/Button.cxx forms/source/component/Button.hxx forms/source/component/ListBox.cxx forms/source/inc/forms_module_impl.hxx forms/source/misc/services.cxx forms/source/solar/control/navtoolbar.cxx javainstaller2/prj/build.lst javainstaller2/src/JavaSetup/org/openoffice/setup/Util/ModuleCtrl.java lingucomponent/prj/build.lst lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx lingucomponent/source/spellcheck/spell/sreg.cxx lingucomponent/source/spellcheck/spell/sspellimp.cxx package/source/manifest/ManifestExport.cxx package/source/manifest/UnoRegister.cxx package/source/xstor/owriteablestream.cxx package/source/xstor/owriteablestream.hxx package/source/xstor/xstorage.hxx package/source/zippackage/ZipPackageFolder.cxx package/source/zippackage/ZipPackageStream.cxx setup_native/source/mac/ooo/DS_Store setup_native/source/win32/customactions/shellextensions/registerextensions.cxx xmlsecurity/prj/build.lst xmlsecurity/source/component/registerservices.cxx xmlsecurity/source/dialogs/stbcontrl.cxx xmlsecurity/source/framework/xsec_framework.cxx xmlsecurity/source/xmlsec/xsec_xmlsec.cxx xmlsecurity/tools/demo/util.hxx xmlsecurity/workben/signaturetest.cxx
2011-03-09 16:20:50 -06:00
sal_uInt16 BasicIDEShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
2000-09-29 10:02:42 +00:00
{
(void)bForBrowsing;
// reset here because it's modified after printing etc. (DocInfo)
GetViewFrame()->GetObjectShell()->SetModified(sal_False);
2000-09-29 10:02:42 +00:00
if ( StarBASIC::IsRunning() )
{
if( bUI )
{
Window *pParent = &GetViewFrame()->GetWindow();
InfoBox( pParent, IDE_RESSTR(RID_STR_CANNOTCLOSE)).Execute();
}
return sal_False;
2000-09-29 10:02:42 +00:00
}
else
{
sal_Bool bCanClose = sal_True;
2012-04-16 21:14:57 +02:00
for (IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); bCanClose && (it != aIDEWindowTable.end()); ++it)
2000-09-29 10:02:42 +00:00
{
2012-04-16 21:14:57 +02:00
IDEBaseWindow* pWin = it->second;
if ( !pWin->CanClose() )
2000-09-29 10:02:42 +00:00
{
2011-12-09 01:58:49 -05:00
if ( !m_aCurLibName.isEmpty() && ( pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName ) )
SetCurLib( ScriptDocument::getApplicationScriptDocument(), ::rtl::OUString(), false );
SetCurWindow( pWin, true );
bCanClose = sal_False;
2000-09-29 10:02:42 +00:00
}
}
if ( bCanClose )
StoreAllWindowData( sal_False ); // don't write on the disk, that will be done later automatically
2000-09-29 10:02:42 +00:00
return bCanClose;
}
}
void BasicIDEShell::InitScrollBars()
{
aVScrollBar.SetLineSize( 300 );
aVScrollBar.SetPageSize( 2000 );
aHScrollBar.SetLineSize( 300 );
aHScrollBar.SetPageSize( 2000 );
aHScrollBar.Enable();
aVScrollBar.Enable();
aVScrollBar.Show();
aHScrollBar.Show();
aScrollBarBox.Show();
}
void BasicIDEShell::InitTabBar()
{
pTabBar->Enable();
pTabBar->Show();
pTabBar->SetSelectHdl( LINK( this, BasicIDEShell, TabBarHdl ) );
}
2010-12-11 22:45:31 +01:00
Size BasicIDEShell::GetOptimalSizePixel() const
2000-09-29 10:02:42 +00:00
{
return Size( 400, 300 );
}
2010-12-11 22:45:31 +01:00
void BasicIDEShell::OuterResizePixel( const Point &rPos, const Size &rSize )
2000-09-29 10:02:42 +00:00
{
AdjustPosSizePixel( rPos, rSize );
}
IMPL_LINK_INLINE_START( BasicIDEShell, TabBarSplitHdl, TabBar *, pTBar )
{
(void)pTBar;
bTabBarSplitted = sal_True;
2000-09-29 10:02:42 +00:00
ArrangeTabBar();
return 0;
}
IMPL_LINK_INLINE_END( BasicIDEShell, TabBarSplitHdl, TabBar *, pTBar )
IMPL_LINK( BasicIDEShell, TabBarHdl, TabBar *, pCurTabBar )
{
sal_uInt16 nCurId = pCurTabBar->GetCurPageId();
IDEBaseWindow* pWin = aIDEWindowTable[ nCurId ];
2000-09-29 10:02:42 +00:00
DBG_ASSERT( pWin, "Eintrag in TabBar passt zu keinem Fenster!" );
SetCurWindow( pWin );
return 0;
}
sal_Bool BasicIDEShell::NextPage( sal_Bool bPrev )
{
sal_Bool bRet = sal_False;
sal_uInt16 nPos = pTabBar->GetPagePos( pTabBar->GetCurPageId() );
if ( bPrev )
--nPos;
else
++nPos;
if ( nPos < pTabBar->GetPageCount() )
{
IDEBaseWindow* pWin = aIDEWindowTable[ pTabBar->GetPageId( nPos ) ];
SetCurWindow( pWin, true );
bRet = sal_True;
}
return bRet;
}
2000-09-29 10:02:42 +00:00
void BasicIDEShell::ArrangeTabBar()
{
long nBoxPos = aScrollBarBox.GetPosPixel().X() - 1;
long nPos = pTabBar->GetSplitSize();
if ( nPos <= nBoxPos )
{
Point aPnt( pTabBar->GetPosPixel() );
long nH = aHScrollBar.GetSizePixel().Height();
pTabBar->SetPosSizePixel( aPnt, Size( nPos, nH ) );
long nScrlStart = aPnt.X() + nPos;
aHScrollBar.SetPosSizePixel( Point( nScrlStart, aPnt.Y() ), Size( nBoxPos - nScrlStart + 2, nH ) );
aHScrollBar.Update();
}
}
::svl::IUndoManager* BasicIDEShell::GetUndoManager()
2000-09-29 10:02:42 +00:00
{
::svl::IUndoManager* pMgr = NULL;
2000-09-29 10:02:42 +00:00
if( pCurWin )
pMgr = pCurWin->GetUndoManager();
return pMgr;
}
void BasicIDEShell::ShowObjectDialog( sal_Bool bShow, sal_Bool bCreateOrDestroy )
2000-09-29 10:02:42 +00:00
{
if ( bShow )
{
if ( !pObjectCatalog && bCreateOrDestroy )
{
pObjectCatalog = new ObjectCatalog( &GetViewFrame()->GetWindow() );
// position is memorized in BasicIDEData and adjusted by the Dlg
if ( pObjectCatalog )
{
pObjectCatalog->SetCancelHdl( LINK( this, BasicIDEShell, ObjectDialogCancelHdl ) );
pObjectCatalog->SetCurrentEntry(pCurWin);
}
2000-09-29 10:02:42 +00:00
}
// the very last changes...
2000-09-29 10:02:42 +00:00
if ( pCurWin )
pCurWin->StoreData();
if ( pObjectCatalog )
{
pObjectCatalog->UpdateEntries();
pObjectCatalog->Show();
}
}
else if ( pObjectCatalog )
{
pObjectCatalog->Hide();
if ( bCreateOrDestroy )
{
// pObjectCatalog to NULL before the delete because of OS/2-focus-problem
2000-09-29 10:02:42 +00:00
ObjectCatalog* pTemp = pObjectCatalog;
pObjectCatalog = 0;
delete pTemp;
}
}
}
2010-12-11 22:45:31 +01:00
void BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
2000-09-29 10:02:42 +00:00
const SfxHint& rHint, const TypeId& )
{
2011-08-24 11:13:33 +01:00
if ( BasicIDEGlobals::GetShell() )
2000-09-29 10:02:42 +00:00
{
if ( rHint.IsA( TYPE( SfxSimpleHint ) ) )
2000-09-29 10:02:42 +00:00
{
switch ( ((SfxSimpleHint&)rHint).GetId() )
2000-09-29 10:02:42 +00:00
{
case SFX_HINT_DYING:
2000-09-29 10:02:42 +00:00
{
EndListening( rBC, sal_True /* log off all */ );
if ( pObjectCatalog )
pObjectCatalog->UpdateEntries();
2000-09-29 10:02:42 +00:00
}
break;
2000-09-29 10:02:42 +00:00
}
if ( rHint.IsA( TYPE( SbxHint ) ) )
2000-09-29 10:02:42 +00:00
{
SbxHint& rSbxHint = (SbxHint&)rHint;
sal_uLong nHintId = rSbxHint.GetId();
if ( ( nHintId == SBX_HINT_BASICSTART ) ||
( nHintId == SBX_HINT_BASICSTOP ) )
2000-09-29 10:02:42 +00:00
{
SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
if ( pBindings )
{
pBindings->Invalidate( SID_BASICRUN );
pBindings->Update( SID_BASICRUN );
pBindings->Invalidate( SID_BASICCOMPILE );
pBindings->Update( SID_BASICCOMPILE );
pBindings->Invalidate( SID_BASICSTEPOVER );
pBindings->Update( SID_BASICSTEPOVER );
pBindings->Invalidate( SID_BASICSTEPINTO );
pBindings->Update( SID_BASICSTEPINTO );
pBindings->Invalidate( SID_BASICSTEPOUT );
pBindings->Update( SID_BASICSTEPOUT );
pBindings->Invalidate( SID_BASICSTOP );
pBindings->Update( SID_BASICSTOP );
pBindings->Invalidate( SID_BASICIDE_TOGGLEBRKPNT );
pBindings->Update( SID_BASICIDE_TOGGLEBRKPNT );
pBindings->Invalidate( SID_BASICIDE_MANAGEBRKPNTS );
pBindings->Update( SID_BASICIDE_MANAGEBRKPNTS );
pBindings->Invalidate( SID_BASICIDE_MODULEDLG );
pBindings->Update( SID_BASICIDE_MODULEDLG );
pBindings->Invalidate( SID_BASICLOAD );
pBindings->Update( SID_BASICLOAD );
}
if ( nHintId == SBX_HINT_BASICSTOP )
{
// not only at error/break or explicit stoppage,
// if the update is turned off due to a programming bug
BasicIDE::BasicStopped();
UpdateModulWindowLayout( true ); // clear...
if( m_pCurLocalizationMgr )
m_pCurLocalizationMgr->handleBasicStopped();
}
else if( m_pCurLocalizationMgr )
{
m_pCurLocalizationMgr->handleBasicStarted();
}
2000-09-29 10:02:42 +00:00
for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin();
it != aIDEWindowTable.end(); ++it )
{
IDEBaseWindow* pWin = it->second;
if ( nHintId == SBX_HINT_BASICSTART )
pWin->BasicStarted();
else
pWin->BasicStopped();
}
2000-09-29 10:02:42 +00:00
}
}
}
}
}
void BasicIDEShell::CheckWindows()
{
bool bSetCurWindow = false;
std::vector<IDEBaseWindow*> aDeleteVec;
for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
2000-09-29 10:02:42 +00:00
{
IDEBaseWindow* pWin = it->second;
2000-09-29 10:02:42 +00:00
if ( pWin->GetStatus() & BASWIN_TOBEKILLED )
aDeleteVec.push_back( pWin );
}
for ( std::vector<IDEBaseWindow*>::const_iterator it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
{
IDEBaseWindow* pWin = *it;
pWin->StoreData();
if ( pWin == pCurWin )
bSetCurWindow = true;
RemoveWindow( pWin, sal_True, sal_False );
2000-09-29 10:02:42 +00:00
}
if ( bSetCurWindow )
SetCurWindow( FindApplicationWindow(), true );
2000-09-29 10:02:42 +00:00
}
2011-12-09 01:58:49 -05:00
void BasicIDEShell::RemoveWindows( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, sal_Bool bDestroy )
2000-09-29 10:02:42 +00:00
{
sal_Bool bChangeCurWindow = pCurWin ? sal_False : sal_True;
std::vector<IDEBaseWindow*> aDeleteVec;
for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
2000-09-29 10:02:42 +00:00
{
IDEBaseWindow* pWin = it->second;
if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName )
aDeleteVec.push_back( pWin );
}
for ( std::vector<IDEBaseWindow*>::const_iterator it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
{
IDEBaseWindow* pWin = *it;
if ( pWin == pCurWin )
bChangeCurWindow = sal_True;
pWin->StoreData();
RemoveWindow( pWin, bDestroy, sal_False );
2000-09-29 10:02:42 +00:00
}
if ( bChangeCurWindow )
SetCurWindow( FindApplicationWindow(), true );
2000-09-29 10:02:42 +00:00
}
void BasicIDEShell::UpdateWindows()
{
// remove all windows that may not be displayed
sal_Bool bChangeCurWindow = pCurWin ? sal_False : sal_True;
2011-12-09 01:58:49 -05:00
if ( !m_aCurLibName.isEmpty() )
2000-09-29 10:02:42 +00:00
{
std::vector<IDEBaseWindow*> aDeleteVec;
for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
2000-09-29 10:02:42 +00:00
{
IDEBaseWindow* pWin = it->second;
if ( !pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName )
2000-09-29 10:02:42 +00:00
{
if ( pWin == pCurWin )
bChangeCurWindow = sal_True;
2000-09-29 10:02:42 +00:00
pWin->StoreData();
// The request of RUNNING prevents the crash when in reschedule.
// Window is frozen at first, later the windows should be changed
// anyway to be marked as hidden instead of being deleted.
2000-09-29 10:02:42 +00:00
if ( !(pWin->GetStatus() & ( BASWIN_TOBEKILLED | BASWIN_RUNNINGBASIC | BASWIN_SUSPENDED ) ) )
aDeleteVec.push_back( pWin );
2000-09-29 10:02:42 +00:00
}
}
for ( std::vector<IDEBaseWindow*>::const_iterator it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
{
RemoveWindow( *it, sal_False, sal_False );
}
2000-09-29 10:02:42 +00:00
}
if ( bCreatingWindow )
return;
IDEBaseWindow* pNextActiveWindow = 0;
2000-09-29 10:02:42 +00:00
// show all windows that are to be shown
ScriptDocuments aDocuments( ScriptDocument::getAllScriptDocuments( ScriptDocument::AllWithApplication ) );
for ( ScriptDocuments::const_iterator doc = aDocuments.begin();
doc != aDocuments.end();
++doc
)
2000-09-29 10:02:42 +00:00
{
StartListening( *doc->getBasicManager(), sal_True /* log on only once */ );
2000-09-29 10:02:42 +00:00
// libraries
Sequence< ::rtl::OUString > aLibNames( doc->getLibraryNames() );
sal_Int32 nLibCount = aLibNames.getLength();
const ::rtl::OUString* pLibNames = aLibNames.getConstArray();
for ( sal_Int32 i = 0 ; i < nLibCount ; i++ )
{
2011-12-09 01:58:49 -05:00
::rtl::OUString aLibName = pLibNames[ i ];
2011-12-09 01:58:49 -05:00
if ( m_aCurLibName.isEmpty() || ( *doc == m_aCurDocument && aLibName == m_aCurLibName ) )
{
// check, if library is password protected and not verified
sal_Bool bProtected = sal_False;
Reference< script::XLibraryContainer > xModLibContainer( doc->getLibraryContainer( E_SCRIPTS ) );
if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) )
2000-09-29 10:02:42 +00:00
{
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) )
{
bProtected = sal_True;
}
}
if ( !bProtected )
{
LibInfoItem* pLibInfoItem = 0;
2011-08-24 11:13:33 +01:00
BasicIDEData* pData = BasicIDEGlobals::GetExtraData();
if ( pData )
pLibInfoItem = pData->GetLibInfos().GetInfo( LibInfoKey( *doc, aLibName ) );
2000-09-29 10:02:42 +00:00
// modules
if ( xModLibContainer.is() && xModLibContainer->hasByName( aLibName ) )
{
StarBASIC* pLib = doc->getBasicManager()->GetLib( aLibName );
if ( pLib )
ImplStartListening( pLib );
try
2000-09-29 10:02:42 +00:00
{
Sequence< ::rtl::OUString > aModNames( doc->getObjectNames( E_SCRIPTS, aLibName ) );
sal_Int32 nModCount = aModNames.getLength();
const ::rtl::OUString* pModNames = aModNames.getConstArray();
2001-06-15 07:45:19 +00:00
for ( sal_Int32 j = 0 ; j < nModCount ; j++ )
{
2011-12-04 20:17:29 -05:00
::rtl::OUString aModName = pModNames[ j ];
ModulWindow* pWin = FindBasWin( *doc, aLibName, aModName, false );
if ( !pWin )
pWin = CreateBasWin( *doc, aLibName, aModName );
if ( !pNextActiveWindow && pLibInfoItem && pLibInfoItem->GetCurrentName() == aModName &&
pLibInfoItem->GetCurrentType() == BASICIDE_TYPE_MODULE )
{
pNextActiveWindow = (IDEBaseWindow*)pWin;
}
}
}
catch (const container::NoSuchElementException& )
{
DBG_UNHANDLED_EXCEPTION();
}
}
// dialogs
Reference< script::XLibraryContainer > xDlgLibContainer( doc->getLibraryContainer( E_DIALOGS ) );
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) )
{
try
{
Sequence< ::rtl::OUString > aDlgNames = doc->getObjectNames( E_DIALOGS, aLibName );
sal_Int32 nDlgCount = aDlgNames.getLength();
const ::rtl::OUString* pDlgNames = aDlgNames.getConstArray();
for ( sal_Int32 j = 0 ; j < nDlgCount ; j++ )
{
2011-12-04 20:17:29 -05:00
::rtl::OUString aDlgName = pDlgNames[ j ];
// this find only looks for non-suspended windows;
// suspended windows are handled in CreateDlgWin
DialogWindow* pWin = FindDlgWin( *doc, aLibName, aDlgName, false );
if ( !pWin )
pWin = CreateDlgWin( *doc, aLibName, aDlgName );
if ( !pNextActiveWindow && pLibInfoItem && pLibInfoItem->GetCurrentName() == aDlgName &&
pLibInfoItem->GetCurrentType() == BASICIDE_TYPE_DIALOG )
{
pNextActiveWindow = (IDEBaseWindow*)pWin;
}
}
}
catch (const container::NoSuchElementException& )
{
DBG_UNHANDLED_EXCEPTION();
}
2000-09-29 10:02:42 +00:00
}
}
}
}
}
if ( bChangeCurWindow )
{
if ( !pNextActiveWindow )
pNextActiveWindow = FindApplicationWindow();
SetCurWindow( pNextActiveWindow, true );
}
2000-09-29 10:02:42 +00:00
}
void BasicIDEShell::RemoveWindow( IDEBaseWindow* pWindow_, sal_Bool bDestroy, sal_Bool bAllowChangeCurWindow )
2000-09-29 10:02:42 +00:00
{
DBG_ASSERT( pWindow_, "Kann keinen NULL-Pointer loeschen!" );
sal_uLong nKey = GetIDEWindowId( pWindow_ );
pTabBar->RemovePage( (sal_uInt16)nKey );
aIDEWindowTable.erase( nKey );
if ( pWindow_ == pCurWin )
2000-09-29 10:02:42 +00:00
{
if ( bAllowChangeCurWindow )
SetCurWindow( FindApplicationWindow(), true );
2000-09-29 10:02:42 +00:00
else
SetCurWindow( NULL, false );
2000-09-29 10:02:42 +00:00
}
if ( bDestroy )
{
if ( !( pWindow_->GetStatus() & BASWIN_INRESCHEDULE ) )
2000-09-29 10:02:42 +00:00
{
delete pWindow_;
2000-09-29 10:02:42 +00:00
}
else
{
pWindow_->AddStatus( BASWIN_TOBEKILLED );
pWindow_->Hide();
// In normal mode stop basic in windows to be deleted
// In VBA stop basic only if the running script is trying to delete
// its parent module
bool bStop = true;
if ( pWindow_->GetDocument().isInVBAMode() )
{
SbModule* pMod = StarBASIC::GetActiveModule();
2011-12-09 01:58:49 -05:00
if ( !pMod || ( pMod && ( !pMod->GetName().Equals(pWindow_->GetName()) ) ) )
bStop = false;
}
if ( bStop )
{
StarBASIC::Stop();
// there will be no notify...
pWindow_->BasicStopped();
}
aIDEWindowTable[ nKey ] = pWindow_; // jump in again
2000-09-29 10:02:42 +00:00
}
}
else
{
pWindow_->Hide();
pWindow_->AddStatus( BASWIN_SUSPENDED );
pWindow_->Deactivating();
aIDEWindowTable[ nKey ] = pWindow_; // jump in again
2000-09-29 10:02:42 +00:00
}
}
sal_uInt16 BasicIDEShell::InsertWindowInTable( IDEBaseWindow* pNewWin )
2000-09-29 10:02:42 +00:00
{
nCurKey++;
aIDEWindowTable[ nCurKey ] = pNewWin;
2000-09-29 10:02:42 +00:00
return nCurKey;
}
void BasicIDEShell::InvalidateBasicIDESlots()
{
// only those that have an optic effect...
2011-08-24 11:13:33 +01:00
if ( BasicIDEGlobals::GetShell() )
{
SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
if ( pBindings )
{
pBindings->Invalidate( SID_UNDO );
pBindings->Invalidate( SID_REDO );
pBindings->Invalidate( SID_SAVEDOC );
pBindings->Invalidate( SID_SIGNATURE );
pBindings->Invalidate( SID_BASICIDE_CHOOSEMACRO );
pBindings->Invalidate( SID_BASICIDE_MODULEDLG );
pBindings->Invalidate( SID_BASICIDE_OBJCAT );
pBindings->Invalidate( SID_BASICSTOP );
pBindings->Invalidate( SID_BASICRUN );
pBindings->Invalidate( SID_BASICCOMPILE );
pBindings->Invalidate( SID_BASICLOAD );
pBindings->Invalidate( SID_BASICSAVEAS );
pBindings->Invalidate( SID_BASICIDE_MATCHGROUP );
pBindings->Invalidate( SID_BASICSTEPINTO );
pBindings->Invalidate( SID_BASICSTEPOVER );
pBindings->Invalidate( SID_BASICSTEPOUT );
pBindings->Invalidate( SID_BASICIDE_TOGGLEBRKPNT );
pBindings->Invalidate( SID_BASICIDE_MANAGEBRKPNTS );
pBindings->Invalidate( SID_BASICIDE_ADDWATCH );
pBindings->Invalidate( SID_BASICIDE_REMOVEWATCH );
pBindings->Invalidate( SID_CHOOSE_CONTROLS );
pBindings->Invalidate( SID_PRINTDOC );
pBindings->Invalidate( SID_PRINTDOCDIRECT );
pBindings->Invalidate( SID_SETUPPRINTER );
pBindings->Invalidate( SID_DIALOG_TESTMODE );
pBindings->Invalidate( SID_DOC_MODIFIED );
pBindings->Invalidate( SID_BASICIDE_STAT_TITLE );
pBindings->Invalidate( SID_BASICIDE_STAT_POS );
pBindings->Invalidate( SID_ATTR_INSERT );
pBindings->Invalidate( SID_ATTR_SIZE );
}
}
2000-09-29 10:02:42 +00:00
}
void BasicIDEShell::EnableScrollbars( sal_Bool bEnable )
2000-09-29 10:02:42 +00:00
{
if ( bEnable )
{
aHScrollBar.Enable();
aVScrollBar.Enable();
}
else
{
aHScrollBar.Disable();
aVScrollBar.Disable();
}
}
2011-12-09 01:58:49 -05:00
void BasicIDEShell::SetCurLib( const ScriptDocument& rDocument, ::rtl::OUString aLibName, bool bUpdateWindows, bool bCheck )
2000-09-29 10:02:42 +00:00
{
if ( !bCheck || ( rDocument != m_aCurDocument || aLibName != m_aCurLibName ) )
{
ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() );
m_aCurDocument = rDocument;
m_aCurLibName = aLibName;
2011-04-28 00:59:28 +02:00
if ( pListener )
{
pListener->removeContainerListener( m_aCurDocument, m_aCurLibName );
pListener->addContainerListener( m_aCurDocument, aLibName );
}
if ( bUpdateWindows )
UpdateWindows();
SetMDITitle();
SetCurLibForLocalization( rDocument, aLibName );
SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
if ( pBindings )
{
pBindings->Invalidate( SID_BASICIDE_LIBSELECTOR );
pBindings->Invalidate( SID_BASICIDE_CURRENT_LANG );
pBindings->Invalidate( SID_BASICIDE_MANAGE_LANG );
}
}
2000-09-29 10:02:42 +00:00
}
2011-12-09 01:58:49 -05:00
void BasicIDEShell::SetCurLibForLocalization( const ScriptDocument& rDocument, ::rtl::OUString aLibName )
{
// Create LocalizationMgr
Reference< resource::XStringResourceManager > xStringResourceManager;
try
{
2011-12-09 01:58:49 -05:00
if( !aLibName.isEmpty() )
{
Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, sal_True ) );
xStringResourceManager = LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
}
}
catch (const container::NoSuchElementException& )
{}
2012-01-20 20:23:06 -05:00
m_pCurLocalizationMgr = boost::shared_ptr<LocalizationMgr>(new LocalizationMgr(this, rDocument, aLibName, xStringResourceManager));
m_pCurLocalizationMgr->handleTranslationbar();
}
2000-09-29 10:02:42 +00:00
void BasicIDEShell::ImplStartListening( StarBASIC* pBasic )
{
StartListening( pBasic->GetBroadcaster(), sal_True /* log on only once */ );
2000-09-29 10:02:42 +00:00
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */