summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-06-10 19:55:12 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-20 09:33:49 +0000
commitcf5208b67180dc1deaeca611706087b1e2acc1ae (patch)
treebcf5b5b1e239704bf35d31604e6eb971d2266307 /svtools/source
parent2d67042dc2f0672d1aca4784e61eb2a5d0e91e08 (diff)
Convert PART to scoped enum
Change-Id: If4c2849beb207593d3d450ae3846ed24eaf66ca4 Reviewed-on: https://gerrit.libreoffice.org/26173 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/contnr/svimpbox.cxx4
-rw-r--r--svtools/source/contnr/svlbitm.cxx8
-rw-r--r--svtools/source/contnr/treelistbox.cxx4
-rw-r--r--svtools/source/control/headbar.cxx12
-rw-r--r--svtools/source/control/tabbar.cxx4
-rw-r--r--svtools/source/control/toolbarmenu.cxx32
6 files changed, 32 insertions, 32 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 10e0cd7b468f..20e218b0aa06 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -1026,11 +1026,11 @@ void SvImpLBox::DrawNet(vcl::RenderContext& rRenderContext)
// for platforms that don't have nets, DrawNativeControl does nothing and returns true
// so that SvImpLBox::DrawNet() doesn't draw anything either
- if (rRenderContext.IsNativeControlSupported(ControlType::ListNet, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListNet, ControlPart::Entire))
{
ImplControlValue aControlValue;
ControlState nState = ControlState::ENABLED;
- if (rRenderContext.DrawNativeControl(ControlType::ListNet, PART_ENTIRE_CONTROL,
+ if (rRenderContext.DrawNativeControl(ControlType::ListNet, ControlPart::Entire,
Rectangle(), nState, aControlValue, OUString()))
{
return;
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 9392dce6f052..d12b792096b8 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -338,7 +338,7 @@ void SvLBoxButton::Paint(
//Native drawing
bool bNativeOK = false;
ControlType eCtrlType = (pData->IsRadio())? ControlType::Radiobutton : ControlType::Checkbox;
- if ( nIndex != SvBmp::STATICIMAGE && rRenderContext.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
+ if ( nIndex != SvBmp::STATICIMAGE && rRenderContext.IsNativeControlSupported( eCtrlType, ControlPart::Entire) )
{
Size aSize(pData->Width(), pData->Height());
@@ -360,7 +360,7 @@ void SvLBoxButton::Paint(
aControlValue.setTristateVal( ButtonValue::Mixed );
if (isVis)
- bNativeOK = rRenderContext.DrawNativeControl(eCtrlType, PART_ENTIRE_CONTROL,
+ bNativeOK = rRenderContext.DrawNativeControl(eCtrlType, ControlPart::Entire,
aCtrlRegion, nState, aControlValue, OUString());
}
@@ -380,7 +380,7 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource )
void SvLBoxButton::ImplAdjustBoxSize(Size& io_rSize, ControlType i_eType, vcl::RenderContext& rRenderContext)
{
- if (rRenderContext.IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) )
+ if (rRenderContext.IsNativeControlSupported( i_eType, ControlPart::Entire) )
{
ImplControlValue aControlValue;
Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize );
@@ -390,7 +390,7 @@ void SvLBoxButton::ImplAdjustBoxSize(Size& io_rSize, ControlType i_eType, vcl::R
Rectangle aNativeBounds, aNativeContent;
bool bNativeOK = rRenderContext.GetNativeControlRegion( i_eType,
- PART_ENTIRE_CONTROL,
+ ControlPart::Entire,
aCtrlRegion,
nState,
aControlValue,
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index b0e1333d000a..abc8d353e0da 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3034,7 +3034,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
//native
bool bNativeOK = false;
- if (rRenderContext.IsNativeControlSupported(ControlType::ListNode, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListNode, ControlPart::Entire))
{
ImplControlValue aControlValue;
Rectangle aCtrlRegion(aPos, pImg->GetSizePixel());
@@ -3059,7 +3059,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
}
}
- bNativeOK = rRenderContext.DrawNativeControl(ControlType::ListNode, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString());
+ bNativeOK = rRenderContext.DrawNativeControl(ControlType::ListNode, ControlPart::Entire, aCtrlRegion, nState, aControlValue, OUString());
}
if (!bNativeOK)
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 3007ab0aa807..2efc557a66ca 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -310,10 +310,10 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
HeaderBarItemBits nBits = pItem->mnBits;
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground, ControlPart::Entire))
{
aCtrlRegion = aRect;
- rRenderContext.DrawNativeControl(ControlType::WindowBackground, PART_ENTIRE_CONTROL,
+ rRenderContext.DrawNativeControl(ControlType::WindowBackground, ControlPart::Entire,
aCtrlRegion, nState, aControlValue, OUString());
}
@@ -332,14 +332,14 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
Color aSelectionTextColor(COL_TRANSPARENT);
- if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, PART_BUTTON))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, ControlPart::Button))
{
aCtrlRegion = aRect;
aControlValue.setTristateVal(ButtonValue::On);
nState |= ControlState::ENABLED;
if (bHigh)
nState |= ControlState::PRESSED;
- rRenderContext.DrawNativeControl(ControlType::ListHeader, PART_BUTTON,
+ rRenderContext.DrawNativeControl(ControlType::ListHeader, ControlPart::Button,
aCtrlRegion, nState, aControlValue, OUString());
}
else
@@ -553,7 +553,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
if (bDraw)
{
- if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, PART_ARROW))
+ if (rRenderContext.IsNativeControlSupported(ControlType::ListHeader, ControlPart::Arrow))
{
aCtrlRegion = Rectangle(Point(nArrowX, aRect.Top()), Size(nArrowWidth, aRect.GetHeight()));
// control value passes 1 if arrow points down, 0 otherwise
@@ -561,7 +561,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
nState |= ControlState::ENABLED;
if (bHigh)
nState |= ControlState::PRESSED;
- rRenderContext.DrawNativeControl(ControlType::ListHeader, PART_ARROW, aCtrlRegion,
+ rRenderContext.DrawNativeControl(ControlType::ListHeader, ControlPart::Arrow, aCtrlRegion,
nState, aControlValue, OUString());
}
else
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index c9859e7b93d5..345a8f902be8 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1187,9 +1187,9 @@ void TabBar::MouseButtonUp(const MouseEvent& rMEvt)
void TabBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rect)
{
- if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground,PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground,ControlPart::Entire))
{
- rRenderContext.DrawNativeControl(ControlType::WindowBackground,PART_ENTIRE_CONTROL,rect,
+ rRenderContext.DrawNativeControl(ControlType::WindowBackground,ControlPart::Entire,rect,
ControlState::ENABLED,ImplControlValue(0),OUString());
}
// calculate items and emit
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 51f1e8ec17d8..0d1578405d67 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -545,9 +545,9 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, l
Rectangle aNativeContent;
Point tmp( 0, 0 );
Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
- if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_CHECK_MARK))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItemCheckMark))
{
- if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_CHECK_MARK),
+ if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::MenuItemCheckMark,
aCtrlRegion, ControlState::ENABLED, aVal, OUString(),
aNativeBounds, aNativeContent)
)
@@ -556,9 +556,9 @@ static long ImplGetNativeCheckAndRadioSize(vcl::RenderContext& rRenderContext, l
rMaxWidth = aNativeContent.GetWidth();
}
}
- if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM_RADIO_MARK))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItemRadioMark))
{
- if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart(PART_MENU_ITEM_RADIO_MARK),
+ if (rRenderContext.GetNativeControlRegion(ControlType::MenuPopup, ControlPart::MenuItemRadioMark,
aCtrlRegion, ControlState::ENABLED, aVal, OUString(),
aNativeBounds, aNativeContent)
)
@@ -634,8 +634,8 @@ Size ToolbarMenu::implCalcSize()
if( pEntry->HasCheck() && !pEntry->mbHasImage )
{
if (IsNativeControlSupported(ControlType::MenuPopup, (pEntry->mnBits & MenuItemBits::RADIOCHECK)
- ? PART_MENU_ITEM_CHECK_MARK
- : PART_MENU_ITEM_RADIO_MARK ) )
+ ? ControlPart::MenuItemCheckMark
+ : ControlPart::MenuItemRadioMark ) )
{
long nCheckHeight = 0, nRadioHeight = 0, nMaxCheckWidth = 0;
ImplGetNativeCheckAndRadioSize(*this, nCheckHeight, nRadioHeight, nMaxCheckWidth);
@@ -811,19 +811,19 @@ void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHi
aItemRect.Right() -= nFontHeight + nFontHeight / 4;
}
- if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_ENTIRE_CONTROL))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire))
{
Size aPxSize(GetOutputSizePixel());
rRenderContext.Push(PushFlags::CLIPREGION);
rRenderContext.IntersectClipRegion(Rectangle(Point(nX, nY), Size(aSz.Width(), pEntry->maSize.Height())));
Rectangle aCtrlRect(Point(nX, 0), Size(aPxSize.Width() - nX, aPxSize.Height()));
- rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_ENTIRE_CONTROL, aCtrlRect,
+ rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire, aCtrlRect,
ControlState::ENABLED, ImplControlValue(), OUString());
- if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, PART_MENU_ITEM))
+ if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::MenuItem))
{
bDrawItemRect = false;
ControlState eState = ControlState::SELECTED | (pEntry->mbEnabled ? ControlState::ENABLED : ControlState::NONE);
- if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, PART_MENU_ITEM, aItemRect,
+ if (!rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::MenuItem, aItemRect,
eState, ImplControlValue(), OUString()))
{
bDrawItemRect = true;
@@ -1168,14 +1168,14 @@ void ToolbarMenu::KeyInput( const KeyEvent& rKEvent )
static void ImplPaintCheckBackground(vcl::RenderContext& rRenderContext, vcl::Window& rWindow, const Rectangle& i_rRect, bool i_bHighlight )
{
bool bNativeOk = false;
- if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, PART_BUTTON))
+ if (rRenderContext.IsNativeControlSupported(ControlType::Toolbar, ControlPart::Button))
{
ImplControlValue aControlValue;
ControlState nState = ControlState::PRESSED | ControlState::ENABLED;
aControlValue.setTristateVal(ButtonValue::On);
- bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, PART_BUTTON,
+ bNativeOk = rRenderContext.DrawNativeControl(ControlType::Toolbar, ControlPart::Button,
i_rRect, nState, aControlValue, OUString());
}
@@ -1277,12 +1277,12 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry
{
if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup,
(pEntry->mnBits & MenuItemBits::RADIOCHECK)
- ? PART_MENU_ITEM_CHECK_MARK
- : PART_MENU_ITEM_RADIO_MARK))
+ ? ControlPart::MenuItemCheckMark
+ : ControlPart::MenuItemRadioMark))
{
ControlPart nPart = ((pEntry->mnBits & MenuItemBits::RADIOCHECK)
- ? PART_MENU_ITEM_RADIO_MARK
- : PART_MENU_ITEM_CHECK_MARK);
+ ? ControlPart::MenuItemRadioMark
+ : ControlPart::MenuItemCheckMark);
ControlState nState = ControlState::NONE;