Kaydet (Commit) 0e5c0c4b authored tarafından Noel Grandin's avatar Noel Grandin

use o3tl::enumarray for m_aNodeAndEntryImages

Change-Id: I508c77562ec92b078d15d2a557af474a93b940de
Reviewed-on: https://gerrit.libreoffice.org/41294Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 70027414
......@@ -24,6 +24,7 @@
#include <vcl/scrbar.hxx>
#include <vcl/vclevent.hxx>
#include <unotools/intlwrapper.hxx>
#include <o3tl/enumarray.hxx>
#include <vector>
#include "svtaccessiblefactory.hxx"
......@@ -106,19 +107,19 @@ private:
static oslInterlockedCount s_nImageRefCount; /// When 0 all static images will be destroyed
// Node Bitmaps
enum ImageType
enum class ImageType
{
itNodeExpanded = 0, // node is expanded ( usually a bitmap showing a minus )
itNodeCollapsed, // node is collapsed ( usually a bitmap showing a plus )
itNodeDontKnow, // don't know the node state
itEntryDefExpanded, // default for expanded entries
itEntryDefCollapsed, // default for collapsed entries
IT_IMAGE_COUNT
NodeExpanded = 0, // node is expanded ( usually a bitmap showing a minus )
NodeCollapsed, // node is collapsed ( usually a bitmap showing a plus )
NodeDontKnow, // don't know the node state
EntryDefExpanded, // default for expanded entries
EntryDefCollapsed, // default for collapsed entries
LAST = EntryDefCollapsed
};
// all our images
Image m_aNodeAndEntryImages[ IT_IMAGE_COUNT ];
o3tl::enumarray<ImageType, Image>
m_aNodeAndEntryImages;
ImpLBSelEng aFctSet;
Idle aAsyncBeginDragIdle;
......@@ -339,58 +340,54 @@ public:
inline Image& SvImpLBox::implGetImageLocation( const ImageType _eType )
{
DBG_ASSERT( ( _eType >= 0 ) && ( _eType < IT_IMAGE_COUNT ),
"SvImpLBox::implGetImageLocation: invalid image index (will crash)!" );
Image* _pSet = m_aNodeAndEntryImages;
return *( _pSet + (sal_Int32)_eType );
return m_aNodeAndEntryImages[_eType];
}
inline void SvImpLBox::SetExpandedNodeBmp( const Image& rImg )
{
implGetImageLocation( itNodeExpanded ) = rImg;
implGetImageLocation( ImageType::NodeExpanded ) = rImg;
SetNodeBmpYOffset( rImg );
}
inline void SvImpLBox::SetCollapsedNodeBmp( const Image& rImg )
{
implGetImageLocation( itNodeCollapsed ) = rImg;
implGetImageLocation( ImageType::NodeCollapsed ) = rImg;
SetNodeBmpYOffset( rImg );
}
inline const Image& SvImpLBox::GetDontKnowNodeBmp( )
{
return implGetImageLocation( itNodeDontKnow );
return implGetImageLocation( ImageType::NodeDontKnow );
}
inline const Image& SvImpLBox::GetExpandedNodeBmp( )
{
return implGetImageLocation( itNodeExpanded );
return implGetImageLocation( ImageType::NodeExpanded );
}
inline const Image& SvImpLBox::GetCollapsedNodeBmp( )
{
return implGetImageLocation( itNodeCollapsed );
return implGetImageLocation( ImageType::NodeCollapsed );
}
inline void SvImpLBox::SetDefaultEntryExpBmp( const Image& _rImg )
{
implGetImageLocation( itEntryDefExpanded ) = _rImg;
implGetImageLocation( ImageType::EntryDefExpanded ) = _rImg;
}
inline void SvImpLBox::SetDefaultEntryColBmp( const Image& _rImg )
{
implGetImageLocation( itEntryDefCollapsed ) = _rImg;
implGetImageLocation( ImageType::EntryDefCollapsed ) = _rImg;
}
inline const Image& SvImpLBox::GetDefaultEntryExpBmp( )
{
return implGetImageLocation( itEntryDefExpanded );
return implGetImageLocation( ImageType::EntryDefExpanded );
}
inline const Image& SvImpLBox::GetDefaultEntryColBmp( )
{
return implGetImageLocation( itEntryDefCollapsed );
return implGetImageLocation( ImageType::EntryDefCollapsed );
}
inline Point SvImpLBox::GetEntryPosition( SvTreeListEntry* pEntry ) const
......
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