summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2011-11-30 02:11:15 -0500
committerAugust Sodora <augsod@gmail.com>2011-11-30 02:11:59 -0500
commit1eb974c1429967ce76db4b16192a9a95b3e8cc6f (patch)
tree11512a5c5613d5609dcfd9530992830ad0095336 /basctl
parente57e5b0c7f1a5ec6cd008226f126438d65cbd8d0 (diff)
Convert group of consts to enum
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/basides1.cxx20
-rw-r--r--basctl/source/basicide/basidesh.cxx6
-rw-r--r--basctl/source/basicide/basobj2.cxx2
-rw-r--r--basctl/source/basicide/basobj3.cxx2
-rw-r--r--basctl/source/basicide/bastype2.hxx2
-rw-r--r--basctl/source/basicide/bastype3.cxx14
-rw-r--r--basctl/source/basicide/bastypes.cxx4
-rw-r--r--basctl/source/basicide/moduldl2.cxx2
-rw-r--r--basctl/source/basicide/moduldlg.cxx4
-rw-r--r--basctl/source/inc/basidesh.hxx2
-rw-r--r--basctl/source/inc/sbxitem.hxx25
11 files changed, 43 insertions, 40 deletions
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 8d184e2fbec2..2aff96e29351 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -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() == BASICIDE_TYPE_MODULE )
+ if ( rSbxItem.GetType() == BasicIDEType::Module )
FindBasWin( aDocument, aLibName, aName, sal_True );
- else if ( rSbxItem.GetType() == BASICIDE_TYPE_DIALOG )
+ else if ( rSbxItem.GetType() == BasicIDEType::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() == BASICIDE_TYPE_DIALOG )
+ if ( rSbxItem.GetType() == BasicIDEType::Dialog )
{
pWin = FindDlgWin( aDocument, aLibName, aName, sal_True );
}
- else if ( rSbxItem.GetType() == BASICIDE_TYPE_MODULE )
+ else if ( rSbxItem.GetType() == BasicIDEType::Module )
{
pWin = FindBasWin( aDocument, aLibName, aName, sal_True );
}
- else if ( rSbxItem.GetType() == BASICIDE_TYPE_METHOD )
+ else if ( rSbxItem.GetType() == BasicIDEType::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 ) ) ? BASICIDE_TYPE_MODULE : BASICIDE_TYPE_DIALOG;
+ sal_uInt16 nCurrentType = pCurWin->IsA( TYPE( ModulWindow ) ) ? BasicIDEType::Module : BasicIDEType::Dialog;
LibInfoItem* pLibInfoItem = new LibInfoItem( pCurWin->GetDocument(), pCurWin->GetLibName(), pCurWin->GetName(), nCurrentType );
pData->GetLibInfos().InsertInfo( pLibInfoItem );
}
@@ -1240,21 +1240,21 @@ IDEBaseWindow* BasicIDEShell::FindApplicationWindow()
return FindWindow( ScriptDocument::getApplicationScriptDocument() );
}
-IDEBaseWindow* BasicIDEShell::FindWindow( const ScriptDocument& rDocument, const String& rLibName, const String& rName, sal_uInt16 nType, sal_Bool bFindSuspended )
+IDEBaseWindow* BasicIDEShell::FindWindow( const ScriptDocument& rDocument, const String& rLibName, const String& rName, BasicIDEType nType, sal_Bool bFindSuspended )
{
IDEBaseWindow* pWin = aIDEWindowTable.First();
while ( pWin )
{
if ( !pWin->IsSuspended() || bFindSuspended )
{
- if ( !rLibName.Len() || !rName.Len() || nType == BASICIDE_TYPE_UNKNOWN )
+ if ( !rLibName.Len() || !rName.Len() || nType == BasicIDEType::Unknown )
{
// return any non-suspended window
return pWin;
}
else if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName && pWin->GetName() == rName &&
- ( ( pWin->IsA( TYPE( ModulWindow ) ) && nType == BASICIDE_TYPE_MODULE ) ||
- ( pWin->IsA( TYPE( DialogWindow ) ) && nType == BASICIDE_TYPE_DIALOG ) ) )
+ ( ( pWin->IsA( TYPE( ModulWindow ) ) && nType == BasicIDEType::Module ) ||
+ ( pWin->IsA( TYPE( DialogWindow ) ) && nType == BasicIDEType::Dialog ) ) )
{
return pWin;
}
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index b9d2dc274091..0e77823a949c 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -131,7 +131,7 @@ public:
rtl::OUString sModuleName;
if( mpShell && ( Event.Accessor >>= sModuleName ) )
{
- IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, BASICIDE_TYPE_MODULE, sal_True );
+ IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, BasicIDEType::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() == BASICIDE_TYPE_MODULE )
+ pLibInfoItem->GetCurrentType() == BasicIDEType::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() == BASICIDE_TYPE_DIALOG )
+ pLibInfoItem->GetCurrentType() == BasicIDEType::Dialog )
{
pNextActiveWindow = (IDEBaseWindow*)pWin;
}
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index af7e9046e4d8..373b91f66cde 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -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, BASICIDE_TYPE_MODULE, sal_True );
+ IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rNewName, BasicIDEType::Module, sal_True );
if ( pWin )
{
// set new name in window
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 437569ac2be3..f4f18e0c89aa 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -197,7 +197,7 @@ bool RenameDialog( Window* pErrorParent, const ScriptDocument& rDocument, const
}
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
- IDEBaseWindow* pWin = pIDEShell ? pIDEShell->FindWindow( rDocument, rLibName, rOldName, BASICIDE_TYPE_DIALOG, sal_False ) : NULL;
+ IDEBaseWindow* pWin = pIDEShell ? pIDEShell->FindWindow( rDocument, rLibName, rOldName, BasicIDEType::Dialog, sal_False ) : NULL;
Reference< XNameContainer > xExistingDialog;
if ( pWin )
xExistingDialog = ((DialogWindow*)pWin)->GetEditor()->GetDialog();
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index fa5deaf9e612..645cbe0aea5e 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -201,7 +201,7 @@ public:
BasicEntryDescriptor GetEntryDescriptor( SvLBoxEntry* pEntry );
- sal_uInt16 ConvertType( BasicEntryType eType );
+ BasicIDEType ConvertType( BasicEntryType eType );
bool IsValidEntry( SvLBoxEntry* pEntry );
SvLBoxEntry* AddEntry( const ::rtl::OUString& rText, const Image& rImage,
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index 7cddd8aa750d..2324c4d4d103 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -375,35 +375,35 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry )
return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType );
}
-sal_uInt16 BasicTreeListBox::ConvertType( BasicEntryType eType )
+BasicIDEType BasicTreeListBox::ConvertType( BasicEntryType eType )
{
- sal_uInt16 nType = OBJ_TYPE_UNKNOWN;
+ BasicIDEType nType = static_cast<BasicIDEType>(OBJ_TYPE_UNKNOWN);
switch ( eType )
{
case OBJ_TYPE_DOCUMENT:
{
- nType = BASICIDE_TYPE_SHELL;
+ nType = BasicIDEType::Shell;
}
break;
case OBJ_TYPE_LIBRARY:
{
- nType = BASICIDE_TYPE_LIBRARY;
+ nType = BasicIDEType::Library;
}
break;
case OBJ_TYPE_MODULE:
{
- nType = BASICIDE_TYPE_MODULE;
+ nType = BasicIDEType::Module;
}
break;
case OBJ_TYPE_DIALOG:
{
- nType = BASICIDE_TYPE_DIALOG;
+ nType = BasicIDEType::Dialog;
}
break;
case OBJ_TYPE_METHOD:
{
- nType = BASICIDE_TYPE_METHOD;
+ nType = BasicIDEType::Method;
}
break;
default: ;
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 4dcc710a7756..008fa996fddc 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -886,7 +886,7 @@ LibInfoItem* LibInfos::GetInfo( const LibInfoKey& rKey )
return pItem;
}
-SbxItem::SbxItem(sal_uInt16 nWhich_, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName, const ::rtl::OUString& aName, sal_uInt16 nType )
+SbxItem::SbxItem(sal_uInt16 nWhich_, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName, const ::rtl::OUString& aName, BasicIDEType nType )
:SfxPoolItem( nWhich_ )
,m_aDocument(rDocument)
,m_aLibName(aLibName)
@@ -895,7 +895,7 @@ SbxItem::SbxItem(sal_uInt16 nWhich_, const ScriptDocument& rDocument, const ::rt
{
}
-SbxItem::SbxItem(sal_uInt16 nWhich_, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName, const ::rtl::OUString& aName, const ::rtl::OUString& aMethodName, sal_uInt16 nType )
+SbxItem::SbxItem(sal_uInt16 nWhich_, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName, const ::rtl::OUString& aName, const ::rtl::OUString& aMethodName, BasicIDEType nType )
:SfxPoolItem( nWhich_ )
,m_aDocument(rDocument)
,m_aLibName(aLibName)
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 5777fe82991d..68b6a01604f1 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -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, BASICIDE_TYPE_MODULE );
+ SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BasicIDEType::Module );
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index c37926bf8d08..57f893954b0e 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -838,7 +838,7 @@ void ObjectPage::NewDialog()
if ( !aDocument.createDialog( aLibName, aDlgName, xISP ) )
return;
- SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDocument, aLibName, aDlgName, BASICIDE_TYPE_DIALOG );
+ SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDocument, aLibName, aDlgName, BasicIDEType::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, BASICIDE_TYPE_MODULE );
+ SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BasicIDEType::Module );
BasicIDEShell* pIDEShell = BasicIDEGlobals::GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index 9d66a6dfde8f..7241341002a6 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -211,7 +211,7 @@ public:
ModulWindowLayout* GetLayoutWindow() const { return pModulLayout; }
- IDEBaseWindow* FindWindow( const ScriptDocument& rDocument, const String& rLibName = String(), const String& rName = String(), sal_uInt16 nType = BASICIDE_TYPE_UNKNOWN, sal_Bool bFindSuspended = sal_False );
+ IDEBaseWindow* FindWindow( const ScriptDocument& rDocument, const String& rLibName = String(), const String& rName = String(), BasicIDEType nType = BasicIDEType::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 );
diff --git a/basctl/source/inc/sbxitem.hxx b/basctl/source/inc/sbxitem.hxx
index 94a8b513e9a7..f80e04952320 100644
--- a/basctl/source/inc/sbxitem.hxx
+++ b/basctl/source/inc/sbxitem.hxx
@@ -31,12 +31,15 @@
#include "scriptdocument.hxx"
#include <svl/poolitem.hxx>
-const sal_uInt16 BASICIDE_TYPE_UNKNOWN = 0;
-const sal_uInt16 BASICIDE_TYPE_SHELL = 1;
-const sal_uInt16 BASICIDE_TYPE_LIBRARY = 2;
-const sal_uInt16 BASICIDE_TYPE_MODULE = 3;
-const sal_uInt16 BASICIDE_TYPE_DIALOG = 4;
-const sal_uInt16 BASICIDE_TYPE_METHOD = 5;
+enum BasicIDEType
+{
+ Unknown,
+ Shell,
+ Library,
+ Module,
+ Dialog,
+ Method
+};
class SbxItem : public SfxPoolItem
{
@@ -44,12 +47,12 @@ class SbxItem : public SfxPoolItem
::rtl::OUString m_aLibName;
::rtl::OUString m_aName;
::rtl::OUString m_aMethodName;
- sal_uInt16 m_nType;
+ BasicIDEType m_nType;
public:
TYPEINFO();
- SbxItem( sal_uInt16 nWhich, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName, const ::rtl::OUString& aName, sal_uInt16 nType );
- SbxItem( sal_uInt16 nWhich, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName, const ::rtl::OUString& aName, const ::rtl::OUString& aMethodName, sal_uInt16 nType );
+ SbxItem( sal_uInt16 nWhich, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName, const ::rtl::OUString& aName, BasicIDEType nType );
+ SbxItem( sal_uInt16 nWhich, const ScriptDocument& rDocument, const ::rtl::OUString& aLibName, const ::rtl::OUString& aName, const ::rtl::OUString& aMethodName, BasicIDEType nType );
SbxItem( const SbxItem& );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
@@ -68,8 +71,8 @@ public:
const ::rtl::OUString& GetMethodName() const { return m_aMethodName; }
void SetMethodName( const ::rtl::OUString& aMethodName ) { m_aMethodName = aMethodName; }
- sal_uInt16 GetType() const { return m_nType; }
- void SetType( sal_uInt16 nType ) { m_nType = nType; }
+ BasicIDEType GetType() const { return m_nType; }
+ void SetType( BasicIDEType nType ) { m_nType = nType; }
};
#endif