convert IcnViewFieldType to scoped enum

and drop unused IcnViewFieldTypeDontknow constant

Change-Id: I583c05d8b312b0e4fb291fa4ce8d0989318f79df
Reviewed-on: https://gerrit.libreoffice.org/33966
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2017-02-06 13:53:56 +02:00
parent 62410ecd5d
commit d16e1336f0
2 changed files with 10 additions and 11 deletions

View File

@ -82,11 +82,10 @@ namespace o3tl {
#define VIEWMODE_MASK (WB_ICON | WB_SMALLICON | WB_DETAILS)
enum IcnViewFieldType
enum class IcnViewFieldType
{
IcnViewFieldTypeDontknow = 0,
IcnViewFieldTypeImage = 1,
IcnViewFieldTypeText = 2
Image,
Text
};

View File

@ -1556,7 +1556,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const Rectangle& rRect,
IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nPaintFlags,
vcl::RenderContext& rRenderContext )
{
if (eItem == IcnViewFieldTypeText)
if (eItem == IcnViewFieldType::Text)
{
OUString aText = SvtIconChoiceCtrl::GetEntryText(pEntry, false);
@ -1651,9 +1651,9 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
bActiveSelection ? 1 : 2, false, true, false);
PaintItem(aBmpRect, IcnViewFieldTypeImage, pEntry, nBmpPaintFlags, rRenderContext);
PaintItem(aBmpRect, IcnViewFieldType::Image, pEntry, nBmpPaintFlags, rRenderContext);
PaintItem(aTextRect, IcnViewFieldTypeText, pEntry, nTextPaintFlags, rRenderContext);
PaintItem(aTextRect, IcnViewFieldType::Text, pEntry, nTextPaintFlags, rRenderContext);
// draw highlight frame
if (pEntry == pCurHighlightFrame && !bNoEmphasis)
@ -1856,7 +1856,7 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* pEntry,
long SvxIconChoiceCtrl_Impl::CalcBoundingWidth( SvxIconChoiceCtrlEntry* pEntry ) const
{
long nStringWidth = GetItemSize( pEntry, IcnViewFieldTypeText ).Width();
long nStringWidth = GetItemSize( pEntry, IcnViewFieldType::Text ).Width();
// nStringWidth += 2*LROFFS_TEXT;
long nWidth = 0;
@ -1878,7 +1878,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingWidth( SvxIconChoiceCtrlEntry* pEntry )
long SvxIconChoiceCtrl_Impl::CalcBoundingHeight( SvxIconChoiceCtrlEntry* pEntry ) const
{
long nStringHeight = GetItemSize( pEntry, IcnViewFieldTypeText).Height();
long nStringHeight = GetItemSize( pEntry, IcnViewFieldType::Text).Height();
long nHeight = 0;
switch( nWinBits & (VIEWMODE_MASK) )
@ -2437,9 +2437,9 @@ void SvxIconChoiceCtrl_Impl::Scroll( long nDeltaX, long nDeltaY )
const Size& SvxIconChoiceCtrl_Impl::GetItemSize( SvxIconChoiceCtrlEntry*,
IcnViewFieldType eItem ) const
{
if (eItem == IcnViewFieldTypeText)
if (eItem == IcnViewFieldType::Text)
return aDefaultTextSize;
return aImageSize;
return aImageSize; // IcnViewFieldType::Image
}
Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* pEntry )