diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-06 13:53:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-07 06:02:13 +0000 |
commit | d16e1336f0b1251c0e1ffbe171bc26ed48ea49f0 (patch) | |
tree | 1866ecde13151ae77f6cccb131d87dadf52430c5 /svtools | |
parent | 62410ecd5de7d514f8078727616a9a637fa171af (diff) |
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>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/imivctl.hxx | 7 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 14 |
2 files changed, 10 insertions, 11 deletions
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 6a108e369785..b9b79754db23 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -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 }; diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index a08a2627cd1e..f1454f591480 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -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 ) |