Kaydet (Commit) 598fb224 authored tarafından Kurt Zenker's avatar Kurt Zenker

INTEGRATION: CWS tbe11 (1.11.168); FILE MERGED

2004/06/21 11:24:51 tbe 1.11.168.1: #99468# Basic IDE cannot handle libraries, which contain dialogs only
üst 40fde47c
......@@ -2,9 +2,9 @@
*
* $RCSfile: basides3.cxx,v $
*
* $Revision: 1.11 $
* $Revision: 1.12 $
*
* last change: $Author: vg $ $Date: 2003-03-26 12:48:29 $
* last change: $Author: kz $ $Date: 2004-07-23 12:02:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -96,27 +96,29 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
DialogWindow* BasicIDEShell::CreateDlgWin( StarBASIC* pBasic, String aDlgName )
DialogWindow* BasicIDEShell::CreateDlgWin( SfxObjectShell* pShell, const String& rLibName, const String& rDlgName )
{
bCreatingWindow = TRUE;
ULONG nKey = 0;
DialogWindow* pWin = 0;
String aLibName( rLibName );
String aDlgName( rDlgName );
// Vielleicht gibt es ein suspendiertes?
pWin = FindDlgWin( pBasic, aDlgName, FALSE, TRUE );
if ( !aLibName.Len() )
aLibName = String::CreateFromAscii( "Standard" );
if ( !pWin )
{
BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic );
if ( pBasMgr )
{
SfxObjectShell* pShell = BasicIDE::FindDocShell( pBasMgr );
String aLibName = pBasic->GetName();
if ( !BasicIDE::HasDialogLibrary( pShell, aLibName ) )
BasicIDE::CreateDialogLibrary( pShell, aLibName );
if ( aDlgName.Len() == 0 )
if ( !aDlgName.Len() )
aDlgName = BasicIDE::CreateDialogName( pShell, aLibName );
// Vielleicht gibt es ein suspendiertes?
pWin = FindDlgWin( pShell, aLibName, aDlgName, FALSE, TRUE );
if ( !pWin )
{
try
{
Reference< io::XInputStreamProvider > xISP;
......@@ -145,7 +147,7 @@ DialogWindow* BasicIDEShell::CreateDlgWin( StarBASIC* pBasic, String aDlgName )
::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
// new dialog window
pWin = new DialogWindow( &GetViewFrame()->GetWindow(), pBasic, pShell, aLibName, aDlgName, xDialogModel );
pWin = new DialogWindow( &GetViewFrame()->GetWindow(), pShell, aLibName, aDlgName, xDialogModel );
nKey = InsertWindowInTable( pWin );
}
}
......@@ -160,7 +162,6 @@ DialogWindow* BasicIDEShell::CreateDlgWin( StarBASIC* pBasic, String aDlgName )
DBG_ERROR( aBStr.GetBuffer() );
}
}
}
else
{
pWin->SetStatus( pWin->GetStatus() & ~BASWIN_SUSPENDED );
......@@ -187,7 +188,7 @@ DialogWindow* BasicIDEShell::CreateDlgWin( StarBASIC* pBasic, String aDlgName )
return pWin;
}
DialogWindow* BasicIDEShell::FindDlgWin( StarBASIC* pBasic, const String& rDlgName, BOOL bCreateIfNotExist, BOOL bFindSuspended )
DialogWindow* BasicIDEShell::FindDlgWin( SfxObjectShell* pShell, const String& rLibName, const String& rDlgName, BOOL bCreateIfNotExist, BOOL bFindSuspended )
{
DialogWindow* pDlgWin = 0;
IDEBaseWindow* pWin = aIDEWindowTable.First();
......@@ -195,16 +196,15 @@ DialogWindow* BasicIDEShell::FindDlgWin( StarBASIC* pBasic, const String& rDlgNa
{
if ( ( !pWin->IsSuspended() || bFindSuspended ) && pWin->IsA( TYPE( DialogWindow ) ) )
{
String aDlgStr( pWin->GetName() );
if ( !pBasic ) // nur irgendeins finden...
if ( !rLibName.Len() ) // nur irgendeins finden...
pDlgWin = (DialogWindow*)pWin;
else if ( ( pWin->GetBasic() == pBasic ) && ( aDlgStr == rDlgName ) )
else if ( pWin->GetShell() == pShell && pWin->GetLibName() == rLibName && pWin->GetName() == rDlgName )
pDlgWin = (DialogWindow*)pWin;
}
pWin = aIDEWindowTable.Next();
}
if ( !pDlgWin && bCreateIfNotExist )
pDlgWin = CreateDlgWin( pBasic, rDlgName );
pDlgWin = CreateDlgWin( pShell, rLibName, rDlgName );
return pDlgWin;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment