#87307# remove external basctl dependencies

This commit is contained in:
Thomas Benisch 2001-07-17 07:43:30 +00:00
parent 8ecb48a8b2
commit 5dde9bf15e
2 changed files with 47 additions and 26 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: basides1.cxx,v $
*
* $Revision: 1.7 $
* $Revision: 1.8 $
*
* last change: $Author: tbe $ $Date: 2001-07-04 12:18:27 $
* last change: $Author: tbe $ $Date: 2001-07-17 08:43:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -350,7 +350,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
break;
case SID_BASICIDE_CHOOSEMACRO:
{
BasicIDE::ChooseMacro();
BasicIDE::SelectMacro();
}
break;
case SID_BASICIDE_CREATEMACRO:

View file

@ -2,9 +2,9 @@
*
* $RCSfile: basobj2.cxx,v $
*
* $Revision: 1.8 $
* $Revision: 1.9 $
*
* last change: $Author: tbe $ $Date: 2001-07-09 16:25:19 $
* last change: $Author: tbe $ $Date: 2001-07-17 08:43:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -227,12 +227,15 @@ void BasicIDE::DecBasicDialogCount()
//----------------------------------------------------------------------------
String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly )
String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly, const String& rPreferredMacroDesciption )
{
if ( rPreferredMacroDesciption.Len() )
IDE_DLL()->GetExtraData()->GetLastMacro() = rPreferredMacroDesciption;
IDE_DLL()->GetExtraData()->ChoosingMacro() = TRUE;
SFX_APP()->EnterBasicCall();
String aURL;
String aMacroURL;
SbMethod* pMethod = NULL;
Window* pParent = Application::GetDefDialogParent();
@ -266,16 +269,43 @@ String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly )
if ( pBasMgr )
{
SfxObjectShell* pShell = BasicIDE::FindDocShell( pBasMgr );
aURL = String::CreateFromAscii("macro://");
aMacroURL = String::CreateFromAscii("macro://");
if ( pShell )
aURL += pShell->GetTitle( SFX_TITLE_APINAME );
aURL += '/';
aURL += pBasic->GetName();
aURL += '.';
aURL += pModule->GetName();
aURL += '.';
aURL += pMethod->GetName();
aURL += String::CreateFromAscii("()");
aMacroURL += pShell->GetTitle( SFX_TITLE_APINAME );
aMacroURL += '/';
aMacroURL += pBasic->GetName();
aMacroURL += '.';
aMacroURL += pModule->GetName();
aMacroURL += '.';
aMacroURL += pMethod->GetName();
aMacroURL += String::CreateFromAscii("()");
/*
if ( bChooseOnly ) // !bExecute ?
{
//if ( pShell )
//{
// String aBasMgrName = pShell->GetTitle( SFX_TITLE_APINAME );
sal_uInt16 nHashPos = aMacroURL.Search( '/', 8 );
String aBasMgrName( INetURLObject::decode(aMacroURL.Copy( 8, nHashPos-8 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET) );
if ( aBasMgrName.Len() )
{
String aCurrentName = SfxObjectShell::Current()->GetTitle(SFX_TITLE_APINAME);
if ( aBasMgrName == aCurrentName )
{
aMacroURL.SearchAndReplace( aBasMgrName , '.' );
}
else
{
aMacroURL = String();
ErrorBox( NULL, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_ERRORSELECTMACRO ) ) ).Execute();
}
}
}
*/
}
}
}
@ -294,16 +324,7 @@ String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly )
SFX_APP()->LeaveBasicCall();
return aURL;
}
//----------------------------------------------------------------------------
String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly, const String& rPreferredMacroDesciption )
{
if ( rPreferredMacroDesciption.Len() )
IDE_DLL()->GetExtraData()->GetLastMacro() = rPreferredMacroDesciption;
return BasicIDE::SelectMacro( bExecute, bChooseOnly );
return aMacroURL;
}
//----------------------------------------------------------------------------