2010-10-12 15:57:08 +02:00
|
|
|
/* -*- 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
|
|
|
|
2011-11-21 23:33:54 -05:00
|
|
|
#include <vcl/msgbox.hxx>
|
2001-09-04 10:52:52 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <algorithm>
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <basic/basmgr.hxx>
|
|
|
|
#include <basic/sbmeth.hxx>
|
2005-04-13 08:50:48 +00:00
|
|
|
#include <basic/sbx.hxx>
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/moduleoptions.hxx>
|
2001-09-11 14:40:15 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <iderdll.hxx>
|
2001-09-11 14:40:15 +00:00
|
|
|
#include <iderdll2.hxx>
|
2000-09-29 10:02:42 +00:00
|
|
|
#include <basobj.hxx>
|
|
|
|
#include <basidesh.hxx>
|
|
|
|
#include <objdlg.hxx>
|
|
|
|
#include <bastypes.hxx>
|
2001-06-15 07:45:19 +00:00
|
|
|
#include <basdoc.hxx>
|
2007-03-15 14:54:47 +00:00
|
|
|
#include <basidesh.hrc>
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
#include <baside2.hxx>
|
2001-06-15 07:45:19 +00:00
|
|
|
#include <baside3.hxx>
|
2001-09-11 14:40:15 +00:00
|
|
|
#include <basicmod.hxx>
|
2007-01-02 14:50:19 +00:00
|
|
|
#include <localizationmgr.hxx>
|
2001-06-15 07:45:19 +00:00
|
|
|
#include "dlged.hxx"
|
2004-12-10 16:01:36 +00:00
|
|
|
#include <dlgeddef.hxx>
|
2001-06-15 07:45:19 +00:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2001-03-28 10:27:57 +00:00
|
|
|
#include <com/sun/star/script/XLibraryContainer.hpp>
|
2001-11-02 12:45:10 +00:00
|
|
|
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
|
2001-03-28 10:27:57 +00:00
|
|
|
#include <com/sun/star/container/XNameContainer.hpp>
|
2001-06-15 07:45:19 +00:00
|
|
|
#include <xmlscript/xmldlg_imexp.hxx>
|
2012-06-29 08:30:14 +02:00
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
2004-07-23 11:03:28 +00:00
|
|
|
#include <rtl/uri.hxx>
|
|
|
|
#include <osl/process.h>
|
|
|
|
#include <osl/file.hxx>
|
2001-03-28 10:27:57 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
2001-06-15 07:45:19 +00:00
|
|
|
using namespace comphelper;
|
2001-03-28 10:27:57 +00:00
|
|
|
using namespace ::com::sun::star;
|
2001-06-15 07:45:19 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::container;
|
2001-03-28 10:27:57 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2001-09-11 14:40:15 +00:00
|
|
|
extern "C" {
|
2008-12-30 13:32:01 +00:00
|
|
|
SAL_DLLPUBLIC_EXPORT long basicide_handle_basic_error( void* pPtr )
|
2001-09-11 14:40:15 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
return HandleBasicError( (StarBASIC*)pPtr );
|
2001-09-11 14:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
SbMethod* CreateMacro( SbModule* pModule, const String& rMacroName )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
SfxDispatcher* pDispatcher = GetDispatcher();
|
2000-09-29 10:02:42 +00:00
|
|
|
if( pDispatcher )
|
|
|
|
{
|
|
|
|
pDispatcher->Execute( SID_BASICIDE_STOREALLMODULESOURCES );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pModule->GetMethods()->Find( rMacroName, SbxCLASS_METHOD ) )
|
|
|
|
return 0;
|
|
|
|
|
2012-10-09 17:30:01 -03:00
|
|
|
OUString aMacroName( rMacroName );
|
|
|
|
if ( aMacroName.getLength() == 0 )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
if ( !pModule->GetMethods()->Count() )
|
2012-10-09 17:30:01 -03:00
|
|
|
aMacroName = "Main" ;
|
2000-09-29 10:02:42 +00:00
|
|
|
else
|
|
|
|
{
|
2012-07-26 01:28:37 +09:00
|
|
|
bool bValid = false;
|
2012-10-09 17:30:01 -03:00
|
|
|
OUString aStdMacroText( "Macro" );
|
2012-10-13 13:53:07 +04:00
|
|
|
sal_Int32 nMacro = 1;
|
2000-09-29 10:02:42 +00:00
|
|
|
while ( !bValid )
|
|
|
|
{
|
|
|
|
aMacroName = aStdMacroText;
|
2012-10-09 17:30:01 -03:00
|
|
|
aMacroName += OUString::valueOf( nMacro );
|
2011-08-22 11:39:37 +02:00
|
|
|
// test whether existing...
|
2012-07-26 01:28:37 +09:00
|
|
|
bValid = pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD ) ? false : true;
|
2000-09-29 10:02:42 +00:00
|
|
|
nMacro++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString aOUSource( pModule->GetSource32() );
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2011-08-22 11:39:37 +02:00
|
|
|
// don't produce too many empty lines...
|
2003-04-23 15:39:29 +00:00
|
|
|
sal_Int32 nSourceLen = aOUSource.getLength();
|
|
|
|
if ( nSourceLen > 2 )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2003-04-23 15:39:29 +00:00
|
|
|
const sal_Unicode* pStr = aOUSource.getStr();
|
|
|
|
if ( pStr[ nSourceLen - 1 ] != LINE_SEP )
|
2012-10-05 01:25:41 -03:00
|
|
|
aOUSource += "\n\n" ;
|
2003-04-23 15:39:29 +00:00
|
|
|
else if ( pStr[ nSourceLen - 2 ] != LINE_SEP )
|
2012-10-05 01:25:41 -03:00
|
|
|
aOUSource += "\n" ;
|
2003-04-23 15:39:29 +00:00
|
|
|
else if ( pStr[ nSourceLen - 3 ] == LINE_SEP )
|
|
|
|
aOUSource = aOUSource.copy( 0, nSourceLen-1 );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString aSubStr;
|
|
|
|
aSubStr = "Sub " ;
|
2000-09-29 10:02:42 +00:00
|
|
|
aSubStr += aMacroName;
|
2012-10-05 01:25:41 -03:00
|
|
|
aSubStr += "\n\nEnd Sub" ;
|
2000-09-29 10:02:42 +00:00
|
|
|
|
2003-04-23 15:39:29 +00:00
|
|
|
aOUSource += aSubStr;
|
2001-08-29 11:29:09 +00:00
|
|
|
|
|
|
|
// update module in library
|
2007-03-15 14:54:47 +00:00
|
|
|
ScriptDocument aDocument( ScriptDocument::NoDocument );
|
2012-08-07 14:33:56 +02:00
|
|
|
StarBASIC* pBasic = dynamic_cast<StarBASIC*>(pModule->GetParent());
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
DBG_ASSERT(pBasic, "basctl::CreateMacro: No Basic found!");
|
2001-08-29 11:29:09 +00:00
|
|
|
if ( pBasic )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BasicManager* pBasMgr = FindBasicManager( pBasic );
|
|
|
|
DBG_ASSERT(pBasMgr, "basctl::CreateMacro: No BasicManager found!");
|
2001-08-29 11:29:09 +00:00
|
|
|
if ( pBasMgr )
|
|
|
|
{
|
2007-03-15 14:54:47 +00:00
|
|
|
aDocument = ScriptDocument::getDocumentForBasicManager( pBasMgr );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
OSL_ENSURE( aDocument.isValid(), "basctl::CreateMacro: no document for the given BasicManager!" );
|
2007-03-15 14:54:47 +00:00
|
|
|
if ( aDocument.isValid() )
|
|
|
|
{
|
|
|
|
String aLibName = pBasic->GetName();
|
|
|
|
String aModName = pModule->GetName();
|
|
|
|
OSL_VERIFY( aDocument.updateModule( aLibName, aModName, aOUSource ) );
|
|
|
|
}
|
2001-08-29 11:29:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD );
|
2001-09-06 08:21:02 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
if( pDispatcher )
|
|
|
|
{
|
|
|
|
pDispatcher->Execute( SID_BASICIDE_UPDATEALLMODULESOURCES );
|
|
|
|
}
|
2001-08-29 11:29:09 +00:00
|
|
|
|
2007-10-09 14:22:16 +00:00
|
|
|
if ( aDocument.isAlive() )
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
MarkDocumentModified( aDocument );
|
2001-08-29 11:29:09 +00:00
|
|
|
|
2000-09-29 10:02:42 +00:00
|
|
|
return pMethod;
|
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
bool RenameDialog (
|
|
|
|
Window* pErrorParent,
|
|
|
|
ScriptDocument const& rDocument,
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString const& rLibName,
|
|
|
|
OUString const& rOldName,
|
|
|
|
OUString const& rNewName
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
)
|
2001-06-15 07:45:19 +00:00
|
|
|
throw(ElementExistException, NoSuchElementException)
|
|
|
|
{
|
2007-03-15 14:54:47 +00:00
|
|
|
if ( !rDocument.hasDialog( rLibName, rOldName ) )
|
2001-06-15 07:45:19 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
OSL_FAIL( "basctl::RenameDialog: old module name is invalid!" );
|
2007-03-15 14:54:47 +00:00
|
|
|
return false;
|
2001-06-15 07:45:19 +00:00
|
|
|
}
|
2007-03-15 14:54:47 +00:00
|
|
|
|
|
|
|
if ( rDocument.hasDialog( rLibName, rNewName ) )
|
2001-06-15 07:45:19 +00:00
|
|
|
{
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox aError( pErrorParent, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2) );
|
2007-03-15 14:54:47 +00:00
|
|
|
aError.Execute();
|
|
|
|
return false;
|
2001-06-15 07:45:19 +00:00
|
|
|
}
|
|
|
|
|
2007-08-03 08:58:33 +00:00
|
|
|
// #i74440
|
2011-12-10 02:54:11 -05:00
|
|
|
if ( rNewName.isEmpty() )
|
2007-08-03 08:58:33 +00:00
|
|
|
{
|
2012-04-29 23:36:57 +01:00
|
|
|
ErrorBox aError( pErrorParent, WB_OK | WB_DEF_OK, IDE_RESSTR(RID_STR_BADSBXNAME) );
|
2007-08-03 08:58:33 +00:00
|
|
|
aError.Execute();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Shell* pShell = GetShell();
|
|
|
|
DialogWindow* pWin = pShell ? pShell->FindDlgWin(rDocument, rLibName, rOldName) : 0;
|
2007-03-15 14:54:47 +00:00
|
|
|
Reference< XNameContainer > xExistingDialog;
|
|
|
|
if ( pWin )
|
2012-09-02 16:21:08 +02:00
|
|
|
xExistingDialog = pWin->GetEditor().GetDialog();
|
2001-06-15 07:45:19 +00:00
|
|
|
|
2007-03-15 14:54:47 +00:00
|
|
|
if ( xExistingDialog.is() )
|
|
|
|
LocalizationMgr::renameStringResourceIDs( rDocument, rLibName, rNewName, xExistingDialog );
|
2007-01-29 15:44:37 +00:00
|
|
|
|
2007-03-15 14:54:47 +00:00
|
|
|
if ( !rDocument.renameDialog( rLibName, rOldName, rNewName, xExistingDialog ) )
|
|
|
|
return false;
|
2001-06-15 07:45:19 +00:00
|
|
|
|
2007-01-29 15:44:37 +00:00
|
|
|
if ( pWin )
|
2001-06-15 07:45:19 +00:00
|
|
|
{
|
2007-01-29 15:44:37 +00:00
|
|
|
// set new name in window
|
|
|
|
pWin->SetName( rNewName );
|
2001-06-15 07:45:19 +00:00
|
|
|
|
2007-01-29 15:44:37 +00:00
|
|
|
// update property browser
|
2012-08-17 07:29:20 +02:00
|
|
|
pWin->UpdateBrowser();
|
2001-06-15 07:45:19 +00:00
|
|
|
|
2007-01-29 15:44:37 +00:00
|
|
|
// update tabwriter
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
sal_uInt16 nId = pShell->GetWindowId( pWin );
|
2007-01-29 15:44:37 +00:00
|
|
|
DBG_ASSERT( nId, "No entry in Tabbar!" );
|
|
|
|
if ( nId )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
TabBar& rTabBar = pShell->GetTabBar();
|
|
|
|
rTabBar.SetPageText( nId, rNewName );
|
|
|
|
rTabBar.Sort();
|
|
|
|
rTabBar.MakeVisible( rTabBar.GetCurPageId() );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
2007-03-15 14:54:47 +00:00
|
|
|
return true;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2012-10-05 01:25:41 -03:00
|
|
|
bool RemoveDialog( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (Shell* pShell = GetShell())
|
2007-01-02 14:50:19 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (DialogWindow* pDlgWin = pShell->FindDlgWin(rDocument, rLibName, rDlgName))
|
2007-01-02 14:50:19 +00:00
|
|
|
{
|
|
|
|
Reference< container::XNameContainer > xDialogModel = pDlgWin->GetDialog();
|
2007-03-15 14:54:47 +00:00
|
|
|
LocalizationMgr::removeResourceForDialog( rDocument, rLibName, rDlgName, xDialogModel );
|
2007-01-02 14:50:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-03-15 14:54:47 +00:00
|
|
|
return rDocument.removeDialog( rLibName, rDlgName );
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
StarBASIC* FindBasic( const SbxVariable* pVar )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 15:22:25 +02:00
|
|
|
SbxVariable const* pSbx = pVar;
|
|
|
|
while (pSbx && !dynamic_cast<StarBASIC const*>(pSbx))
|
2000-09-29 10:02:42 +00:00
|
|
|
pSbx = pSbx->GetParent();
|
2012-08-07 15:22:25 +02:00
|
|
|
return (StarBASIC*)pSbx;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
BasicManager* FindBasicManager( StarBASIC* pLib )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2007-10-09 14:22:16 +00:00
|
|
|
ScriptDocuments aDocuments( ScriptDocument::getAllScriptDocuments( ScriptDocument::AllWithApplication ) );
|
2007-03-15 14:54:47 +00:00
|
|
|
for ( ScriptDocuments::const_iterator doc = aDocuments.begin();
|
|
|
|
doc != aDocuments.end();
|
|
|
|
++doc
|
|
|
|
)
|
|
|
|
{
|
|
|
|
BasicManager* pBasicMgr = doc->getBasicManager();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
OSL_ENSURE( pBasicMgr, "basctl::FindBasicManager: no basic manager for the document!" );
|
2007-03-15 14:54:47 +00:00
|
|
|
if ( !pBasicMgr )
|
|
|
|
continue;
|
|
|
|
|
2012-10-05 01:25:41 -03:00
|
|
|
Sequence< OUString > aLibNames( doc->getLibraryNames() );
|
2001-09-03 10:56:10 +00:00
|
|
|
sal_Int32 nLibCount = aLibNames.getLength();
|
2012-10-05 01:25:41 -03:00
|
|
|
const OUString* pLibNames = aLibNames.getConstArray();
|
2001-09-03 10:56:10 +00:00
|
|
|
|
|
|
|
for ( sal_Int32 i = 0 ; i < nLibCount ; i++ )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2001-09-03 10:56:10 +00:00
|
|
|
StarBASIC* pL = pBasicMgr->GetLib( pLibNames[ i ] );
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( pL == pLib )
|
|
|
|
return pBasicMgr;
|
|
|
|
}
|
|
|
|
}
|
2007-03-15 14:54:47 +00:00
|
|
|
return NULL;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
void MarkDocumentModified( const ScriptDocument& rDocument )
|
2001-06-15 07:45:19 +00:00
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// does not have to come from a document...
|
2007-03-15 14:54:47 +00:00
|
|
|
if ( rDocument.isApplication() )
|
2001-09-26 14:25:17 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (Shell* pShell = GetShell())
|
2012-08-17 07:29:20 +02:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
pShell->SetAppBasicModified();
|
|
|
|
pShell->UpdateObjectCatalog();
|
2012-08-17 07:29:20 +02:00
|
|
|
}
|
2001-09-26 14:25:17 +00:00
|
|
|
}
|
2007-03-15 14:54:47 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
rDocument.setDocumentModified();
|
|
|
|
}
|
2001-06-15 07:45:19 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2003-04-24 13:08:39 +00:00
|
|
|
{
|
2004-08-31 11:20:43 +00:00
|
|
|
pBindings->Invalidate( SID_SIGNATURE );
|
2003-04-24 13:08:39 +00:00
|
|
|
pBindings->Invalidate( SID_SAVEDOC );
|
|
|
|
pBindings->Update( SID_SAVEDOC );
|
|
|
|
}
|
2001-06-15 07:45:19 +00:00
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
void RunMethod( SbMethod* pMethod )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
SbxValues aRes;
|
|
|
|
aRes.eType = SbxVOID;
|
|
|
|
pMethod->Get( aRes );
|
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
void StopBasic()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
|
|
|
StarBASIC::Stop();
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (Shell* pShell = GetShell())
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Shell::WindowTable& rWindows = pShell->GetWindowTable();
|
|
|
|
for (Shell::WindowTableIt it = rWindows.begin(); it != rWindows.end(); ++it )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pWin = it->second;
|
2011-08-22 11:39:37 +02:00
|
|
|
// call BasicStopped manually because the Stop-Notify
|
|
|
|
// might not get through otherwise
|
2000-09-29 10:02:42 +00:00
|
|
|
pWin->BasicStopped();
|
|
|
|
}
|
|
|
|
}
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BasicStopped();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void BasicStopped(
|
|
|
|
bool* pbAppWindowDisabled,
|
|
|
|
bool* pbDispatcherLocked,
|
|
|
|
sal_uInt16* pnWaitCount,
|
|
|
|
SfxUInt16Item** ppSWActionCount, SfxUInt16Item** ppSWLockViewCount
|
|
|
|
)
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-08-22 11:39:37 +02:00
|
|
|
// maybe there are some locks to be removed after an error
|
|
|
|
// or an explicit cancelling of the basic...
|
2000-09-29 10:02:42 +00:00
|
|
|
|
|
|
|
if ( pbAppWindowDisabled )
|
2012-07-27 10:35:28 +09:00
|
|
|
*pbAppWindowDisabled = false;
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( pbDispatcherLocked )
|
2012-07-27 10:35:28 +09:00
|
|
|
*pbDispatcherLocked = false;
|
2000-09-29 10:02:42 +00:00
|
|
|
if ( pnWaitCount )
|
|
|
|
*pnWaitCount = 0;
|
|
|
|
if ( ppSWActionCount )
|
|
|
|
*ppSWActionCount = 0;
|
|
|
|
if ( ppSWLockViewCount )
|
|
|
|
*ppSWLockViewCount = 0;
|
|
|
|
|
|
|
|
// AppWait ?
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (Shell* pShell = GetShell())
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2011-03-12 23:58:22 -06:00
|
|
|
sal_uInt16 nWait = 0;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
while ( pShell->GetViewFrame()->GetWindow().IsWait() )
|
2004-03-30 13:27:13 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
pShell->GetViewFrame()->GetWindow().LeaveWait();
|
2004-03-30 13:27:13 +00:00
|
|
|
nWait++;
|
|
|
|
}
|
|
|
|
if ( pnWaitCount )
|
|
|
|
*pnWaitCount = nWait;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Window* pDefParent = Application::GetDefDialogParent();
|
2000-10-19 08:19:37 +00:00
|
|
|
if ( pDefParent && !pDefParent->IsEnabled() )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2012-08-07 08:36:40 +02:00
|
|
|
pDefParent->Enable(true);
|
2004-01-06 16:12:59 +00:00
|
|
|
if ( pbAppWindowDisabled )
|
2012-07-27 10:35:28 +09:00
|
|
|
*pbAppWindowDisabled = true;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
void InvalidateDebuggerSlots()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (SfxBindings* pBindings = GetBindingsPtr())
|
2003-04-24 13:08:39 +00:00
|
|
|
{
|
|
|
|
pBindings->Invalidate( SID_BASICSTOP );
|
|
|
|
pBindings->Update( SID_BASICSTOP );
|
|
|
|
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_BASICIDE_TOGGLEBRKPNT );
|
|
|
|
pBindings->Update( SID_BASICIDE_TOGGLEBRKPNT );
|
|
|
|
pBindings->Invalidate( SID_BASICIDE_STAT_POS );
|
|
|
|
pBindings->Update( SID_BASICIDE_STAT_POS );
|
|
|
|
}
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
long HandleBasicError( StarBASIC* pBasic )
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
EnsureIde();
|
|
|
|
BasicStopped();
|
2001-09-11 14:40:15 +00:00
|
|
|
|
|
|
|
// no error output during macro choosing
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (GetExtraData()->ChoosingMacro())
|
2001-09-11 14:40:15 +00:00
|
|
|
return 1;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (GetExtraData()->ShellInCriticalSection())
|
2001-09-11 14:40:15 +00:00
|
|
|
return 2;
|
|
|
|
|
|
|
|
long nRet = 0;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
Shell* pShell = 0;
|
2001-09-11 14:40:15 +00:00
|
|
|
if ( SvtModuleOptions().IsBasicIDE() )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BasicManager* pBasMgr = FindBasicManager( pBasic );
|
2001-11-02 12:45:10 +00:00
|
|
|
if ( pBasMgr )
|
2001-09-11 14:40:15 +00:00
|
|
|
{
|
2012-07-26 01:28:37 +09:00
|
|
|
bool bProtected = false;
|
2007-03-15 14:54:47 +00:00
|
|
|
ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
OSL_ENSURE( aDocument.isValid(), "basctl::HandleBasicError: no document for the given BasicManager!" );
|
2007-03-15 14:54:47 +00:00
|
|
|
if ( aDocument.isValid() )
|
2001-11-02 12:45:10 +00:00
|
|
|
{
|
2012-10-05 01:25:41 -03:00
|
|
|
OUString aOULibName( pBasic->GetName() );
|
2007-03-15 14:54:47 +00:00
|
|
|
Reference< script::XLibraryContainer > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ) );
|
|
|
|
if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) )
|
2001-11-02 12:45:10 +00:00
|
|
|
{
|
2007-03-15 14:54:47 +00:00
|
|
|
Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
|
|
|
|
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
|
|
|
|
{
|
2012-07-26 01:28:37 +09:00
|
|
|
bProtected = true;
|
2007-03-15 14:54:47 +00:00
|
|
|
}
|
2001-11-02 12:45:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !bProtected )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
pShell = GetShell();
|
|
|
|
if ( !pShell )
|
2001-09-11 14:40:15 +00:00
|
|
|
{
|
2004-10-04 18:39:44 +00:00
|
|
|
SfxAllItemSet aArgs( SFX_APP()->GetPool() );
|
|
|
|
SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
|
|
|
|
SFX_APP()->ExecuteSlot( aRequest );
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
pShell = GetShell();
|
2001-09-11 14:40:15 +00:00
|
|
|
}
|
2001-11-02 12:45:10 +00:00
|
|
|
}
|
2001-09-11 14:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if ( pShell )
|
|
|
|
nRet = pShell->CallBasicErrorHdl( pBasic );
|
2001-09-11 14:40:15 +00:00
|
|
|
else
|
|
|
|
ErrorHandler::HandleError( StarBASIC::GetErrorCode() );
|
|
|
|
|
|
|
|
return nRet;
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-22 13:45:11 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-07-07 11:20:17 +00:00
|
|
|
SfxBindings* GetBindingsPtr()
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
2006-01-03 11:43:23 +00:00
|
|
|
SfxBindings* pBindings = NULL;
|
|
|
|
|
|
|
|
SfxViewFrame* pFrame = NULL;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (Shell* pShell = GetShell())
|
2000-09-29 10:02:42 +00:00
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
pFrame = pShell->GetViewFrame();
|
2000-09-29 10:02:42 +00:00
|
|
|
}
|
2002-11-01 10:36:29 +00:00
|
|
|
else
|
2006-01-03 11:43:23 +00:00
|
|
|
{
|
|
|
|
SfxViewFrame* pView = SfxViewFrame::GetFirst();
|
|
|
|
while ( pView )
|
|
|
|
{
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
if (dynamic_cast<DocShell*>(pView->GetObjectShell()))
|
2006-01-03 11:43:23 +00:00
|
|
|
{
|
|
|
|
pFrame = pView;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
pView = SfxViewFrame::GetNext( *pView );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( pFrame != NULL )
|
2002-11-01 10:36:29 +00:00
|
|
|
pBindings = &pFrame->GetBindings();
|
2006-01-03 11:43:23 +00:00
|
|
|
|
2002-11-01 10:36:29 +00:00
|
|
|
return pBindings;
|
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
//----------------------------------------------------------------------------
|
2008-07-07 11:20:17 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
SfxDispatcher* GetDispatcher ()
|
|
|
|
{
|
|
|
|
if (Shell* pShell = GetShell())
|
|
|
|
if (SfxViewFrame* pViewFrame = pShell->GetViewFrame())
|
|
|
|
if (SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher())
|
|
|
|
return pDispatcher;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
} // namespace basctl
|
2010-10-12 15:57:08 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|