summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/basobj2.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2001-07-20 09:49:36 +0000
committerMathias Bauer <mba@openoffice.org>2001-07-20 09:49:36 +0000
commitf4bf709f0b9e55124a2233a4f90084b8d1428518 (patch)
tree3a14b9437fc78854957c98168d2d9fe211b3840e /basctl/source/basicide/basobj2.cxx
parentab8adb94b8d3b94a2efc82d9207721208466456c (diff)
#88563#: BasicIDE on demand
Diffstat (limited to 'basctl/source/basicide/basobj2.cxx')
-rw-r--r--basctl/source/basicide/basobj2.cxx36
1 files changed, 19 insertions, 17 deletions
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 2c637dab8..04accbf92 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: basobj2.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: tbe $ $Date: 2001-07-17 08:43:30 $
+ * last change: $Author: mba $ $Date: 2001-07-20 10:49:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,7 @@
#include <moduldlg.hxx>
#include <basidesh.hxx>
#include <baside2.hxx>
+#include <basicmod.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -116,17 +117,17 @@ SbMethod* BasicIDE::ChooseMacro( BOOL bExecute, BOOL bChooseOnly )
SFX_APP()->EnterBasicCall();
SbMethod* pMethod = NULL;
-
+
Window* pParent = Application::GetDefDialogParent();
-
+
MacroChooser* pChooser = new MacroChooser( pParent, TRUE );
if ( bChooseOnly || !SvtModuleOptions().IsBasicIDE() )
pChooser->SetMode( MACROCHOOSER_CHOOSEONLY );
-
+
short nRetValue = pChooser->Execute();
-
+
IDE_DLL()->GetExtraData()->ChoosingMacro() = FALSE;
-
+
switch ( nRetValue )
{
case MACRO_OK_RUN:
@@ -229,6 +230,7 @@ void BasicIDE::DecBasicDialogCount()
String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly, const String& rPreferredMacroDesciption )
{
+ BASIC_MOD()->Load();
if ( rPreferredMacroDesciption.Len() )
IDE_DLL()->GetExtraData()->GetLastMacro() = rPreferredMacroDesciption;
@@ -237,17 +239,17 @@ String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly, const String& rPr
String aMacroURL;
SbMethod* pMethod = NULL;
-
+
Window* pParent = Application::GetDefDialogParent();
-
+
MacroChooser* pChooser = new MacroChooser( pParent, TRUE );
if ( bChooseOnly || !SvtModuleOptions().IsBasicIDE() )
pChooser->SetMode( MACROCHOOSER_CHOOSEONLY );
-
+
short nRetValue = pChooser->Execute();
-
+
IDE_DLL()->GetExtraData()->ChoosingMacro() = FALSE;
-
+
switch ( nRetValue )
{
case MACRO_OK_RUN:
@@ -310,7 +312,7 @@ String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly, const String& rPr
}
}
}
-
+
if ( pMethod && bExecute )
{
pMethod->AddRef(); // festhalten, bis Event abgearbeitet.
@@ -382,7 +384,7 @@ Reference< container::XNameContainer > BasicIDE::GetModuleLibrary( SfxObjectShel
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicIDE::GetModuleLibrary: NoSuchElementException!") ),
Reference<XInterface>() );
}
-
+
// load library
if( bLoadLibrary && !xLibContainer->isLibraryLoaded( aOULibName ) )
xLibContainer->loadLibrary( aOULibName );
@@ -412,7 +414,7 @@ BOOL BasicIDE::HasModule( SfxObjectShell* pShell, const String& rLibName, const
catch ( container::NoSuchElementException& e )
{
ByteString aBStr( String(e.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aBStr.GetBuffer() );
+ DBG_ERROR( aBStr.GetBuffer() );
}
return bHasModule;
@@ -559,7 +561,7 @@ void BasicIDE::RenameModule( SfxObjectShell* pShell, const String& rLibName, con
// insert module by new name in module container
xLib->insertByName( aOUNewName, aElement );
- }
+ }
else
{
throw NoSuchElementException(
@@ -569,7 +571,7 @@ void BasicIDE::RenameModule( SfxObjectShell* pShell, const String& rLibName, con
BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
if ( pIDEShell )
- {
+ {
IDEBaseWindow* pWin = pIDEShell->FindWindow( pShell, rLibName, rOldName, BASICIDE_TYPE_MODULE, FALSE );
if ( pWin )
{