summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-24 11:13:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-24 11:21:43 +0100
commita47d863ddc9c7a9e3dc54264a8ddcdedd8035636 (patch)
treee2b2f1f33c1b39be132edbd1674f2c6a66a6f5c4 /basctl
parent8d2d9ce5f4323ec2542acf57f52a26d5826bcc3b (diff)
hide this class
Diffstat (limited to 'basctl')
-rw-r--r--basctl/inc/iderdll.hxx26
-rw-r--r--basctl/source/basicide/basicbox.cxx6
-rw-r--r--basctl/source/basicide/baside2.cxx4
-rw-r--r--basctl/source/basicide/baside2b.cxx6
-rw-r--r--basctl/source/basicide/baside3.cxx14
-rw-r--r--basctl/source/basicide/basides1.cxx10
-rw-r--r--basctl/source/basicide/basidesh.cxx25
-rw-r--r--basctl/source/basicide/basobj2.cxx8
-rw-r--r--basctl/source/basicide/basobj3.cxx29
-rw-r--r--basctl/source/basicide/bastypes.cxx10
-rw-r--r--basctl/source/basicide/brkdlg.cxx4
-rw-r--r--basctl/source/basicide/iderdll.cxx55
-rw-r--r--basctl/source/basicide/localizationmgr.cxx2
-rw-r--r--basctl/source/basicide/macrodlg.cxx18
-rw-r--r--basctl/source/basicide/moduldl2.cxx26
-rw-r--r--basctl/source/basicide/moduldlg.cxx14
-rw-r--r--basctl/source/basicide/objdlg.cxx12
-rw-r--r--basctl/source/dlged/dlged.cxx4
-rw-r--r--basctl/source/dlged/managelang.cxx2
19 files changed, 151 insertions, 124 deletions
diff --git a/basctl/inc/iderdll.hxx b/basctl/inc/iderdll.hxx
index 2b89991e5ff7..04e0a38fee57 100644
--- a/basctl/inc/iderdll.hxx
+++ b/basctl/inc/iderdll.hxx
@@ -29,31 +29,19 @@
#ifndef _IDERDLL_HXX
#define _IDERDLL_HXX
-namespace BasicIDEGlobals
-{
- void ensure();
-}
-
class BasicIDEShell;
class BasicIDEData;
-class BasicIDEDLL
+namespace BasicIDEGlobals
{
- friend class BasicIDEShell;
-
- BasicIDEShell* pShell;
- BasicIDEData* pExtraData;
-
-public:
- BasicIDEDLL();
- ~BasicIDEDLL();
+ void ensure();
- BasicIDEShell* GetShell() const { return pShell; }
- BasicIDEData* GetExtraData();
- static BasicIDEDLL* GetDLL();
-};
+ void ShellCreated(BasicIDEShell* pShell);
+ BasicIDEShell* GetShell();
+ void ShellDestroyed(BasicIDEShell* pShell);
-#define IDE_DLL() BasicIDEDLL::GetDLL()
+ BasicIDEData* GetExtraData();
+}
#endif //_IDERDLL_HXX
diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx
index 9dd874b7c69f..2a5a7ca78a07 100644
--- a/basctl/source/basicide/basicbox.cxx
+++ b/basctl/source/basicide/basicbox.cxx
@@ -335,7 +335,7 @@ void BasicLibBox::NotifyIDE()
SfxUsrAnyItem aDocumentItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, uno::makeAny( aDocument.getDocumentOrNull() ) );
String aLibName = pEntry->GetLibName();
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if ( pDispatcher )
@@ -426,7 +426,7 @@ void BasicLanguageBox::FillBox()
m_sCurrentText = GetSelectEntry();
ClearBox();
- LocalizationMgr* pCurMgr = IDE_DLL()->GetShell()->GetCurLocalizationMgr();
+ LocalizationMgr* pCurMgr = BasicIDEGlobals::GetShell()->GetCurLocalizationMgr();
if ( pCurMgr->isLibraryLocalized() )
{
Enable();
@@ -487,7 +487,7 @@ void BasicLanguageBox::SetLanguage()
{
LanguageEntry* pEntry = (LanguageEntry*)GetEntryData( GetSelectEntryPos() );
if ( pEntry )
- IDE_DLL()->GetShell()->GetCurLocalizationMgr()->handleSetCurrentLocale( pEntry->m_aLocale );
+ BasicIDEGlobals::GetShell()->GetCurLocalizationMgr()->handleSetCurrentLocale( pEntry->m_aLocale );
}
void BasicLanguageBox::Select()
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 745431ad184e..98e1b74e3d59 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -278,7 +278,7 @@ void ModulWindow::CheckCompileBasic()
{
sal_Bool bDone = sal_False;
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
pIDEShell->GetViewFrame()->GetWindow().EnterWait();
if( bModified )
@@ -1196,7 +1196,7 @@ sal_Bool ModulWindow::IsModified()
void ModulWindow::GoOnTop()
{
- IDE_DLL()->GetShell()->GetViewFrame()->ToTop();
+ BasicIDEGlobals::GetShell()->GetViewFrame()->ToTop();
}
String ModulWindow::GetSbModuleName()
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 5a1d41b3c3b3..42aadbfd5bc2 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -568,7 +568,7 @@ void EditorWindow::CreateEditEngine()
// nLines*4: SetText+Formatting+DoHighlight+Formatting
// it could be cut down on one formatting but you would wait even longer
// for the text then if the source code is long...
- pProgress = new ProgressInfo( IDE_DLL()->GetShell()->GetViewFrame()->GetObjectShell(), String( IDEResId( RID_STR_GENERATESOURCE ) ), nLines*4 );
+ pProgress = new ProgressInfo( BasicIDEGlobals::GetShell()->GetViewFrame()->GetObjectShell(), String( IDEResId( RID_STR_GENERATESOURCE ) ), nLines*4 );
setTextEngineText( pEditEngine, aOUSource );
pEditView->SetStartDocPos( Point( 0, 0 ) );
@@ -897,7 +897,7 @@ void EditorWindow::ParagraphInsertedDeleted( sal_uLong nPara, sal_Bool bInserted
void EditorWindow::CreateProgress( const String& rText, sal_uLong nRange )
{
DBG_ASSERT( !pProgress, "ProgressInfo existiert schon" );
- pProgress = new ProgressInfo( IDE_DLL()->GetShell()->GetViewFrame()->GetObjectShell(), rText, nRange );
+ pProgress = new ProgressInfo( BasicIDEGlobals::GetShell()->GetViewFrame()->GetObjectShell(), rText, nRange );
}
void EditorWindow::DestroyProgress()
@@ -1390,7 +1390,7 @@ IMPL_LINK_INLINE_START( WatchWindow, ButtonHdl, ImageButton *, pButton )
{
if ( pButton == &aRemoveWatchButton )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 833cc158a1fd..ebfdc5ee944f 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -201,7 +201,7 @@ void DialogWindow::KeyInput( const KeyEvent& rKEvt )
{
if( rKEvt.GetKeyCode() == KEY_BACKSPACE )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -233,7 +233,7 @@ void DialogWindow::Command( const CommandEvent& rCEvt )
}
else if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if ( pDispatcher )
@@ -328,7 +328,7 @@ void DialogWindow::GetState( SfxItemSet& rSet )
case SID_DIALOG_TESTMODE:
{
// is the IDE still active?
- if( IDE_DLL()->GetShell()->GetFrame() )
+ if( BasicIDEGlobals::GetShell()->GetFrame() )
{
rSet.Put( SfxBoolItem( SID_DIALOG_TESTMODE,
(pEditor->GetMode() == DLGED_TEST) ? sal_True : sal_False) );
@@ -394,7 +394,7 @@ void DialogWindow::GetState( SfxItemSet& rSet )
case SID_SHOW_PROPERTYBROWSER:
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
if ( pViewFrame && !pViewFrame->HasChildWindow( SID_SHOW_PROPERTYBROWSER ) && !pEditor->GetView()->AreObjectsMarked() )
rSet.DisableItem( nWh );
@@ -645,7 +645,7 @@ sal_Bool DialogWindow::RenameDialog( const String& rNewName )
void DialogWindow::DisableBrowser()
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow(SID_SHOW_PROPERTYBROWSER) : NULL;
if( pChildWin )
@@ -654,7 +654,7 @@ void DialogWindow::DisableBrowser()
void DialogWindow::UpdateBrowser()
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow(SID_SHOW_PROPERTYBROWSER) : NULL;
if( pChildWin )
@@ -1043,7 +1043,7 @@ sal_Bool implImportDialog( Window* pWin, const String& rCurPath, const ScriptDoc
}
}
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if( pIDEShell == NULL )
{
OSL_ASSERT( pIDEShell != NULL );
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 24beb73747be..d693d6b19fa8 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -145,7 +145,7 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
if ( rItem.ISA( SvxSearchItem ) )
{
// memorize item because of the adjustments...
- IDE_DLL()->GetExtraData()->SetSearchItem( (const SvxSearchItem&)rItem );
+ BasicIDEGlobals::GetExtraData()->SetSearchItem( (const SvxSearchItem&)rItem );
sal_uInt16 nFound = 0;
sal_Bool bCanceled = sal_False;
if ( ((const SvxSearchItem&)rItem).GetCommand() == SVX_SEARCHCMD_REPLACE_ALL )
@@ -915,7 +915,7 @@ void BasicIDEShell::GetState(SfxItemSet &rSet)
case SID_SEARCH_ITEM:
{
String aSelected = GetSelectionText( sal_True );
- SvxSearchItem& rItem = IDE_DLL()->GetExtraData()->GetSearchItem();
+ SvxSearchItem& rItem = BasicIDEGlobals::GetExtraData()->GetSearchItem();
rItem.SetSearchString( aSelected );
rSet.Put( rItem );
}
@@ -1089,7 +1089,7 @@ void BasicIDEShell::SetCurWindow( IDEBaseWindow* pNewWin, sal_Bool bUpdateTabBar
if ( bRememberAsCurrent )
{
- BasicIDEData* pData = IDE_DLL()->GetExtraData();
+ BasicIDEData* pData = BasicIDEGlobals::GetExtraData();
if ( pData )
{
sal_uInt16 nCurrentType = pCurWin->IsA( TYPE( ModulWindow ) ) ? BASICIDE_TYPE_MODULE : BASICIDE_TYPE_DIALOG;
@@ -1103,7 +1103,7 @@ void BasicIDEShell::SetCurWindow( IDEBaseWindow* pNewWin, sal_Bool bUpdateTabBar
pCurWin->Init();
- if ( !IDE_DLL()->GetExtraData()->ShellInCriticalSection() )
+ if ( !BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() )
{
Window* pFrameWindow = &GetViewFrame()->GetWindow();
Window* pFocusWindow = Application::GetFocusWindow();
@@ -1249,7 +1249,7 @@ long BasicIDEShell::CallBasicBreakHdl( StarBASIC* pBasic )
if ( nWaitCount )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
for ( sal_uInt16 n = 0; n < nWaitCount; n++ )
pIDEShell->GetViewFrame()->GetWindow().EnterWait();
}
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index c8c21c88c96d..0b969de9e64e 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -204,7 +204,7 @@ void BasicIDEShell::Init()
SvxSearchDialogWrapper::RegisterChildWindow( sal_False );
- IDE_DLL()->GetExtraData()->ShellInCriticalSection() = sal_True;
+ BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = sal_True;
SetName( String( RTL_CONSTASCII_USTRINGPARAM( "BasicIDE" ) ) );
SetHelpId( SVX_INTERFACE_BASIDE_VIEWSH );
@@ -233,10 +233,9 @@ void BasicIDEShell::Init()
SetCurLib( ScriptDocument::getApplicationScriptDocument(), String::CreateFromAscii( "Standard" ), false, false );
- if ( IDE_DLL() && IDE_DLL()->pShell == NULL )
- IDE_DLL()->pShell = this;
+ BasicIDEGlobals::ShellCreated(this);
- IDE_DLL()->GetExtraData()->ShellInCriticalSection() = sal_False;
+ BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = sal_False;
// It's enough to create the controller ...
// It will be public by using magic :-)
@@ -253,11 +252,11 @@ BasicIDEShell::~BasicIDEShell()
{
m_aNotifier.dispose();
- if ( IDE_DLL() && IDE_DLL()->pShell == this )
- IDE_DLL()->pShell = NULL;
+ BasicIDEGlobals::ShellDestroyed(this);
-
- IDE_DLL()->GetExtraData()->ShellInCriticalSection() = sal_True;
+ // Damit bei einem Basic-Fehler beim Speichern die Shell nicht sofort
+ // wieder hoch kommt:
+ BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = sal_True;
SetWindow( 0 );
SetCurWindow( 0 );
@@ -281,7 +280,7 @@ BasicIDEShell::~BasicIDEShell()
if ( pListener )
pListener->removeContainerListener( m_aCurDocument, m_aCurLibName );
- IDE_DLL()->GetExtraData()->ShellInCriticalSection() = sal_False;
+ BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() = sal_False;
GnBasicIDEShellCount--;
}
@@ -352,7 +351,7 @@ void BasicIDEShell::onDocumentClosed( const ScriptDocument& _rDocument )
}
// remove lib info
- BasicIDEData* pData = IDE_DLL()->GetExtraData();
+ BasicIDEData* pData = BasicIDEGlobals::GetExtraData();
if ( pData )
pData->GetLibInfos().RemoveInfoFor( _rDocument );
@@ -602,7 +601,7 @@ void BasicIDEShell::ShowObjectDialog( sal_Bool bShow, sal_Bool bCreateOrDestroy
void BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
const SfxHint& rHint, const TypeId& )
{
- if ( IDE_DLL()->GetShell() )
+ if ( BasicIDEGlobals::GetShell() )
{
if ( rHint.IsA( TYPE( SfxSimpleHint ) ) )
{
@@ -788,7 +787,7 @@ void BasicIDEShell::UpdateWindows()
if ( !bProtected )
{
LibInfoItem* pLibInfoItem = 0;
- BasicIDEData* pData = IDE_DLL()->GetExtraData();
+ BasicIDEData* pData = BasicIDEGlobals::GetExtraData();
if ( pData )
pLibInfoItem = pData->GetLibInfos().GetInfo( LibInfoKey( *doc, aLibName ) );
@@ -934,7 +933,7 @@ void BasicIDEShell::InvalidateBasicIDESlots()
{
// only those that have an optic effect...
- if ( IDE_DLL()->GetShell() )
+ if ( BasicIDEGlobals::GetShell() )
{
SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
if ( pBindings )
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index ef79e588912a..7954b0929c29 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -89,7 +89,7 @@ void Organize( sal_Int16 tabId )
BasicIDEGlobals::ensure();
BasicEntryDescriptor aDesc;
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
{
IDEBaseWindow* pCurWin = pIDEShell->GetCurWindow();
@@ -195,7 +195,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const
if ( !rDocument.renameModule( rLibName, rOldName, rNewName ) )
return false;
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
{
IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rNewName, BASICIDE_TYPE_MODULE, sal_True );
@@ -276,7 +276,7 @@ namespace
BasicIDEGlobals::ensure();
- IDE_DLL()->GetExtraData()->ChoosingMacro() = sal_True;
+ BasicIDEGlobals::GetExtraData()->ChoosingMacro() = sal_True;
String aScriptURL;
sal_Bool bError = sal_False;
@@ -292,7 +292,7 @@ namespace
short nRetValue = pChooser->Execute();
- IDE_DLL()->GetExtraData()->ChoosingMacro() = sal_False;
+ BasicIDEGlobals::GetExtraData()->ChoosingMacro() = sal_False;
switch ( nRetValue )
{
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index c0760134833b..f01a67ed4342 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -81,7 +81,7 @@ namespace BasicIDE
SbMethod* CreateMacro( SbModule* pModule, const String& rMacroName )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
@@ -197,7 +197,7 @@ bool RenameDialog( Window* pErrorParent, const ScriptDocument& rDocument, const
return false;
}
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
IDEBaseWindow* pWin = pIDEShell ? pIDEShell->FindWindow( rDocument, rLibName, rOldName, BASICIDE_TYPE_DIALOG, sal_False ) : NULL;
Reference< XNameContainer > xExistingDialog;
if ( pWin )
@@ -235,7 +235,7 @@ bool RenameDialog( Window* pErrorParent, const ScriptDocument& rDocument, const
bool RemoveDialog( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
{
DialogWindow* pDlgWin = pIDEShell->FindDlgWin( rDocument, rLibName, rDlgName, sal_False );
@@ -297,7 +297,7 @@ void MarkDocumentModified( const ScriptDocument& rDocument )
// does not have to come from a document...
if ( rDocument.isApplication() )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
pIDEShell->SetAppBasicModified();
}
@@ -314,8 +314,8 @@ void MarkDocumentModified( const ScriptDocument& rDocument )
pBindings->Update( SID_SAVEDOC );
}
-
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ // Objectcatalog updaten...
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
ObjectCatalog* pObjCatalog = pIDEShell ? pIDEShell->GetObjectCatalog() : 0;
if ( pObjCatalog )
pObjCatalog->UpdateEntries();
@@ -335,7 +335,7 @@ void RunMethod( SbMethod* pMethod )
void StopBasic()
{
StarBASIC::Stop();
- BasicIDEShell* pShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pShell = BasicIDEGlobals::GetShell();
if ( pShell )
{
IDEWindowTable& rWindows = pShell->GetIDEWindowTable();
@@ -372,7 +372,7 @@ void BasicStopped( sal_Bool* pbAppWindowDisabled,
*ppSWLockViewCount = 0;
// AppWait ?
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if( pIDEShell )
{
sal_uInt16 nWait = 0;
@@ -429,9 +429,9 @@ long HandleBasicError( StarBASIC* pBasic )
BasicIDE::BasicStopped();
// no error output during macro choosing
- if ( IDE_DLL()->GetExtraData()->ChoosingMacro() )
+ if ( BasicIDEGlobals::GetExtraData()->ChoosingMacro() )
return 1;
- if ( IDE_DLL()->GetExtraData()->ShellInCriticalSection() )
+ if ( BasicIDEGlobals::GetExtraData()->ShellInCriticalSection() )
return 2;
long nRet = 0;
@@ -460,13 +460,13 @@ long HandleBasicError( StarBASIC* pBasic )
if ( !bProtected )
{
- pIDEShell = IDE_DLL()->GetShell();
+ pIDEShell = BasicIDEGlobals::GetShell();
if ( !pIDEShell )
{
SfxAllItemSet aArgs( SFX_APP()->GetPool() );
SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
SFX_APP()->ExecuteSlot( aRequest );
- pIDEShell = IDE_DLL()->GetShell();
+ pIDEShell = BasicIDEGlobals::GetShell();
}
}
}
@@ -487,10 +487,9 @@ SfxBindings* GetBindingsPtr()
SfxBindings* pBindings = NULL;
SfxViewFrame* pFrame = NULL;
- BasicIDEDLL* pIDEDLL = IDE_DLL();
- if ( pIDEDLL && pIDEDLL->GetShell() )
+ if ( BasicIDEGlobals::GetShell() )
{
- pFrame = pIDEDLL->GetShell()->GetViewFrame();
+ pFrame = BasicIDEGlobals::GetShell()->GetViewFrame();
}
else
{
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 4d10d024c441..8546d92ac383 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -161,7 +161,7 @@ long IDEBaseWindow::Notify( NotifyEvent& rNEvt )
{
if ( aCode.IsMod1() )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
pIDEShell->NextPage( nCode == KEY_PAGEUP );
@@ -557,7 +557,7 @@ void BasicIDETabBar::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) && !IsInEditMode() )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -598,7 +598,7 @@ void BasicIDETabBar::Command( const CommandEvent& rCEvt )
aPopup.EnableItem(SID_BASICIDE_MODULEDLG, false);
}
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
{
ScriptDocument aDocument( pIDEShell->GetCurDocument() );
@@ -663,7 +663,7 @@ void BasicIDETabBar::EndRenaming()
{
SfxUInt16Item aID( SID_BASICIDE_ARG_TABID, GetEditPageId() );
SfxStringItem aNewName( SID_BASICIDE_ARG_MODULENAME, GetEditText() );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -677,7 +677,7 @@ void BasicIDETabBar::EndRenaming()
void BasicIDETabBar::Sort()
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
{
IDEWindowTable& aIDEWindowTable = pIDEShell->GetIDEWindowTable();
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index 2cdff12b4b48..0c066a2c0f76 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -207,7 +207,7 @@ IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton )
String aEntryStr( RTL_CONSTASCII_USTRINGPARAM( "# " ) );
aEntryStr += String::CreateFromInt32( pBrk->nLine );
aComboBox.InsertEntry( aEntryStr, COMBOBOX_APPEND );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -234,7 +234,7 @@ IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton )
if ( nEntry && !( nEntry < aComboBox.GetEntryCount() ) )
nEntry--;
aComboBox.SetText( aComboBox.GetEntry( nEntry ) );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index 6de1ba98b82f..922e228d3416 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -63,6 +63,21 @@ using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+class BasicIDEDLL
+{
+ BasicIDEShell* m_pShell;
+ BasicIDEData* m_pExtraData;
+
+public:
+ BasicIDEDLL();
+ ~BasicIDEDLL();
+
+ BasicIDEShell* GetShell() const { return m_pShell; }
+ void SetShell(BasicIDEShell* pShell) { m_pShell = pShell; }
+ BasicIDEData* GetExtraData();
+ static BasicIDEDLL* GetDLL();
+};
+
namespace
{
//Holds a BasicIDEDLL and release it on exit, or dispose of the
@@ -84,6 +99,32 @@ namespace BasicIDEGlobals
{
theBasicIDEDLLInstance::get();
}
+
+ BasicIDEShell* GetShell()
+ {
+ BasicIDEDLL *pIDEGlobals = theBasicIDEDLLInstance::get().get();
+ return pIDEGlobals ? pIDEGlobals->GetShell() : NULL;
+ }
+
+ void ShellCreated(BasicIDEShell* pShell)
+ {
+ BasicIDEDLL *pIDEGlobals = theBasicIDEDLLInstance::get().get();
+ if (pIDEGlobals && pIDEGlobals->GetShell() == pShell)
+ pIDEGlobals->SetShell(pShell);
+ }
+
+ void ShellDestroyed(BasicIDEShell* pShell)
+ {
+ BasicIDEDLL *pIDEGlobals = theBasicIDEDLLInstance::get().get();
+ if (pIDEGlobals && pIDEGlobals->GetShell() == pShell)
+ pIDEGlobals->SetShell(NULL);
+ }
+
+ BasicIDEData* GetExtraData()
+ {
+ BasicIDEDLL *pIDEGlobals = theBasicIDEDLLInstance::get().get();
+ return pIDEGlobals ? pIDEGlobals->GetExtraData() : NULL;
+ }
}
BasicIDEDLL* BasicIDEDLL::GetDLL()
@@ -98,15 +139,15 @@ IDEResId::IDEResId( sal_uInt16 nId ):
BasicIDEDLL::~BasicIDEDLL()
{
- delete pExtraData;
+ delete m_pExtraData;
#if 0
*(BasicIDEDLL**)GetAppData(SHL_IDE) = NULL;
#endif
}
BasicIDEDLL::BasicIDEDLL()
- : pShell(0)
- , pExtraData(0)
+ : m_pShell(0)
+ , m_pExtraData(0)
{
SfxObjectFactory* pFact = &BasicDocShell::Factory();
(void)pFact;
@@ -132,9 +173,9 @@ BasicIDEDLL::BasicIDEDLL()
BasicIDEData* BasicIDEDLL::GetExtraData()
{
- if ( !pExtraData )
- pExtraData = new BasicIDEData;
- return pExtraData;
+ if (!m_pExtraData)
+ m_pExtraData = new BasicIDEData;
+ return m_pExtraData;
}
BasicIDEData::BasicIDEData() : aObjCatPos( INVPOSITION, INVPOSITION )
@@ -177,7 +218,7 @@ void BasicIDEData::SetSearchItem( const SvxSearchItem& rItem )
IMPL_LINK( BasicIDEData, GlobalBasicBreakHdl, StarBASIC *, pBasic )
{
long nRet = 0;
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
{
BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic );
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
index b5dcd5b19354..9a500b84e36f 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -822,7 +822,7 @@ void LocalizationMgr::handleBasicStopped( void )
DialogWindow* FindDialogWindowForEditor( DlgEditor* pEditor )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
IDEWindowTable& aIDEWindowTable = pIDEShell->GetIDEWindowTable();
IDEBaseWindow* pWin = aIDEWindowTable.First();
DialogWindow* pFoundDlgWin = NULL;
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index d9e20d7cb461..688c54b3c9d3 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -125,7 +125,7 @@ MacroChooser::MacroChooser( Window* pParnt, sal_Bool bCreateEntries ) :
WB_HASBUTTONS | WB_HASBUTTONSATROOT |
WB_HSCROLL );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -158,7 +158,7 @@ void MacroChooser::StoreMacroDescription()
aDesc.SetType( OBJ_TYPE_METHOD );
}
- BasicIDEData* pData = IDE_DLL()->GetExtraData();
+ BasicIDEData* pData = BasicIDEGlobals::GetExtraData();
if ( pData )
pData->SetLastEntryDescriptor( aDesc );
}
@@ -166,7 +166,7 @@ void MacroChooser::StoreMacroDescription()
void MacroChooser::RestoreMacroDescription()
{
BasicEntryDescriptor aDesc;
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
{
IDEBaseWindow* pCurWin = pIDEShell->GetCurWindow();
@@ -175,7 +175,7 @@ void MacroChooser::RestoreMacroDescription()
}
else
{
- BasicIDEData* pData = IDE_DLL()->GetExtraData();
+ BasicIDEData* pData = BasicIDEGlobals::GetExtraData();
if ( pData )
aDesc = pData->GetLastEntryDescriptor();
}
@@ -306,7 +306,7 @@ void MacroChooser::DeleteMacro()
DBG_ASSERT( pMethod, "DeleteMacro: Kein Macro !" );
if ( pMethod && QueryDelMacro( pMethod->GetName(), this ) )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -723,7 +723,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
SFX_APP()->ExecuteSlot( aRequest );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -735,7 +735,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
if ( bNewDelIsDel )
{
DeleteMacro();
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -768,7 +768,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
SFX_APP()->ExecuteSlot( aRequest );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if ( pDispatcher )
@@ -834,7 +834,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
return 0;
}
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell && pIDEShell->IsAppBasicModified() )
bForceStoreBasic = sal_True;
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 496d076b0ac5..f55324eab71e 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -638,7 +638,7 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
DBG_ASSERT( pCurEntry, "Entry?!" );
String aLibName( aLibBox.GetEntryText( pCurEntry, 0 ) );
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if ( pDispatcher )
@@ -672,7 +672,7 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
Reference< script::XLibraryContainer > xModLibContainer = m_aCurDocument.getLibraryContainer( E_SCRIPTS );
if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && !xModLibContainer->isLibraryLoaded( aOULibName ) )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
pIDEShell->GetViewFrame()->GetWindow().EnterWait();
xModLibContainer->loadLibrary( aOULibName );
@@ -684,7 +684,7 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
Reference< script::XLibraryContainer > xDlgLibContainer = m_aCurDocument.getLibraryContainer( E_DIALOGS );
if ( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aOULibName ) && !xDlgLibContainer->isLibraryLoaded( aOULibName ) )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
pIDEShell->GetViewFrame()->GetWindow().EnterWait();
xDlgLibContainer->loadLibrary( aOULibName );
@@ -796,7 +796,7 @@ void LibPage::InsertLib()
xFltMgr->appendFilter( aTitle, aFilter );
// set display directory and filter
- String aPath( IDE_DLL()->GetExtraData()->GetAddLibPath() );
+ String aPath( BasicIDEGlobals::GetExtraData()->GetAddLibPath() );
if ( aPath.Len() )
{
xFP->setDisplayDirectory( aPath );
@@ -807,7 +807,7 @@ void LibPage::InsertLib()
xFP->setDisplayDirectory( SvtPathOptions().GetWorkPath() );
}
- String aLastFilter( IDE_DLL()->GetExtraData()->GetAddLibFilter() );
+ String aLastFilter( BasicIDEGlobals::GetExtraData()->GetAddLibFilter() );
if ( aLastFilter.Len() )
{
xFltMgr->setCurrentFilter( aLastFilter );
@@ -819,8 +819,8 @@ void LibPage::InsertLib()
if ( xFP->execute() == RET_OK )
{
- IDE_DLL()->GetExtraData()->SetAddLibPath( xFP->getDisplayDirectory() );
- IDE_DLL()->GetExtraData()->SetAddLibFilter( xFltMgr->getCurrentFilter() );
+ BasicIDEGlobals::GetExtraData()->SetAddLibPath( xFP->getDisplayDirectory() );
+ BasicIDEGlobals::GetExtraData()->SetAddLibFilter( xFltMgr->getCurrentFilter() );
// library containers for import
Reference< script::XLibraryContainer2 > xModLibContImport;
@@ -1283,7 +1283,7 @@ void LibPage::ExportAsPackage( const String& aLibName )
xFltMgr->appendFilter( aTitle, aFilter );
// set display directory and filter
- String aPath( IDE_DLL()->GetExtraData()->GetAddLibPath() );
+ String aPath( BasicIDEGlobals::GetExtraData()->GetAddLibPath() );
if ( aPath.Len() )
{
xFP->setDisplayDirectory( aPath );
@@ -1297,7 +1297,7 @@ void LibPage::ExportAsPackage( const String& aLibName )
if ( xFP->execute() == RET_OK )
{
- IDE_DLL()->GetExtraData()->SetAddLibPath( xFP->getDisplayDirectory() );
+ BasicIDEGlobals::GetExtraData()->SetAddLibPath( xFP->getDisplayDirectory() );
Sequence< ::rtl::OUString > aFiles = xFP->getFiles();
INetURLObject aURL( aFiles[0] );
@@ -1409,7 +1409,7 @@ void LibPage::ExportAsBasic( const String& aLibName )
xFolderPicker->setTitle( String( IDEResId( RID_STR_EXPORTBASIC ) ) );
// set display directory and filter
- String aPath( IDE_DLL()->GetExtraData()->GetAddLibPath() );
+ String aPath( BasicIDEGlobals::GetExtraData()->GetAddLibPath() );
if( !aPath.Len() )
aPath = SvtPathOptions().GetWorkPath();
@@ -1419,7 +1419,7 @@ void LibPage::ExportAsBasic( const String& aLibName )
if( nRet == RET_OK )
{
String aTargetURL = xFolderPicker->getDirectory();
- IDE_DLL()->GetExtraData()->SetAddLibPath( aTargetURL );
+ BasicIDEGlobals::GetExtraData()->SetAddLibPath( aTargetURL );
Reference< task::XInteractionHandler > xDummyHandler( new DummyInteractionHandler( xHandler ) );
implExportLib( aLibName, aTargetURL, xDummyHandler );
@@ -1450,7 +1450,7 @@ void LibPage::DeleteCurrent()
// inform BasicIDE
SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( m_aCurDocument.getDocumentOrNull() ) );
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -1651,7 +1651,7 @@ void createLibImpl( Window* pWin, const ScriptDocument& rDocument,
throw Exception();
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BASICIDE_TYPE_MODULE );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 786119b20375..b7258cf0b6d7 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -131,7 +131,7 @@ sal_Bool ExtBasicTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const String& rN
BasicIDE::MarkDocumentModified( aDocument );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -365,7 +365,7 @@ sal_Bool ExtBasicTreeListBox::NotifyCopyingMoving( SvLBoxEntry* pTarget, SvLBoxE
BasicEntryType eType( aSourceDesc.GetType() );
// get dispatcher
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
@@ -499,7 +499,7 @@ OrganizeDialog::OrganizeDialog( Window* pParent, sal_Int16 tabId, BasicEntryDesc
ActivatePageHdl( &aTabCtrl );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -692,7 +692,7 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton )
SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
SFX_APP()->ExecuteSlot( aRequest );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry();
@@ -840,7 +840,7 @@ void ObjectPage::NewDialog()
return;
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDocument, aLibName, aDlgName, BASICIDE_TYPE_DIALOG );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -898,7 +898,7 @@ void ObjectPage::DeleteCurrent()
aBasicBox.GetModel()->Remove( pCurEntry );
if ( aBasicBox.GetCurEntry() ) // OV-Bug ?
aBasicBox.Select( aBasicBox.GetCurEntry() );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -1000,7 +1000,7 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument,
if ( pBasic )
pModule = pBasic->FindModule( aModName );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BASICIDE_TYPE_MODULE );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index 0bae4d95d994..38ed7c57ffe3 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -69,7 +69,7 @@ void ObjectTreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
if ( aDesc.GetType() == OBJ_TYPE_METHOD )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if( pDispatcher )
@@ -109,8 +109,8 @@ ObjectCatalog::ObjectCatalog( Window * pParent )
CheckButtons();
- Point aPos = IDE_DLL()->GetExtraData()->GetObjectCatalogPos();
- Size aSize = IDE_DLL()->GetExtraData()->GetObjectCatalogSize();
+ Point aPos = BasicIDEGlobals::GetExtraData()->GetObjectCatalogPos();
+ Size aSize = BasicIDEGlobals::GetExtraData()->GetObjectCatalogSize();
if ( aPos.X() == INVPOSITION )
{
// centered after AppWin:
@@ -140,7 +140,7 @@ ObjectCatalog::~ObjectCatalog()
void ObjectCatalog::Move()
{
- IDE_DLL()->GetExtraData()->SetObjectCatalogPos( GetPosPixel() );
+ BasicIDEGlobals::GetExtraData()->SetObjectCatalogPos( GetPosPixel() );
}
sal_Bool ObjectCatalog::Close()
@@ -152,7 +152,7 @@ sal_Bool ObjectCatalog::Close()
void ObjectCatalog::Resize()
{
Size aOutSz = GetOutputSizePixel();
- IDE_DLL()->GetExtraData()->SetObjectCatalogSize( aOutSz );
+ BasicIDEGlobals::GetExtraData()->SetObjectCatalogSize( aOutSz );
Point aTreePos = aMacroTreeList.GetPosPixel();
Size aDescrSz = aMacroDescr.GetSizePixel();
@@ -193,7 +193,7 @@ IMPL_LINK( ObjectCatalog, ToolBoxHdl, ToolBox*, pToolBox )
SvLBoxEntry* pCurEntry = aMacroTreeList.GetCurEntry();
DBG_ASSERT( pCurEntry, "Entry?!" );
BasicEntryDescriptor aDesc( aMacroTreeList.GetEntryDescriptor( pCurEntry ) );
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if ( aDesc.GetType() == OBJ_TYPE_MODULE ||
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 915bca1f239f..210a6f39e337 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -631,7 +631,7 @@ IMPL_LINK( DlgEditor, PaintTimeout, Timer *, EMPTYARG )
IMPL_LINK( DlgEditor, MarkTimeout, Timer *, EMPTYARG )
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SHOW_PROPERTYBROWSER ) : NULL;
@@ -1162,7 +1162,7 @@ sal_Bool DlgEditor::IsPasteAllowed()
void DlgEditor::ShowProperties()
{
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
if ( pViewFrame && !pViewFrame->HasChildWindow( SID_SHOW_PROPERTYBROWSER ) )
pViewFrame->ToggleChildWindow( SID_SHOW_PROPERTYBROWSER );
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index dfdf30d63300..caec0790cd8f 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -129,7 +129,7 @@ ManageLanguageDialog::~ManageLanguageDialog()
void ManageLanguageDialog::Init()
{
// get current IDE
- BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
String sLibName = pIDEShell->GetCurLibName();
// set dialog title with library name
String sText = GetText();