Kaydet (Commit) 08b921ef authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Enum member names live in the outer name scope.

üst 1f538764
......@@ -615,9 +615,9 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
String aName( rSbxItem.GetName() );
if ( !m_aCurLibName.Len() || ( aDocument == m_aCurDocument && aLibName == m_aCurLibName ) )
{
if ( rSbxItem.GetType() == BasicIDEType::Module )
if ( rSbxItem.GetType() == BASICIDE_TYPE_MODULE )
FindBasWin( aDocument, aLibName, aName, sal_True );
else if ( rSbxItem.GetType() == BasicIDEType::Dialog )
else if ( rSbxItem.GetType() == BASICIDE_TYPE_DIALOG )
FindDlgWin( aDocument, aLibName, aName, sal_True );
}
}
......@@ -641,15 +641,15 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
String aName( rSbxItem.GetName() );
SetCurLib( aDocument, aLibName );
IDEBaseWindow* pWin = 0;
if ( rSbxItem.GetType() == BasicIDEType::Dialog )
if ( rSbxItem.GetType() == BASICIDE_TYPE_DIALOG )
{
pWin = FindDlgWin( aDocument, aLibName, aName, sal_True );
}
else if ( rSbxItem.GetType() == BasicIDEType::Module )
else if ( rSbxItem.GetType() == BASICIDE_TYPE_MODULE )
{
pWin = FindBasWin( aDocument, aLibName, aName, sal_True );
}
else if ( rSbxItem.GetType() == BasicIDEType::Method )
else if ( rSbxItem.GetType() == BASICIDE_TYPE_METHOD )
{
pWin = FindBasWin( aDocument, aLibName, aName, sal_True );
((ModulWindow*)pWin)->EditMacro( rSbxItem.GetMethodName() );
......@@ -1137,7 +1137,7 @@ void BasicIDEShell::SetCurWindow( IDEBaseWindow* pNewWin, sal_Bool bUpdateTabBar
BasicIDEData* pData = BasicIDEGlobals::GetExtraData();
if ( pData )
{
sal_uInt16 nCurrentType = pCurWin->IsA( TYPE( ModulWindow ) ) ? BasicIDEType::Module : BasicIDEType::Dialog;
sal_uInt16 nCurrentType = pCurWin->IsA( TYPE( ModulWindow ) ) ? BASICIDE_TYPE_MODULE : BASICIDE_TYPE_DIALOG;
LibInfoItem* pLibInfoItem = new LibInfoItem( pCurWin->GetDocument(), pCurWin->GetLibName(), pCurWin->GetName(), nCurrentType );
pData->GetLibInfos().InsertInfo( pLibInfoItem );
}
......@@ -1247,14 +1247,14 @@ IDEBaseWindow* BasicIDEShell::FindWindow( const ScriptDocument& rDocument, const
{
if ( !pWin->IsSuspended() || bFindSuspended )
{
if ( !rLibName.Len() || !rName.Len() || nType == BasicIDEType::Unknown )
if ( !rLibName.Len() || !rName.Len() || nType == BASICIDE_TYPE_UNKNOWN )
{
// return any non-suspended window
return pWin;
}
else if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName && pWin->GetName() == rName &&
( ( pWin->IsA( TYPE( ModulWindow ) ) && nType == BasicIDEType::Module ) ||
( pWin->IsA( TYPE( DialogWindow ) ) && nType == BasicIDEType::Dialog ) ) )
( ( pWin->IsA( TYPE( ModulWindow ) ) && nType == BASICIDE_TYPE_MODULE ) ||
( pWin->IsA( TYPE( DialogWindow ) ) && nType == BASICIDE_TYPE_DIALOG ) ) )
{
return pWin;
}
......
......@@ -131,7 +131,7 @@ public:
rtl::OUString sModuleName;
if( mpShell && ( Event.Accessor >>= sModuleName ) )
{
IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, BasicIDEType::Module, sal_True );
IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, BASICIDE_TYPE_MODULE, sal_True );
if( pWin )
mpShell->RemoveWindow( pWin, sal_True, sal_True );
}
......@@ -804,7 +804,7 @@ void BasicIDEShell::UpdateWindows()
if ( !pWin )
pWin = CreateBasWin( *doc, aLibName, aModName );
if ( !pNextActiveWindow && pLibInfoItem && pLibInfoItem->GetCurrentName() == aModName &&
pLibInfoItem->GetCurrentType() == BasicIDEType::Module )
pLibInfoItem->GetCurrentType() == BASICIDE_TYPE_MODULE )
{
pNextActiveWindow = (IDEBaseWindow*)pWin;
}
......@@ -835,7 +835,7 @@ void BasicIDEShell::UpdateWindows()
if ( !pWin )
pWin = CreateDlgWin( *doc, aLibName, aDlgName );
if ( !pNextActiveWindow && pLibInfoItem && pLibInfoItem->GetCurrentName() == aDlgName &&
pLibInfoItem->GetCurrentType() == BasicIDEType::Dialog )
pLibInfoItem->GetCurrentType() == BASICIDE_TYPE_DIALOG )
{
pNextActiveWindow = (IDEBaseWindow*)pWin;
}
......
......@@ -197,7 +197,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
if ( pIDEShell )
{
IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rNewName, BasicIDEType::Module, sal_True );
IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rNewName, BASICIDE_TYPE_MODULE, sal_True );
if ( pWin )
{
// set new name in window
......
......@@ -197,7 +197,7 @@ bool RenameDialog( Window* pErrorParent, const ScriptDocument& rDocument, const
}
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
IDEBaseWindow* pWin = pIDEShell ? pIDEShell->FindWindow( rDocument, rLibName, rOldName, BasicIDEType::Dialog, sal_False ) : NULL;
IDEBaseWindow* pWin = pIDEShell ? pIDEShell->FindWindow( rDocument, rLibName, rOldName, BASICIDE_TYPE_DIALOG, sal_False ) : NULL;
Reference< XNameContainer > xExistingDialog;
if ( pWin )
xExistingDialog = ((DialogWindow*)pWin)->GetEditor()->GetDialog();
......
......@@ -383,27 +383,27 @@ BasicIDEType BasicTreeListBox::ConvertType( BasicEntryType eType )
{
case OBJ_TYPE_DOCUMENT:
{
nType = BasicIDEType::Shell;
nType = BASICIDE_TYPE_SHELL;
}
break;
case OBJ_TYPE_LIBRARY:
{
nType = BasicIDEType::Library;
nType = BASICIDE_TYPE_LIBRARY;
}
break;
case OBJ_TYPE_MODULE:
{
nType = BasicIDEType::Module;
nType = BASICIDE_TYPE_MODULE;
}
break;
case OBJ_TYPE_DIALOG:
{
nType = BasicIDEType::Dialog;
nType = BASICIDE_TYPE_DIALOG;
}
break;
case OBJ_TYPE_METHOD:
{
nType = BasicIDEType::Method;
nType = BASICIDE_TYPE_METHOD;
}
break;
default: ;
......
......@@ -1681,7 +1681,7 @@ void createLibImpl( Window* pWin, const ScriptDocument& rDocument,
if ( !rDocument.createModule( aLibName, aModName, sal_True, sModuleCode ) )
throw Exception();
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BasicIDEType::Module );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BASICIDE_TYPE_MODULE );
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
......
......@@ -838,7 +838,7 @@ void ObjectPage::NewDialog()
if ( !aDocument.createDialog( aLibName, aDlgName, xISP ) )
return;
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDocument, aLibName, aDlgName, BasicIDEType::Dialog );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDocument, aLibName, aDlgName, BASICIDE_TYPE_DIALOG );
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
......@@ -1000,7 +1000,7 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument,
StarBASIC* pBasic = pBasMgr? pBasMgr->GetLib( aLibName ) : 0;
if ( pBasic )
pModule = pBasic->FindModule( aModName );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BasicIDEType::Module );
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BASICIDE_TYPE_MODULE );
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
......
......@@ -211,7 +211,7 @@ public:
ModulWindowLayout* GetLayoutWindow() const { return pModulLayout; }
IDEBaseWindow* FindWindow( const ScriptDocument& rDocument, const String& rLibName = String(), const String& rName = String(), BasicIDEType nType = BasicIDEType::Unknown, sal_Bool bFindSuspended = sal_False );
IDEBaseWindow* FindWindow( const ScriptDocument& rDocument, const String& rLibName = String(), const String& rName = String(), BasicIDEType nType = BASICIDE_TYPE_UNKNOWN, sal_Bool bFindSuspended = sal_False );
DialogWindow* FindDlgWin( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended = sal_False );
IDEBaseWindow* FindApplicationWindow();
sal_Bool NextPage( sal_Bool bPrev = sal_False );
......
......@@ -33,12 +33,12 @@
enum BasicIDEType
{
Unknown,
Shell,
Library,
Module,
Dialog,
Method
BASICIDE_TYPE_UNKNOWN,
BASICIDE_TYPE_SHELL,
BASICIDE_TYPE_LIBRARY,
BASICIDE_TYPE_MODULE,
BASICIDE_TYPE_DIALOG,
BASICIDE_TYPE_METHOD
};
class SbxItem : public SfxPoolItem
......
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