convert BrowseMode to o3tl::typed_flags
Change-Id: Id76339f73b3d4acd4908fd66c4c745c5b2b57c2f
This commit is contained in:
@@ -163,7 +163,7 @@ TreeListBox::TreeListBox (vcl::Window* pParent, WinBits nStyle)
|
|||||||
{
|
{
|
||||||
SetNodeDefaultImages();
|
SetNodeDefaultImages();
|
||||||
SetSelectionMode( SelectionMode::Single );
|
SetSelectionMode( SelectionMode::Single );
|
||||||
nMode = 0xFF; // everything
|
nMode = BrowseMode::All; // everything
|
||||||
}
|
}
|
||||||
|
|
||||||
VCL_BUILDER_FACTORY_CONSTRUCTOR(TreeListBox, WB_TABSTOP)
|
VCL_BUILDER_FACTORY_CONSTRUCTOR(TreeListBox, WB_TABSTOP)
|
||||||
@@ -256,7 +256,7 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons
|
|||||||
|
|
||||||
// create tree list box entry
|
// create tree list box entry
|
||||||
sal_uInt16 nId;
|
sal_uInt16 nId;
|
||||||
if ( ( nMode & BROWSEMODE_DIALOGS ) && !( nMode & BROWSEMODE_MODULES ) )
|
if ( ( nMode & BrowseMode::Dialogs ) && !( nMode & BrowseMode::Modules ) )
|
||||||
nId = bLoaded ? RID_BMP_DLGLIB : RID_BMP_DLGLIBNOTLOADED;
|
nId = bLoaded ? RID_BMP_DLGLIB : RID_BMP_DLGLIBNOTLOADED;
|
||||||
else
|
else
|
||||||
nId = bLoaded ? RID_BMP_MODLIB : RID_BMP_MODLIBNOTLOADED;
|
nId = bLoaded ? RID_BMP_MODLIB : RID_BMP_MODLIBNOTLOADED;
|
||||||
@@ -282,7 +282,7 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons
|
|||||||
void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName )
|
void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName )
|
||||||
{
|
{
|
||||||
// modules
|
// modules
|
||||||
if ( nMode & BROWSEMODE_MODULES )
|
if ( nMode & BrowseMode::Modules )
|
||||||
{
|
{
|
||||||
Reference< script::XLibraryContainer > xModLibContainer( rDocument.getLibraryContainer( E_SCRIPTS ) );
|
Reference< script::XLibraryContainer > xModLibContainer( rDocument.getLibraryContainer( E_SCRIPTS ) );
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
if ( nMode & BROWSEMODE_SUBS )
|
if ( nMode & BrowseMode::Subs )
|
||||||
{
|
{
|
||||||
Sequence< OUString > aNames = GetMethodNames( rDocument, rLibName, aModName );
|
Sequence< OUString > aNames = GetMethodNames( rDocument, rLibName, aModName );
|
||||||
sal_Int32 nCount = aNames.getLength();
|
sal_Int32 nCount = aNames.getLength();
|
||||||
@@ -345,7 +345,7 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dialogs
|
// dialogs
|
||||||
if ( nMode & BROWSEMODE_DIALOGS )
|
if ( nMode & BrowseMode::Dialogs )
|
||||||
{
|
{
|
||||||
Reference< script::XLibraryContainer > xDlgLibContainer( rDocument.getLibraryContainer( E_DIALOGS ) );
|
Reference< script::XLibraryContainer > xDlgLibContainer( rDocument.getLibraryContainer( E_DIALOGS ) );
|
||||||
|
|
||||||
@@ -469,7 +469,7 @@ void TreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvTreeListEntry* pLibSubRo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
if ( nMode & BROWSEMODE_SUBS )
|
if ( nMode & BrowseMode::Subs )
|
||||||
{
|
{
|
||||||
Sequence< OUString > aNames = GetMethodNames( rDocument, rLibName, aModName );
|
Sequence< OUString > aNames = GetMethodNames( rDocument, rLibName, aModName );
|
||||||
sal_Int32 nCount = aNames.getLength();
|
sal_Int32 nCount = aNames.getLength();
|
||||||
@@ -716,9 +716,9 @@ void TreeListBox::SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage
|
|||||||
LibraryType TreeListBox::GetLibraryType() const
|
LibraryType TreeListBox::GetLibraryType() const
|
||||||
{
|
{
|
||||||
LibraryType eType = LibraryType::All;
|
LibraryType eType = LibraryType::All;
|
||||||
if ( ( nMode & BROWSEMODE_MODULES ) && !( nMode & BROWSEMODE_DIALOGS ) )
|
if ( ( nMode & BrowseMode::Modules ) && !( nMode & BrowseMode::Dialogs ) )
|
||||||
eType = LibraryType::Module;
|
eType = LibraryType::Module;
|
||||||
else if ( !( nMode & BROWSEMODE_MODULES ) && ( nMode & BROWSEMODE_DIALOGS ) )
|
else if ( !( nMode & BrowseMode::Modules ) && ( nMode & BrowseMode::Dialogs ) )
|
||||||
eType = LibraryType::Dialog;
|
eType = LibraryType::Dialog;
|
||||||
return eType;
|
return eType;
|
||||||
}
|
}
|
||||||
|
@@ -105,7 +105,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry )
|
|||||||
ImpCreateLibSubEntries( pEntry, aDocument, aOULibName );
|
ImpCreateLibSubEntries( pEntry, aDocument, aOULibName );
|
||||||
|
|
||||||
// exchange image
|
// exchange image
|
||||||
const bool bDlgMode = (nMode & BROWSEMODE_DIALOGS) && !(nMode & BROWSEMODE_MODULES);
|
const bool bDlgMode = (nMode & BrowseMode::Dialogs) && !(nMode & BrowseMode::Modules);
|
||||||
Image aImage(BitmapEx(IDEResId(bDlgMode ? RID_BMP_DLGLIB : RID_BMP_MODLIB)));
|
Image aImage(BitmapEx(IDEResId(bDlgMode ? RID_BMP_DLGLIB : RID_BMP_MODLIB)));
|
||||||
SetEntryBitmaps( pEntry, aImage );
|
SetEntryBitmaps( pEntry, aImage );
|
||||||
}
|
}
|
||||||
|
@@ -97,7 +97,7 @@ MacroChooser::MacroChooser( vcl::Window* pParnt, const Reference< frame::XFrame
|
|||||||
m_pMacroBox->SetDoubleClickHdl( LINK( this, MacroChooser, MacroDoubleClickHdl ) );
|
m_pMacroBox->SetDoubleClickHdl( LINK( this, MacroChooser, MacroDoubleClickHdl ) );
|
||||||
m_pMacroBox->SetSelectHdl( LINK( this, MacroChooser, MacroSelectHdl ) );
|
m_pMacroBox->SetSelectHdl( LINK( this, MacroChooser, MacroSelectHdl ) );
|
||||||
|
|
||||||
m_pBasicBox->SetMode( BROWSEMODE_MODULES );
|
m_pBasicBox->SetMode( BrowseMode::Modules );
|
||||||
m_pBasicBox->SetStyle( WB_TABSTOP | WB_BORDER |
|
m_pBasicBox->SetStyle( WB_TABSTOP | WB_BORDER |
|
||||||
WB_HASLINES | WB_HASLINESATROOT |
|
WB_HASLINES | WB_HASLINESATROOT |
|
||||||
WB_HASBUTTONS | WB_HASBUTTONSATROOT |
|
WB_HASBUTTONS | WB_HASBUTTONSATROOT |
|
||||||
|
@@ -1525,8 +1525,8 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
|
|||||||
pEntry = pBasicBox->GetParent( pEntry );
|
pEntry = pBasicBox->GetParent( pEntry );
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_uInt16 nMode = pBasicBox->GetMode();
|
BrowseMode nMode = pBasicBox->GetMode();
|
||||||
bool bDlgMode = ( nMode & BROWSEMODE_DIALOGS ) && !( nMode & BROWSEMODE_MODULES );
|
bool bDlgMode = ( nMode & BrowseMode::Dialogs ) && !( nMode & BrowseMode::Modules );
|
||||||
const sal_uInt16 nId = bDlgMode ? RID_BMP_DLGLIB : RID_BMP_MODLIB;
|
const sal_uInt16 nId = bDlgMode ? RID_BMP_DLGLIB : RID_BMP_MODLIB;
|
||||||
SvTreeListEntry* pNewLibEntry = pBasicBox->AddEntry(
|
SvTreeListEntry* pNewLibEntry = pBasicBox->AddEntry(
|
||||||
aLibName,
|
aLibName,
|
||||||
|
@@ -506,14 +506,14 @@ IMPL_LINK( OrganizeDialog, ActivatePageHdl, TabControl *, pTabCtrl, void )
|
|||||||
VclPtr<TabPage> pNewTabPage;
|
VclPtr<TabPage> pNewTabPage;
|
||||||
if (sPageName == "modules")
|
if (sPageName == "modules")
|
||||||
{
|
{
|
||||||
VclPtrInstance<ObjectPage> pObjectPage(pTabCtrl, "ModulePage", BROWSEMODE_MODULES);
|
VclPtrInstance<ObjectPage> pObjectPage(pTabCtrl, "ModulePage", BrowseMode::Modules);
|
||||||
pNewTabPage.reset(pObjectPage);
|
pNewTabPage.reset(pObjectPage);
|
||||||
pObjectPage->SetTabDlg(this);
|
pObjectPage->SetTabDlg(this);
|
||||||
pObjectPage->SetCurrentEntry(m_aCurEntry);
|
pObjectPage->SetCurrentEntry(m_aCurEntry);
|
||||||
}
|
}
|
||||||
else if (sPageName == "dialogs")
|
else if (sPageName == "dialogs")
|
||||||
{
|
{
|
||||||
VclPtrInstance<ObjectPage> pObjectPage( pTabCtrl, "DialogPage", BROWSEMODE_DIALOGS );
|
VclPtrInstance<ObjectPage> pObjectPage( pTabCtrl, "DialogPage", BrowseMode::Dialogs );
|
||||||
pNewTabPage.reset(pObjectPage);
|
pNewTabPage.reset(pObjectPage);
|
||||||
pObjectPage->SetTabDlg(this);
|
pObjectPage->SetTabDlg(this);
|
||||||
pObjectPage->SetCurrentEntry(m_aCurEntry);
|
pObjectPage->SetCurrentEntry(m_aCurEntry);
|
||||||
@@ -537,7 +537,7 @@ IMPL_LINK( OrganizeDialog, ActivatePageHdl, TabControl *, pTabCtrl, void )
|
|||||||
// ObjectPage
|
// ObjectPage
|
||||||
|
|
||||||
|
|
||||||
ObjectPage::ObjectPage(vcl::Window *pParent, const OString &rName, sal_uInt16 nMode)
|
ObjectPage::ObjectPage(vcl::Window *pParent, const OString &rName, BrowseMode nMode)
|
||||||
: TabPage(pParent, rName, "modules/BasicIDE/ui/" +
|
: TabPage(pParent, rName, "modules/BasicIDE/ui/" +
|
||||||
OStringToOUString(rName, RTL_TEXTENCODING_UTF8).toAsciiLowerCase() +
|
OStringToOUString(rName, RTL_TEXTENCODING_UTF8).toAsciiLowerCase() +
|
||||||
".ui")
|
".ui")
|
||||||
@@ -557,12 +557,12 @@ ObjectPage::ObjectPage(vcl::Window *pParent, const OString &rName, sal_uInt16 nM
|
|||||||
m_pDelButton->SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
|
m_pDelButton->SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
|
||||||
m_pBasicBox->SetSelectHdl( LINK( this, ObjectPage, BasicBoxHighlightHdl ) );
|
m_pBasicBox->SetSelectHdl( LINK( this, ObjectPage, BasicBoxHighlightHdl ) );
|
||||||
|
|
||||||
if( nMode & BROWSEMODE_MODULES )
|
if( nMode & BrowseMode::Modules )
|
||||||
{
|
{
|
||||||
m_pNewModButton->SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
|
m_pNewModButton->SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
|
||||||
m_pNewDlgButton->Hide();
|
m_pNewDlgButton->Hide();
|
||||||
}
|
}
|
||||||
else if ( nMode & BROWSEMODE_DIALOGS )
|
else if ( nMode & BrowseMode::Dialogs )
|
||||||
{
|
{
|
||||||
m_pNewDlgButton->SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
|
m_pNewDlgButton->SetClickHdl( LINK( this, ObjectPage, ButtonHdl ) );
|
||||||
m_pNewModButton->Hide();
|
m_pNewModButton->Hide();
|
||||||
@@ -620,12 +620,12 @@ void ObjectPage::CheckButtons()
|
|||||||
OUString aLibName( aDesc.GetLibName() );
|
OUString aLibName( aDesc.GetLibName() );
|
||||||
OUString aLibSubName( aDesc.GetLibSubName() );
|
OUString aLibSubName( aDesc.GetLibSubName() );
|
||||||
bool bVBAEnabled = aDocument.isInVBAMode();
|
bool bVBAEnabled = aDocument.isInVBAMode();
|
||||||
sal_uInt16 nMode = m_pBasicBox->GetMode();
|
BrowseMode nMode = m_pBasicBox->GetMode();
|
||||||
|
|
||||||
sal_uInt16 nDepth = pCurEntry ? m_pBasicBox->GetModel()->GetDepth( pCurEntry ) : 0;
|
sal_uInt16 nDepth = pCurEntry ? m_pBasicBox->GetModel()->GetDepth( pCurEntry ) : 0;
|
||||||
if ( nDepth >= 2 )
|
if ( nDepth >= 2 )
|
||||||
{
|
{
|
||||||
if( bVBAEnabled && ( nMode & BROWSEMODE_MODULES ) && ( nDepth == 2 ) )
|
if( bVBAEnabled && ( nMode & BrowseMode::Modules ) && ( nDepth == 2 ) )
|
||||||
m_pEditButton->Disable();
|
m_pEditButton->Disable();
|
||||||
else
|
else
|
||||||
m_pEditButton->Enable();
|
m_pEditButton->Enable();
|
||||||
@@ -660,7 +660,7 @@ void ObjectPage::CheckButtons()
|
|||||||
// enable/disable delete button
|
// enable/disable delete button
|
||||||
if ( nDepth >= 2 && !bReadOnly && eLocation != LIBRARY_LOCATION_SHARE )
|
if ( nDepth >= 2 && !bReadOnly && eLocation != LIBRARY_LOCATION_SHARE )
|
||||||
{
|
{
|
||||||
if( bVBAEnabled && ( nMode & BROWSEMODE_MODULES ) && ( ( nDepth == 2 ) || aLibSubName == IDE_RESSTR(RID_STR_DOCUMENT_OBJECTS) ) )
|
if( bVBAEnabled && ( nMode & BrowseMode::Modules ) && ( ( nDepth == 2 ) || aLibSubName == IDE_RESSTR(RID_STR_DOCUMENT_OBJECTS) ) )
|
||||||
m_pDelButton->Disable();
|
m_pDelButton->Disable();
|
||||||
else
|
else
|
||||||
m_pDelButton->Enable();
|
m_pDelButton->Enable();
|
||||||
|
@@ -199,7 +199,7 @@ protected:
|
|||||||
virtual void DeactivatePage() override;
|
virtual void DeactivatePage() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ObjectPage(vcl::Window* pParent, const OString& rName, sal_uInt16 nMode);
|
ObjectPage(vcl::Window* pParent, const OString& rName, BrowseMode nMode);
|
||||||
virtual ~ObjectPage() override;
|
virtual ~ObjectPage() override;
|
||||||
virtual void dispose() override;
|
virtual void dispose() override;
|
||||||
|
|
||||||
|
@@ -30,11 +30,23 @@
|
|||||||
#include <basic/sbstar.hxx>
|
#include <basic/sbstar.hxx>
|
||||||
#include <sbxitem.hxx>
|
#include <sbxitem.hxx>
|
||||||
#include "basobj.hxx"
|
#include "basobj.hxx"
|
||||||
|
#include <o3tl/typed_flags_set.hxx>
|
||||||
|
|
||||||
class SbModule;
|
class SbModule;
|
||||||
class SvTreeListEntry;
|
class SvTreeListEntry;
|
||||||
class SbxVariable;
|
class SbxVariable;
|
||||||
|
|
||||||
|
enum class BrowseMode
|
||||||
|
{
|
||||||
|
Modules = 0x01,
|
||||||
|
Subs = 0x02,
|
||||||
|
Dialogs = 0x04,
|
||||||
|
All = Modules | Subs | Dialogs,
|
||||||
|
};
|
||||||
|
namespace o3tl {
|
||||||
|
template<> struct typed_flags<BrowseMode> : is_typed_flags<BrowseMode, 0x7> {};
|
||||||
|
}
|
||||||
|
|
||||||
namespace basctl
|
namespace basctl
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -52,13 +64,6 @@ enum EntryType
|
|||||||
OBJ_TYPE_CLASS_MODULES
|
OBJ_TYPE_CLASS_MODULES
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
BROWSEMODE_MODULES = 0x01,
|
|
||||||
BROWSEMODE_SUBS = 0x02,
|
|
||||||
BROWSEMODE_DIALOGS = 0x04,
|
|
||||||
};
|
|
||||||
|
|
||||||
class Entry
|
class Entry
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -172,7 +177,7 @@ public:
|
|||||||
class TreeListBox : public SvTreeListBox, public DocumentEventListener
|
class TreeListBox : public SvTreeListBox, public DocumentEventListener
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
sal_uInt16 nMode;
|
BrowseMode nMode;
|
||||||
DocumentEventNotifier m_aNotifier;
|
DocumentEventNotifier m_aNotifier;
|
||||||
void SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage );
|
void SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage );
|
||||||
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
||||||
@@ -213,8 +218,8 @@ public:
|
|||||||
|
|
||||||
bool IsEntryProtected( SvTreeListEntry* pEntry );
|
bool IsEntryProtected( SvTreeListEntry* pEntry );
|
||||||
|
|
||||||
void SetMode( sal_uInt16 nM ) { nMode = nM; }
|
void SetMode( BrowseMode nM ) { nMode = nM; }
|
||||||
sal_uInt16 GetMode() const { return nMode; }
|
BrowseMode GetMode() const { return nMode; }
|
||||||
|
|
||||||
SbModule* FindModule( SvTreeListEntry* pEntry );
|
SbModule* FindModule( SvTreeListEntry* pEntry );
|
||||||
SbxVariable* FindVariable( SvTreeListEntry* pEntry );
|
SbxVariable* FindVariable( SvTreeListEntry* pEntry );
|
||||||
|
Reference in New Issue
Block a user