summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-03 19:04:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-04 08:53:37 +0200
commit53df91adab37a65d87a44aa724b28128f32e9de5 (patch)
tree1d7b31ee1eeeb9691ccb732f0cb0e06aad4ae5b6 /basctl
parent89c0b79911c469518c8872a4ec06b3d2c61c357c (diff)
loplugin:singlevalfields
Change-Id: Ic74b400f0b929b4c57ad70d0b0936983a3d46360 Reviewed-on: https://gerrit.libreoffice.org/80154 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/bastype2.cxx25
-rw-r--r--basctl/source/basicide/bastype3.cxx3
-rw-r--r--basctl/source/inc/bastype2.hxx6
3 files changed, 5 insertions, 29 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 5d510411aef4..75be6630011e 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -165,7 +165,6 @@ TreeListBox::TreeListBox (vcl::Window* pParent, WinBits nStyle)
{
SetNodeDefaultImages();
SetSelectionMode( SelectionMode::Single );
- nMode = BrowseMode::All; // everything
}
VCL_BUILDER_FACTORY_CONSTRUCTOR(TreeListBox, WB_TABSTOP)
@@ -257,11 +256,7 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons
}
// create tree list box entry
- OUString sId;
- if ( ( nMode & BrowseMode::Dialogs ) && !( nMode & BrowseMode::Modules ) )
- sId = bLoaded ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_DLGLIBNOTLOADED);
- else
- sId = bLoaded ? OUStringLiteral(RID_BMP_MODLIB) : OUStringLiteral(RID_BMP_MODLIBNOTLOADED);
+ OUString sId = bLoaded ? OUStringLiteral(RID_BMP_MODLIB) : OUStringLiteral(RID_BMP_MODLIBNOTLOADED);
SvTreeListEntry* pLibRootEntry = FindEntry( pDocumentRootEntry, aLibName, OBJ_TYPE_LIBRARY );
if ( pLibRootEntry )
{
@@ -284,7 +279,6 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons
void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName )
{
// modules
- if ( nMode & BrowseMode::Modules )
{
Reference< script::XLibraryContainer > xModLibContainer( rDocument.getLibraryContainer( E_SCRIPTS ) );
@@ -315,7 +309,6 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const
}
// methods
- if ( nMode & BrowseMode::Subs )
{
Sequence< OUString > aNames = GetMethodNames( rDocument, rLibName, aModName );
FillTreeListBox( pModuleEntry, aNames, OBJ_TYPE_METHOD, RID_BMP_MACRO );
@@ -331,7 +324,6 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const
}
// dialogs
- if ( nMode & BrowseMode::Dialogs )
{
Reference< script::XLibraryContainer > xDlgLibContainer( rDocument.getLibraryContainer( E_DIALOGS ) );
@@ -440,7 +432,6 @@ void TreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvTreeListEntry* pLibSubRo
}
// methods
- if ( nMode & BrowseMode::Subs )
{
Sequence< OUString > aNames = GetMethodNames( rDocument, rLibName, aModName );
FillTreeListBox( pModuleEntry, aNames, OBJ_TYPE_METHOD, RID_BMP_MACRO );
@@ -667,19 +658,9 @@ void TreeListBox::SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage
SetCollapsedEntryBmp( pEntry, rImage );
}
-LibraryType TreeListBox::GetLibraryType() const
+OUString TreeListBox::GetRootEntryName( const ScriptDocument& rDocument, LibraryLocation eLocation )
{
- LibraryType eType = LibraryType::All;
- if ( ( nMode & BrowseMode::Modules ) && !( nMode & BrowseMode::Dialogs ) )
- eType = LibraryType::Module;
- else if ( !( nMode & BrowseMode::Modules ) && ( nMode & BrowseMode::Dialogs ) )
- eType = LibraryType::Dialog;
- return eType;
-}
-
-OUString TreeListBox::GetRootEntryName( const ScriptDocument& rDocument, LibraryLocation eLocation ) const
-{
- return rDocument.getTitle( eLocation, GetLibraryType() );
+ return rDocument.getTitle( eLocation, LibraryType::All );
}
void TreeListBox::GetRootEntryBitmaps( const ScriptDocument& rDocument, Image& rImage )
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index 8e479a1308f9..68d5fb1c47c3 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -107,8 +107,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry )
ImpCreateLibSubEntries( pEntry, aDocument, aOULibName );
// exchange image
- const bool bDlgMode = (nMode & BrowseMode::Dialogs) && !(nMode & BrowseMode::Modules);
- Image aImage(StockImage::Yes, bDlgMode ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_MODLIB));
+ Image aImage(StockImage::Yes, OUStringLiteral(RID_BMP_MODLIB));
SetEntryBitmaps( pEntry, aImage );
}
else
diff --git a/basctl/source/inc/bastype2.hxx b/basctl/source/inc/bastype2.hxx
index 7b75426e6043..7f14f3f66ca0 100644
--- a/basctl/source/inc/bastype2.hxx
+++ b/basctl/source/inc/bastype2.hxx
@@ -179,7 +179,6 @@ public:
class TreeListBox : public SvTreeListBox, public DocumentEventListener
{
private:
- BrowseMode nMode;
DocumentEventNotifier m_aNotifier;
void SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage );
virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
@@ -236,13 +235,10 @@ public:
void RemoveEntry (SvTreeListEntry const *);
void RemoveEntry (ScriptDocument const&);
- OUString GetRootEntryName( const ScriptDocument& rDocument, LibraryLocation eLocation ) const;
+ static OUString GetRootEntryName( const ScriptDocument& rDocument, LibraryLocation eLocation );
static void GetRootEntryBitmaps( const ScriptDocument& rDocument, Image& rImage );
void SetCurrentEntry (EntryDescriptor const &);
-
-private:
- LibraryType GetLibraryType() const;
};
class SbTreeListBox : public DocumentEventListener