diff options
author | Noel Grandin <noel@peralex.com> | 2015-07-24 09:41:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-07-24 09:52:08 +0200 |
commit | 9582380ebc2dd241ee90951c3b28d420e140bcde (patch) | |
tree | af50c827125933203afeff8124d65ded57417e49 | |
parent | 9e28cc8ca79b5c42955867a62e89faf8facc5e80 (diff) |
convert ImageAlign to enum class
Change-Id: I22e2e66a1f0b230403ad1d9c1f5b7f34a6ee6ea5
-rw-r--r-- | dbaccess/source/ui/control/opendoccontrols.cxx | 2 | ||||
-rw-r--r-- | include/tools/wintypes.hxx | 8 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgass.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/helper/imagealign.cxx | 80 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 78 | ||||
-rw-r--r-- | vcl/source/control/morebtn.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 6 |
8 files changed, 90 insertions, 90 deletions
diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 05d94804aa4c..35792db9747e 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -177,7 +177,7 @@ namespace dbaui SetModeImage( GetCommandIcon( ".uno:Open", m_sModule ) ); EnableImageDisplay( true ); EnableTextDisplay( true ); - SetImageAlign( IMAGEALIGN_LEFT ); + SetImageAlign( ImageAlign::Left ); SetStyle( GetStyle() | WB_CENTER ); } diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index 01a04d921803..781865d1ff88 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -287,10 +287,10 @@ WinBits const WB_EXT_DOCMODIFIED = 0x00000002; enum class WindowAlign { Left, Top, Right, Bottom }; -enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM, - IMAGEALIGN_LEFT_TOP, IMAGEALIGN_LEFT_BOTTOM, IMAGEALIGN_TOP_LEFT, - IMAGEALIGN_TOP_RIGHT, IMAGEALIGN_RIGHT_TOP, IMAGEALIGN_RIGHT_BOTTOM, - IMAGEALIGN_BOTTOM_LEFT, IMAGEALIGN_BOTTOM_RIGHT, IMAGEALIGN_CENTER }; +enum class ImageAlign { Left, Top, Right, Bottom, + LeftTop, LeftBottom, TopLeft, + TopRight, RightTop, RightBottom, + BottomLeft, BottomRight, Center }; enum class SymbolAlign { LEFT, RIGHT }; diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 3373adecc4b3..9a1f0c7fd2a2 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -418,7 +418,7 @@ AssistentDlgImpl::AssistentDlgImpl( vcl::Window* pWindow, const Link<>& rFinishL ); mpPage1OpenPB->EnableImageDisplay(true); mpPage1OpenPB->EnableTextDisplay(true); - mpPage1OpenPB->SetImageAlign(IMAGEALIGN_LEFT); + mpPage1OpenPB->SetImageAlign(ImageAlign::Left); mpPage1OpenPB->SetStyle(mpPage1OpenPB->GetStyle() | WB_CENTER); } diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index c33e862e2f37..c3e2a9a6c87a 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -228,7 +228,7 @@ bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const case BASEPROPERTY_DECIMALACCURACY: aDefault <<= (sal_Int16) 2; break; case BASEPROPERTY_LINECOUNT: aDefault <<= (sal_Int16) 5; break; case BASEPROPERTY_ALIGN: aDefault <<= (sal_Int16) PROPERTY_ALIGN_LEFT; break; - case BASEPROPERTY_IMAGEALIGN: aDefault <<= (sal_Int16) 1 /*ImageAlign::TOP*/; break; + case BASEPROPERTY_IMAGEALIGN: aDefault <<= (sal_Int16) 1 /*ImageAlign::Top*/; break; case BASEPROPERTY_IMAGEPOSITION: aDefault <<= (sal_Int16) 12 /*ImagePosition::Centered*/; break; case BASEPROPERTY_PUSHBUTTONTYPE: aDefault <<= (sal_Int16) 0 /*PushButtonType::STANDARD*/; break; case BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR:aDefault <<= (sal_Int16) awt::MouseWheelBehavior::SCROLL_FOCUS_ONLY; break; diff --git a/toolkit/source/helper/imagealign.cxx b/toolkit/source/helper/imagealign.cxx index 75440a2e8e96..8f97ec496859 100644 --- a/toolkit/source/helper/imagealign.cxx +++ b/toolkit/source/helper/imagealign.cxx @@ -34,19 +34,19 @@ namespace toolkit sal_Int16 nReturn = AboveCenter; switch ( _eVCLAlign ) { - case IMAGEALIGN_LEFT: nReturn = LeftCenter; break; - case IMAGEALIGN_TOP: nReturn = AboveCenter; break; - case IMAGEALIGN_RIGHT: nReturn = RightCenter; break; - case IMAGEALIGN_BOTTOM: nReturn = BelowCenter; break; - case IMAGEALIGN_LEFT_TOP: nReturn = LeftTop; break; - case IMAGEALIGN_LEFT_BOTTOM: nReturn = LeftBottom; break; - case IMAGEALIGN_TOP_LEFT: nReturn = AboveLeft; break; - case IMAGEALIGN_TOP_RIGHT: nReturn = AboveRight; break; - case IMAGEALIGN_RIGHT_TOP: nReturn = RightTop; break; - case IMAGEALIGN_RIGHT_BOTTOM: nReturn = RightBottom; break; - case IMAGEALIGN_BOTTOM_LEFT: nReturn = BelowLeft; break; - case IMAGEALIGN_BOTTOM_RIGHT: nReturn = BelowRight; break; - case IMAGEALIGN_CENTER: nReturn = Centered; break; + case ImageAlign::Left: nReturn = LeftCenter; break; + case ImageAlign::Top: nReturn = AboveCenter; break; + case ImageAlign::Right: nReturn = RightCenter; break; + case ImageAlign::Bottom: nReturn = BelowCenter; break; + case ImageAlign::LeftTop: nReturn = LeftTop; break; + case ImageAlign::LeftBottom: nReturn = LeftBottom; break; + case ImageAlign::TopLeft: nReturn = AboveLeft; break; + case ImageAlign::TopRight: nReturn = AboveRight; break; + case ImageAlign::RightTop: nReturn = RightTop; break; + case ImageAlign::RightBottom: nReturn = RightBottom; break; + case ImageAlign::BottomLeft: nReturn = BelowLeft; break; + case ImageAlign::BottomRight: nReturn = BelowRight; break; + case ImageAlign::Center: nReturn = Centered; break; default: OSL_FAIL( "translateImagePosition: unknown IMAGEALIGN value!" ); } @@ -55,22 +55,22 @@ namespace toolkit ImageAlign translateImagePosition( sal_Int16 _eUNOAlign ) { - ImageAlign nReturn = IMAGEALIGN_TOP; + ImageAlign nReturn = ImageAlign::Top; switch ( _eUNOAlign ) { - case LeftCenter: nReturn = IMAGEALIGN_LEFT; break; - case AboveCenter: nReturn = IMAGEALIGN_TOP; break; - case RightCenter: nReturn = IMAGEALIGN_RIGHT; break; - case BelowCenter: nReturn = IMAGEALIGN_BOTTOM; break; - case LeftTop: nReturn = IMAGEALIGN_LEFT_TOP; break; - case LeftBottom: nReturn = IMAGEALIGN_LEFT_BOTTOM; break; - case AboveLeft: nReturn = IMAGEALIGN_TOP_LEFT; break; - case AboveRight: nReturn = IMAGEALIGN_TOP_RIGHT; break; - case RightTop: nReturn = IMAGEALIGN_RIGHT_TOP; break; - case RightBottom: nReturn = IMAGEALIGN_RIGHT_BOTTOM; break; - case BelowLeft: nReturn = IMAGEALIGN_BOTTOM_LEFT; break; - case BelowRight: nReturn = IMAGEALIGN_BOTTOM_RIGHT; break; - case Centered: nReturn = IMAGEALIGN_CENTER; break; + case LeftCenter: nReturn = ImageAlign::Left; break; + case AboveCenter: nReturn = ImageAlign::Top; break; + case RightCenter: nReturn = ImageAlign::Right; break; + case BelowCenter: nReturn = ImageAlign::Bottom; break; + case LeftTop: nReturn = ImageAlign::LeftTop; break; + case LeftBottom: nReturn = ImageAlign::LeftBottom; break; + case AboveLeft: nReturn = ImageAlign::TopLeft; break; + case AboveRight: nReturn = ImageAlign::TopRight; break; + case RightTop: nReturn = ImageAlign::RightTop; break; + case RightBottom: nReturn = ImageAlign::RightBottom; break; + case BelowLeft: nReturn = ImageAlign::BottomLeft; break; + case BelowRight: nReturn = ImageAlign::BottomRight; break; + case Centered: nReturn = ImageAlign::Center; break; default: OSL_FAIL( "translateImagePosition: unknown css.awt.ImagePosition value!" ); } @@ -82,23 +82,23 @@ namespace toolkit sal_Int16 nReturn = TOP; switch ( _eAlign ) { - case IMAGEALIGN_LEFT_TOP: - case IMAGEALIGN_LEFT: - case IMAGEALIGN_LEFT_BOTTOM: nReturn = LEFT; break; + case ImageAlign::LeftTop: + case ImageAlign::Left: + case ImageAlign::LeftBottom: nReturn = LEFT; break; - case IMAGEALIGN_TOP_LEFT: - case IMAGEALIGN_TOP: - case IMAGEALIGN_TOP_RIGHT: nReturn = TOP; break; + case ImageAlign::TopLeft: + case ImageAlign::Top: + case ImageAlign::TopRight: nReturn = TOP; break; - case IMAGEALIGN_RIGHT_TOP: - case IMAGEALIGN_RIGHT: - case IMAGEALIGN_RIGHT_BOTTOM: nReturn = RIGHT; break; + case ImageAlign::RightTop: + case ImageAlign::Right: + case ImageAlign::RightBottom: nReturn = RIGHT; break; - case IMAGEALIGN_BOTTOM_LEFT: - case IMAGEALIGN_BOTTOM: - case IMAGEALIGN_BOTTOM_RIGHT: nReturn = BOTTOM; break; + case ImageAlign::BottomLeft: + case ImageAlign::Bottom: + case ImageAlign::BottomRight: nReturn = BOTTOM; break; - case IMAGEALIGN_CENTER: nReturn = TOP; break; + case ImageAlign::Center: nReturn = TOP; break; default: OSL_FAIL( "getCompatibleImageAlign: unknown IMAGEALIGN value!" ); } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index a10646189d74..f5dd84c6c4fe 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -82,7 +82,7 @@ public: }; ImplCommonButtonData::ImplCommonButtonData() : maFocusRect(), mnSeparatorX(0), mnButtonState(DrawButtonFlags::NONE), -mbSmallSymbol(false), maImage(), meImageAlign(IMAGEALIGN_TOP), meSymbolAlign(SymbolAlign::LEFT) +mbSmallSymbol(false), maImage(), meImageAlign(ImageAlign::Top), meSymbolAlign(SymbolAlign::LEFT) { } @@ -333,21 +333,21 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, if (bDrawText) { - if ((eImageAlign == IMAGEALIGN_LEFT_TOP) || - (eImageAlign == IMAGEALIGN_LEFT ) || - (eImageAlign == IMAGEALIGN_LEFT_BOTTOM) || - (eImageAlign == IMAGEALIGN_RIGHT_TOP) || - (eImageAlign == IMAGEALIGN_RIGHT) || - (eImageAlign == IMAGEALIGN_RIGHT_BOTTOM)) + if ((eImageAlign == ImageAlign::LeftTop) || + (eImageAlign == ImageAlign::Left ) || + (eImageAlign == ImageAlign::LeftBottom) || + (eImageAlign == ImageAlign::RightTop) || + (eImageAlign == ImageAlign::Right) || + (eImageAlign == ImageAlign::RightBottom)) { aRect.Right() -= (aImageSize.Width() + nImageSep); } - else if ((eImageAlign == IMAGEALIGN_TOP_LEFT) || - (eImageAlign == IMAGEALIGN_TOP) || - (eImageAlign == IMAGEALIGN_TOP_RIGHT) || - (eImageAlign == IMAGEALIGN_BOTTOM_LEFT) || - (eImageAlign == IMAGEALIGN_BOTTOM) || - (eImageAlign == IMAGEALIGN_BOTTOM_RIGHT)) + else if ((eImageAlign == ImageAlign::TopLeft) || + (eImageAlign == ImageAlign::Top) || + (eImageAlign == ImageAlign::TopRight) || + (eImageAlign == ImageAlign::BottomLeft) || + (eImageAlign == ImageAlign::Bottom) || + (eImageAlign == ImageAlign::BottomRight)) { aRect.Bottom() -= (aImageSize.Height() + nImageSep); } @@ -373,56 +373,56 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, // Now calculate the output area for the image and the text according to the image align flags - if ((eImageAlign == IMAGEALIGN_LEFT) || - (eImageAlign == IMAGEALIGN_RIGHT)) + if ((eImageAlign == ImageAlign::Left) || + (eImageAlign == ImageAlign::Right)) { aImagePos.Y() = rPos.Y() + (aMax.Height() - aImageSize.Height()) / 2; aTextPos.Y() = rPos.Y() + (aMax.Height() - aTSSize.Height()) / 2; } - else if ((eImageAlign == IMAGEALIGN_LEFT_BOTTOM) || - (eImageAlign == IMAGEALIGN_RIGHT_BOTTOM)) + else if ((eImageAlign == ImageAlign::LeftBottom) || + (eImageAlign == ImageAlign::RightBottom)) { aImagePos.Y() = rPos.Y() + aMax.Height() - aImageSize.Height(); aTextPos.Y() = rPos.Y() + aMax.Height() - aTSSize.Height(); } - else if ((eImageAlign == IMAGEALIGN_TOP) || - (eImageAlign == IMAGEALIGN_BOTTOM)) + else if ((eImageAlign == ImageAlign::Top) || + (eImageAlign == ImageAlign::Bottom)) { aImagePos.X() = rPos.X() + (aMax.Width() - aImageSize.Width()) / 2; aTextPos.X() = rPos.X() + (aMax.Width() - aTSSize.Width()) / 2; } - else if ((eImageAlign == IMAGEALIGN_TOP_RIGHT) || - (eImageAlign == IMAGEALIGN_BOTTOM_RIGHT)) + else if ((eImageAlign == ImageAlign::TopRight) || + (eImageAlign == ImageAlign::BottomRight)) { aImagePos.X() = rPos.X() + aMax.Width() - aImageSize.Width(); aTextPos.X() = rPos.X() + aMax.Width() - aTSSize.Width(); } - if ((eImageAlign == IMAGEALIGN_LEFT_TOP) || - (eImageAlign == IMAGEALIGN_LEFT) || - (eImageAlign == IMAGEALIGN_LEFT_BOTTOM)) + if ((eImageAlign == ImageAlign::LeftTop) || + (eImageAlign == ImageAlign::Left) || + (eImageAlign == ImageAlign::LeftBottom)) { aTextPos.X() = rPos.X() + aImageSize.Width() + nImageSep; } - else if ((eImageAlign == IMAGEALIGN_RIGHT_TOP) || - (eImageAlign == IMAGEALIGN_RIGHT) || - (eImageAlign == IMAGEALIGN_RIGHT_BOTTOM)) + else if ((eImageAlign == ImageAlign::RightTop) || + (eImageAlign == ImageAlign::Right) || + (eImageAlign == ImageAlign::RightBottom)) { aImagePos.X() = rPos.X() + aTSSize.Width() + nImageSep; } - else if ((eImageAlign == IMAGEALIGN_TOP_LEFT) || - (eImageAlign == IMAGEALIGN_TOP) || - (eImageAlign == IMAGEALIGN_TOP_RIGHT)) + else if ((eImageAlign == ImageAlign::TopLeft) || + (eImageAlign == ImageAlign::Top) || + (eImageAlign == ImageAlign::TopRight)) { aTextPos.Y() = rPos.Y() + aImageSize.Height() + nImageSep; } - else if ((eImageAlign == IMAGEALIGN_BOTTOM_LEFT) || - (eImageAlign == IMAGEALIGN_BOTTOM) || - (eImageAlign == IMAGEALIGN_BOTTOM_RIGHT)) + else if ((eImageAlign == ImageAlign::BottomLeft) || + (eImageAlign == ImageAlign::Bottom) || + (eImageAlign == ImageAlign::BottomRight)) { aImagePos.Y() = rPos.Y() + aTSSize.Height() + nImageSep; } - else if (eImageAlign == IMAGEALIGN_CENTER) + else if (eImageAlign == ImageAlign::Center) { aImagePos.X() = rPos.X() + (aMax.Width() - aImageSize.Width()) / 2; aImagePos.Y() = rPos.Y() + (aMax.Height() - aImageSize.Height()) / 2; @@ -593,15 +593,15 @@ bool Button::set_property(const OString &rKey, const OString &rValue) { if (rKey == "image-position") { - ImageAlign eAlign = IMAGEALIGN_LEFT; + ImageAlign eAlign = ImageAlign::Left; if (rValue == "left") - eAlign = IMAGEALIGN_LEFT; + eAlign = ImageAlign::Left; else if (rValue == "right") - eAlign = IMAGEALIGN_RIGHT; + eAlign = ImageAlign::Right; else if (rValue == "top") - eAlign = IMAGEALIGN_TOP; + eAlign = ImageAlign::Top; else if (rValue == "bottom") - eAlign = IMAGEALIGN_BOTTOM; + eAlign = ImageAlign::Bottom; SetImageAlign(eAlign); } else diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index 999c3c308d73..ec91329e4498 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -48,7 +48,7 @@ void MoreButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) ShowState(); SetSymbolAlign(SymbolAlign::RIGHT); - SetImageAlign(IMAGEALIGN_RIGHT); //Resoves: fdo#31849 ensure button remains vertically centered + SetImageAlign(ImageAlign::Right); //Resoves: fdo#31849 ensure button remains vertically centered SetSmallSymbol(true); if ( ! ( nStyle & ( WB_RIGHT | WB_LEFT ) ) ) diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 9a5a5b50d071..f16d439f1bb5 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1375,7 +1375,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & xButton = extractStockAndBuildMenuButton(pParent, rMap); m_pParserState->m_aButtonMenuMaps.push_back(ButtonMenuMap(id, sMenu)); } - xButton->SetImageAlign(IMAGEALIGN_LEFT); //default to left + xButton->SetImageAlign(ImageAlign::Left); //default to left setupFromActionName(xButton, rMap, m_xFrame); xWindow = xButton; } @@ -1387,7 +1387,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & if (!sWrap.isEmpty()) nBits |= WB_WORDBREAK; VclPtr<RadioButton> xButton = VclPtr<RadioButton>::Create(pParent, nBits); - xButton->SetImageAlign(IMAGEALIGN_LEFT); //default to left + xButton->SetImageAlign(ImageAlign::Left); //default to left xWindow = xButton; } else if (name == "GtkCheckButton") @@ -1405,7 +1405,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & xCheckBox = VclPtr<CheckBox>::Create(pParent, nBits); if (bIsTriState) xCheckBox->SetState(TRISTATE_INDET); - xCheckBox->SetImageAlign(IMAGEALIGN_LEFT); //default to left + xCheckBox->SetImageAlign(ImageAlign::Left); //default to left xWindow = xCheckBox; } else if (name == "GtkSpinButton") |