diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-14 09:36:33 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-15 10:13:04 +0000 |
commit | d9fa1247be9d3a3d559adbbf9e1ed12395744738 (patch) | |
tree | 20fb4e43af4c94760b290d62ad3a6ac581665bf1 | |
parent | d7a0916e68238d619d74cbab72e66980e24d2f48 (diff) |
fdo#84938: replace SYMBOL_TYPE constants with enum
Change-Id: Ib3763f20d74c22e28d519a9ac47f6f3ab4e31f51
Reviewed-on: https://gerrit.libreoffice.org/11983
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
25 files changed, 188 insertions, 184 deletions
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index c7f51d7c896d..126f24bf011e 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -1039,7 +1039,7 @@ namespace pcr if ( _nStyle & WB_DROPDOWN ) { m_pDropdownButton = new PushButton( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP); - m_pDropdownButton->SetSymbol(SYMBOL_SPIN_DOWN); + m_pDropdownButton->SetSymbol(SymbolType::SPIN_DOWN); m_pDropdownButton->SetClickHdl( LINK( this, DropDownEditControl, DropDownHdl ) ); m_pDropdownButton->Show(); } diff --git a/include/rsc/rsc-vcl-shared-types.hxx b/include/rsc/rsc-vcl-shared-types.hxx index f8090b3b1754..051cd71303f1 100644 --- a/include/rsc/rsc-vcl-shared-types.hxx +++ b/include/rsc/rsc-vcl-shared-types.hxx @@ -68,47 +68,47 @@ enum ToolBoxItemType { TOOLBOXITEM_DONTKNOW, TOOLBOXITEM_BUTTON, enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT }; -typedef sal_uInt16 SymbolType; - -#define SYMBOL_DONTKNOW ((SymbolType)0) -#define SYMBOL_IMAGE ((SymbolType)1) -#define SYMBOL_ARROW_UP ((SymbolType)2) -#define SYMBOL_ARROW_DOWN ((SymbolType)3) -#define SYMBOL_ARROW_LEFT ((SymbolType)4) -#define SYMBOL_ARROW_RIGHT ((SymbolType)5) -#define SYMBOL_SPIN_UP ((SymbolType)6) -#define SYMBOL_SPIN_DOWN ((SymbolType)7) -#define SYMBOL_SPIN_LEFT ((SymbolType)8) -#define SYMBOL_SPIN_RIGHT ((SymbolType)9) -#define SYMBOL_FIRST ((SymbolType)10) -#define SYMBOL_LAST ((SymbolType)11) -#define SYMBOL_PREV ((SymbolType)12) -#define SYMBOL_NEXT ((SymbolType)13) -#define SYMBOL_PAGEUP ((SymbolType)14) -#define SYMBOL_PAGEDOWN ((SymbolType)15) -#define SYMBOL_PLAY ((SymbolType)16) -#define SYMBOL_REVERSEPLAY ((SymbolType)17) -#define SYMBOL_RECORD ((SymbolType)18) -#define SYMBOL_STOP ((SymbolType)19) -#define SYMBOL_PAUSE ((SymbolType)20) -#define SYMBOL_WINDSTART ((SymbolType)21) -#define SYMBOL_WINDEND ((SymbolType)22) -#define SYMBOL_WINDBACKWARD ((SymbolType)23) -#define SYMBOL_WINDFORWARD ((SymbolType)24) -#define SYMBOL_CLOSE ((SymbolType)25) -#define SYMBOL_ROLLUP ((SymbolType)26) -#define SYMBOL_ROLLDOWN ((SymbolType)27) -#define SYMBOL_CHECKMARK ((SymbolType)28) -#define SYMBOL_RADIOCHECKMARK ((SymbolType)29) -#define SYMBOL_SPIN_UPDOWN ((SymbolType)30) -#define SYMBOL_FLOAT ((SymbolType)31) -#define SYMBOL_DOCK ((SymbolType)32) -#define SYMBOL_HIDE ((SymbolType)33) -#define SYMBOL_HELP ((SymbolType)34) -#define SYMBOL_PLUS ((SymbolType)35) -#define SYMBOL_MENU SYMBOL_SPIN_DOWN - -#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW) +enum class SymbolType : sal_uInt16 +{ + DONTKNOW = 0, + IMAGE = 1, + ARROW_UP = 2, + ARROW_DOWN = 3, + ARROW_LEFT = 4, + ARROW_RIGHT = 5, + SPIN_UP = 6, + SPIN_DOWN = 7, + SPIN_LEFT = 8, + SPIN_RIGHT = 9, + FIRST = 10, + LAST = 11, + PREV = 12, + NEXT = 13, + PAGEUP = 14, + PAGEDOWN = 15, + PLAY = 16, + REVERSEPLAY = 17, + RECORD = 18, + STOP = 19, + PAUSE = 20, + WINDSTART = 21, + WINDEND = 22, + WINDBACKWARD = 23, + WINDFORWARD = 24, + CLOSE = 25, + ROLLUP = 26, + ROLLDOWN = 27, + CHECKMARK = 28, + RADIOCHECKMARK = 29, + SPIN_UPDOWN = 30, + FLOAT = 31, + DOCK = 32, + HIDE = 33, + HELP = 34, + PLUS = 35, + MENU = SymbolType::SPIN_DOWN +}; + // Border-Styles fuer SetBorder() typedef sal_uInt16 WindowBorderStyle; diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index 614312e805a9..6c9384cdd5c5 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -126,7 +126,7 @@ protected: SAL_DLLPRIVATE void ImplDrawPushButton( bool bLayout = false ); using Button::ImplGetTextStyle; SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const; - SAL_DLLPRIVATE bool IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); } + SAL_DLLPRIVATE bool IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); } SAL_DLLPRIVATE bool IsImage() const { return Button::HasImage(); } // Copy assignment is forbidden and not implemented. diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 74e46e425eb7..c4bc2fe4ffc4 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -28,6 +28,7 @@ #include <rscstr.hxx> #include <rscarray.hxx> #include <rscdef.hxx> +#include <rsc/rsc-vcl-shared-types.hxx> #include <vector> #include <map> @@ -138,6 +139,7 @@ class RscTypCont void Init(); // Initialisiert Klassen und Tabelle void SETCONST( RscConst *, const char *, sal_uInt32 ); + inline void SETCONST( RscConst *p1, const char * p2, SymbolType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); } void SETCONST( RscConst *, Atom, sal_uInt32 ); RscEnum * InitLangType(); RscEnum * InitFieldUnitsType(); diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index 62561de065e4..a9034bcb255b 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -442,30 +442,30 @@ RscTop * RscTypCont::InitClassImageButton( RscTop * pSuper, aBaseLst.push_back( pSymbol = new RscEnum( pHS->getID( "EnumSymbolButton" ), RSC_NOTYPE ) ); - SETCONST( pSymbol, "IMAGEBUTTON_DONTKNOW", SYMBOL_DONTKNOW ); - SETCONST( pSymbol, "IMAGEBUTTON_IMAGE", SYMBOL_IMAGE ); - SETCONST( pSymbol, "IMAGEBUTTON_ARROW_UP", SYMBOL_ARROW_UP ); - SETCONST( pSymbol, "IMAGEBUTTON_ARROW_DOWN", SYMBOL_ARROW_DOWN ); - SETCONST( pSymbol, "IMAGEBUTTON_ARROW_LEFT", SYMBOL_ARROW_LEFT ); - SETCONST( pSymbol, "IMAGEBUTTON_ARROW_RIGHT", SYMBOL_ARROW_RIGHT ); - SETCONST( pSymbol, "IMAGEBUTTON_SPIN_UP", SYMBOL_SPIN_UP ); - SETCONST( pSymbol, "IMAGEBUTTON_SPIN_DOWN", SYMBOL_SPIN_DOWN ); - SETCONST( pSymbol, "IMAGEBUTTON_SPIN_LEFT", SYMBOL_SPIN_LEFT ); - SETCONST( pSymbol, "IMAGEBUTTON_SPIN_RIGHT", SYMBOL_SPIN_RIGHT ); - SETCONST( pSymbol, "IMAGEBUTTON_FIRST", SYMBOL_FIRST ); - SETCONST( pSymbol, "IMAGEBUTTON_LAST", SYMBOL_LAST ); - SETCONST( pSymbol, "IMAGEBUTTON_PREV", SYMBOL_PREV ); - SETCONST( pSymbol, "IMAGEBUTTON_NEXT", SYMBOL_NEXT ); - SETCONST( pSymbol, "IMAGEBUTTON_PAGEUP", SYMBOL_PAGEUP ); - SETCONST( pSymbol, "IMAGEBUTTON_PAGEDOWN", SYMBOL_PAGEDOWN ); - SETCONST( pSymbol, "IMAGEBUTTON_PLAY", SYMBOL_PLAY ); - SETCONST( pSymbol, "IMAGEBUTTON_REVERSEPLAY", SYMBOL_REVERSEPLAY ); - SETCONST( pSymbol, "IMAGEBUTTON_STOP", SYMBOL_STOP ); - SETCONST( pSymbol, "IMAGEBUTTON_PAUSE", SYMBOL_PAUSE ); - SETCONST( pSymbol, "IMAGEBUTTON_WINDSTART", SYMBOL_WINDSTART ); - SETCONST( pSymbol, "IMAGEBUTTON_WINDEND", SYMBOL_WINDEND ); - SETCONST( pSymbol, "IMAGEBUTTON_WINDBACKWARD", SYMBOL_WINDBACKWARD ); - SETCONST( pSymbol, "IMAGEBUTTON_WINDFORWARD", SYMBOL_WINDFORWARD ); + SETCONST( pSymbol, "IMAGEBUTTON_DONTKNOW", SymbolType::DONTKNOW ); + SETCONST( pSymbol, "IMAGEBUTTON_IMAGE", SymbolType::IMAGE ); + SETCONST( pSymbol, "IMAGEBUTTON_ARROW_UP", SymbolType::ARROW_UP ); + SETCONST( pSymbol, "IMAGEBUTTON_ARROW_DOWN", SymbolType::ARROW_DOWN ); + SETCONST( pSymbol, "IMAGEBUTTON_ARROW_LEFT", SymbolType::ARROW_LEFT ); + SETCONST( pSymbol, "IMAGEBUTTON_ARROW_RIGHT", SymbolType::ARROW_RIGHT ); + SETCONST( pSymbol, "IMAGEBUTTON_SPIN_UP", SymbolType::SPIN_UP ); + SETCONST( pSymbol, "IMAGEBUTTON_SPIN_DOWN", SymbolType::SPIN_DOWN ); + SETCONST( pSymbol, "IMAGEBUTTON_SPIN_LEFT", SymbolType::SPIN_LEFT ); + SETCONST( pSymbol, "IMAGEBUTTON_SPIN_RIGHT", SymbolType::SPIN_RIGHT ); + SETCONST( pSymbol, "IMAGEBUTTON_FIRST", SymbolType::FIRST ); + SETCONST( pSymbol, "IMAGEBUTTON_LAST", SymbolType::LAST ); + SETCONST( pSymbol, "IMAGEBUTTON_PREV", SymbolType::PREV ); + SETCONST( pSymbol, "IMAGEBUTTON_NEXT", SymbolType::NEXT ); + SETCONST( pSymbol, "IMAGEBUTTON_PAGEUP", SymbolType::PAGEUP ); + SETCONST( pSymbol, "IMAGEBUTTON_PAGEDOWN", SymbolType::PAGEDOWN ); + SETCONST( pSymbol, "IMAGEBUTTON_PLAY", SymbolType::PLAY ); + SETCONST( pSymbol, "IMAGEBUTTON_REVERSEPLAY", SymbolType::REVERSEPLAY ); + SETCONST( pSymbol, "IMAGEBUTTON_STOP", SymbolType::STOP ); + SETCONST( pSymbol, "IMAGEBUTTON_PAUSE", SymbolType::PAUSE ); + SETCONST( pSymbol, "IMAGEBUTTON_WINDSTART", SymbolType::WINDSTART ); + SETCONST( pSymbol, "IMAGEBUTTON_WINDEND", SymbolType::WINDEND ); + SETCONST( pSymbol, "IMAGEBUTTON_WINDBACKWARD", SymbolType::WINDBACKWARD ); + SETCONST( pSymbol, "IMAGEBUTTON_WINDFORWARD", SymbolType::WINDFORWARD ); // Variable einfuegen nVarId = aNmTb.Put( "Symbol", VARNAME ); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index eea595e428d7..14f819603ce8 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -911,7 +911,7 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh) aButton.SetClickHdl( LINK( this, ScInputBarGroup, ClickHdl ) ); aButton.SetSizePixel( aSize ); aButton.Enable(); - aButton.SetSymbol( SYMBOL_SPIN_DOWN ); + aButton.SetSymbol( SymbolType::SPIN_DOWN ); aButton.SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) ); aButton.Show(); @@ -979,7 +979,7 @@ void ScInputBarGroup::Resize() if( aMultiTextWnd.GetNumLines() > 1 ) { - aButton.SetSymbol( SYMBOL_SPIN_UP ); + aButton.SetSymbol( SymbolType::SPIN_UP ); aButton.SetQuickHelpText( ScResId( SCSTR_QHELP_COLLAPSE_FORMULA ) ); Size scrollSize = aButton.GetSizePixel(); scrollSize.Height() = aMultiTextWnd.GetSizePixel().Height() - aButton.GetSizePixel().Height(); @@ -997,7 +997,7 @@ void ScInputBarGroup::Resize() } else { - aButton.SetSymbol( SYMBOL_SPIN_DOWN ); + aButton.SetSymbol( SymbolType::SPIN_DOWN ); aButton.SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) ); aScrollBar.Hide(); } diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 9b807c490d10..9fbcd2c65e52 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -364,7 +364,7 @@ void ScMenuFloatingWindow::drawMenuItem(size_t nPos) aMarkerPos.X() += aSize.Width() - nFontHeight + nFontHeight/4; Size aMarkerSize(nFontHeight/2, nFontHeight/2); aDecoView.DrawSymbol(Rectangle(aMarkerPos, aMarkerSize), - SYMBOL_SPIN_RIGHT, GetTextColor(), 0); + SymbolType::SPIN_RIGHT, GetTextColor(), 0); } } diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index e307af2ad14b..31335697a01f 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -339,7 +339,7 @@ DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, Popup mpSubControl(pSubControl),mpDropdownButton(0),mpMenu(pMenu) { mpDropdownButton = new MenuButton( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP); - mpDropdownButton->SetSymbol(SYMBOL_SPIN_DOWN); + mpDropdownButton->SetSymbol(SymbolType::SPIN_DOWN); mpDropdownButton->Show(); mpDropdownButton->SetPopupMenu( pMenu ); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index dc4b1997a1c2..2e8fa764f6b8 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -717,7 +717,7 @@ void TabBar::ImplInitControls() mpPrevBtn = new ImplTabButton( this, WB_REPEAT ); mpPrevBtn->SetClickHdl( aLink ); } - mpPrevBtn->SetSymbol( mbMirrored ? SYMBOL_NEXT : SYMBOL_PREV ); + mpPrevBtn->SetSymbol( mbMirrored ? SymbolType::NEXT : SymbolType::PREV ); mpPrevBtn->Show(); if ( !mpNextBtn ) @@ -725,7 +725,7 @@ void TabBar::ImplInitControls() mpNextBtn = new ImplTabButton( this, WB_REPEAT ); mpNextBtn->SetClickHdl( aLink ); } - mpNextBtn->SetSymbol( mbMirrored ? SYMBOL_PREV : SYMBOL_NEXT ); + mpNextBtn->SetSymbol( mbMirrored ? SymbolType::PREV : SymbolType::NEXT ); mpNextBtn->Show(); } else @@ -741,7 +741,7 @@ void TabBar::ImplInitControls() mpFirstBtn = new ImplTabButton( this ); mpFirstBtn->SetClickHdl( aLink ); } - mpFirstBtn->SetSymbol( mbMirrored ? SYMBOL_LAST : SYMBOL_FIRST ); + mpFirstBtn->SetSymbol( mbMirrored ? SymbolType::LAST : SymbolType::FIRST ); mpFirstBtn->Show(); if ( !mpLastBtn ) @@ -749,7 +749,7 @@ void TabBar::ImplInitControls() mpLastBtn = new ImplTabButton( this ); mpLastBtn->SetClickHdl( aLink ); } - mpLastBtn->SetSymbol( mbMirrored ? SYMBOL_FIRST : SYMBOL_LAST ); + mpLastBtn->SetSymbol( mbMirrored ? SymbolType::FIRST : SymbolType::LAST ); mpLastBtn->Show(); } else diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index f72eb40c3d8b..d59603a4a959 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -1435,12 +1435,12 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) Size aSymbolSize; if ( pEntry->mnBits & MIB_RADIOCHECK ) { - eSymbol = SYMBOL_RADIOCHECKMARK; + eSymbol = SymbolType::RADIOCHECKMARK; aSymbolSize = Size( nFontHeight/2, nFontHeight/2 ); } else { - eSymbol = SYMBOL_CHECKMARK; + eSymbol = SymbolType::CHECKMARK; aSymbolSize = Size( (nFontHeight*25)/40, nFontHeight/2 ); } aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - aSymbolSize.Width())/2; diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index e1eeec061d76..e350a2237c12 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -92,7 +92,7 @@ namespace svt { namespace table DecorationView aDecoView( &aDevice ); aDecoView.DrawSymbol( Rectangle( aBitmapPos, aBitmapSize ), - i_sortAscending ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN, + i_sortAscending ? SymbolType::SPIN_UP : SymbolType::SPIN_DOWN, i_style.GetActiveColor() ); diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 7570adf0ce4e..3dc375124bb6 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -527,13 +527,13 @@ namespace svt m_rPanelDeck.AddListener( *this ); - m_aScrollBack.SetSymbol( IsVertical() ? SYMBOL_ARROW_UP : SYMBOL_ARROW_LEFT ); + m_aScrollBack.SetSymbol( IsVertical() ? SymbolType::ARROW_UP : SymbolType::ARROW_LEFT ); m_aScrollBack.Show(); m_aScrollBack.SetClickHdl( LINK( this, PanelTabBar_Impl, OnScroll ) ); m_aScrollBack.SetAccessibleDescription( SvtResId( STR_SVT_TOOL_PANEL_BUTTON_FWD ).toString() ); m_aScrollBack.SetAccessibleName( m_aScrollBack.GetAccessibleDescription() ); - m_aScrollForward.SetSymbol( IsVertical() ? SYMBOL_ARROW_DOWN : SYMBOL_ARROW_RIGHT ); + m_aScrollForward.SetSymbol( IsVertical() ? SymbolType::ARROW_DOWN : SymbolType::ARROW_RIGHT ); m_aScrollForward.Show(); m_aScrollForward.SetClickHdl( LINK( this, PanelTabBar_Impl, OnScroll ) ); m_aScrollForward.SetAccessibleDescription( SvtResId( STR_SVT_TOOL_PANEL_BUTTON_BACK ).toString() ); diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index f651c6385f2d..141a490f7662 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -345,10 +345,10 @@ DbGridControl::NavigationBar::NavigationBar(vcl::Window* pParent, WinBits nStyle ,m_nCurrentPos(-1) ,m_bPositioning(false) { - m_aFirstBtn.SetSymbol(SYMBOL_FIRST); - m_aPrevBtn.SetSymbol(SYMBOL_PREV); - m_aNextBtn.SetSymbol(SYMBOL_NEXT); - m_aLastBtn.SetSymbol(SYMBOL_LAST); + m_aFirstBtn.SetSymbol(SymbolType::FIRST); + m_aPrevBtn.SetSymbol(SymbolType::PREV); + m_aNextBtn.SetSymbol(SymbolType::NEXT); + m_aLastBtn.SetSymbol(SymbolType::LAST); m_aNewBtn.SetModeImage(((DbGridControl*)pParent)->GetImage(DbGridControl_Base::NEW)); m_aFirstBtn.SetHelpId(HID_GRID_TRAVEL_FIRST); diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx index f34325a82518..fbbed6ba7b40 100644 --- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx +++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx @@ -178,7 +178,7 @@ void AnnotationMenuButton::Paint( const Rectangle& /*rRect*/ ) const long nBorderDistanceBottom = ((aSymbolRect.GetHeight()*150)+500)/1000; aSymbolRect.Bottom()-=nBorderDistanceBottom; DecorationView aDecoView( this ); - aDecoView.DrawSymbol( aSymbolRect, SYMBOL_SPIN_DOWN, + aDecoView.DrawSymbol( aSymbolRect, SymbolType::SPIN_DOWN, ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() ? Color( COL_WHITE ) : Color( COL_BLACK ) ) ); diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 03329959edcf..e39c00d8a795 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -638,7 +638,7 @@ void PushButton::ImplInitPushButtonData() { mpWindowImpl->mbPushButton = true; - meSymbol = SYMBOL_NOSYMBOL; + meSymbol = SymbolType::DONTKNOW; meState = TRISTATE_FALSE; meSaveValue = TRISTATE_FALSE; mnDDStyle = 0; @@ -899,7 +899,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF } ImplSetSeparatorX( nSeparatorX ); - aDecoView.DrawSymbol( aSymbolRect, SYMBOL_SPIN_DOWN, aColor, nStyle ); + aDecoView.DrawSymbol( aSymbolRect, SymbolType::SPIN_DOWN, aColor, nStyle ); } } @@ -986,7 +986,7 @@ void PushButton::ImplDrawPushButton( bool bLayout ) break; } - bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && GetText().isEmpty() ); + bool bDropDown = ( IsSymbol() && (GetSymbol()==SymbolType::SPIN_DOWN) && GetText().isEmpty() ); if( bDropDown && (aCtrlType == CTRL_COMBOBOX || aCtrlType == CTRL_LISTBOX ) ) { @@ -1526,7 +1526,7 @@ bool PushButton::PreNotify( NotifyEvent& rNEvt ) break; } - bool bDropDown = ( IsSymbol() && (GetSymbol()==SYMBOL_SPIN_DOWN) && GetText().isEmpty() ); + bool bDropDown = ( IsSymbol() && (GetSymbol()==SymbolType::SPIN_DOWN) && GetText().isEmpty() ); if( bDropDown && GetParent()->IsNativeControlSupported( aCtrlType, PART_ENTIRE_CONTROL) && !GetParent()->IsNativeControlSupported( aCtrlType, PART_BUTTON_DOWN) ) diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 693070fe6261..8a987f44338f 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -78,9 +78,9 @@ void ImplInitFieldSettings( vcl::Window* pWin, bool bFont, bool bForeground, boo void ImplInitDropDownButton( PushButton* pButton ) { if ( pButton->GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_SPINUPDOWN ) - pButton->SetSymbol( SYMBOL_SPIN_UPDOWN ); + pButton->SetSymbol( SymbolType::SPIN_UPDOWN ); else - pButton->SetSymbol( SYMBOL_SPIN_DOWN ); + pButton->SetSymbol( SymbolType::SPIN_DOWN ); if ( pButton->IsNativeControlSupported(CTRL_LISTBOX, PART_ENTIRE_CONTROL) && ! pButton->IsNativeControlSupported(CTRL_LISTBOX, PART_BUTTON_DOWN) ) diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index f84e0a891287..0b585a1587a8 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -62,12 +62,12 @@ void MoreButton::ShowState() { if ( mbState ) { - SetSymbol( SYMBOL_PAGEUP ); + SetSymbol( SymbolType::PAGEUP ); SetText( mpMBData->maLessText ); } else { - SetSymbol( SYMBOL_PAGEDOWN ); + SetSymbol( SymbolType::PAGEDOWN ); SetText( mpMBData->maMoreText ); } } diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index df763dd5ad4f..1af0b65f4c8e 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -646,16 +646,16 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev ) if ( rStyleSettings.GetOptions() & STYLE_OPTION_SCROLLARROW ) { if ( GetStyle() & WB_HORZ ) - eSymbolType = SYMBOL_ARROW_LEFT; + eSymbolType = SymbolType::ARROW_LEFT; else - eSymbolType = SYMBOL_ARROW_UP; + eSymbolType = SymbolType::ARROW_UP; } else { if ( GetStyle() & WB_HORZ ) - eSymbolType = SYMBOL_SPIN_LEFT; + eSymbolType = SymbolType::SPIN_LEFT; else - eSymbolType = SYMBOL_SPIN_UP; + eSymbolType = SymbolType::SPIN_UP; } aDecoView.DrawSymbol( aTempRect, eSymbolType, rStyleSettings.GetButtonTextColor(), nStyle ); } @@ -673,16 +673,16 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev ) if ( rStyleSettings.GetOptions() & STYLE_OPTION_SCROLLARROW ) { if ( GetStyle() & WB_HORZ ) - eSymbolType = SYMBOL_ARROW_RIGHT; + eSymbolType = SymbolType::ARROW_RIGHT; else - eSymbolType = SYMBOL_ARROW_DOWN; + eSymbolType = SymbolType::ARROW_DOWN; } else { if ( GetStyle() & WB_HORZ ) - eSymbolType = SYMBOL_SPIN_RIGHT; + eSymbolType = SymbolType::SPIN_RIGHT; else - eSymbolType = SYMBOL_SPIN_DOWN; + eSymbolType = SymbolType::SPIN_DOWN; } aDecoView.DrawSymbol( aTempRect, eSymbolType, rStyleSettings.GetButtonTextColor(), nStyle ); } diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index c1a81b2e73d6..8bbdbb9e14d7 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -156,26 +156,26 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, // arrows are only use in OS/2 look if ( bHorz ) { - eType1 = bMirrorHorz ? SYMBOL_ARROW_RIGHT : SYMBOL_ARROW_LEFT; - eType2 = bMirrorHorz ? SYMBOL_ARROW_LEFT : SYMBOL_ARROW_RIGHT; + eType1 = bMirrorHorz ? SymbolType::ARROW_RIGHT : SymbolType::ARROW_LEFT; + eType2 = bMirrorHorz ? SymbolType::ARROW_LEFT : SymbolType::ARROW_RIGHT; } else { - eType1 = SYMBOL_ARROW_UP; - eType2 = SYMBOL_ARROW_DOWN; + eType1 = SymbolType::ARROW_UP; + eType2 = SymbolType::ARROW_DOWN; } } else { if ( bHorz ) { - eType1 = bMirrorHorz ? SYMBOL_SPIN_RIGHT : SYMBOL_SPIN_LEFT; - eType2 = bMirrorHorz ? SYMBOL_SPIN_LEFT : SYMBOL_SPIN_RIGHT; + eType1 = bMirrorHorz ? SymbolType::SPIN_RIGHT : SymbolType::SPIN_LEFT; + eType2 = bMirrorHorz ? SymbolType::SPIN_LEFT : SymbolType::SPIN_RIGHT; } else { - eType1 = SYMBOL_SPIN_UP; - eType2 = SYMBOL_SPIN_DOWN; + eType1 = SymbolType::SPIN_UP; + eType2 = SymbolType::SPIN_DOWN; } } @@ -615,9 +615,9 @@ void SpinField::Paint( const Rectangle& rRect ) nStyle |= BUTTON_DRAW_PRESSED; Rectangle aInnerRect = aView.DrawButton( maDropDownRect, nStyle ); - SymbolType eSymbol = SYMBOL_SPIN_DOWN; + SymbolType eSymbol = SymbolType::SPIN_DOWN; if ( GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_SPINUPDOWN ) - eSymbol = SYMBOL_SPIN_UPDOWN; + eSymbol = SymbolType::SPIN_UPDOWN; nStyle = IsEnabled() ? 0 : SYMBOL_DRAW_DISABLE; aView.DrawSymbol( aInnerRect, eSymbol, GetSettings().GetStyleSettings().GetButtonTextColor(), nStyle ); @@ -1023,9 +1023,9 @@ void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DecorationView aView( pDev ); sal_uInt16 nStyle = BUTTON_DRAW_NOLIGHTBORDER; Rectangle aInnerRect = aView.DrawButton( aDD, nStyle ); - SymbolType eSymbol = SYMBOL_SPIN_DOWN; + SymbolType eSymbol = SymbolType::SPIN_DOWN; if ( GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_SPINUPDOWN ) - eSymbol = SYMBOL_SPIN_UPDOWN; + eSymbol = SymbolType::SPIN_UPDOWN; nStyle = ( IsEnabled() || ( nFlags & WINDOW_DRAW_NODISABLE ) ) ? 0 : SYMBOL_DRAW_DISABLE; aView.DrawSymbol( aInnerRect, eSymbol, aButtonTextColor, nStyle ); diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index d008582da02d..579c2ee44045 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1674,7 +1674,7 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p Rectangle aSymbolRect( pData->maCloseRect ); if ( pOffset ) aSymbolRect.Move( pOffset->X(), pOffset->Y() ); - ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SYMBOL_CLOSE, pData->mnCloseState ); + ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SymbolType::CLOSE, pData->mnCloseState ); } if ( ((nDrawFlags & BORDERWINDOW_DRAW_DOCK) || (nDrawFlags & BORDERWINDOW_DRAW_TITLE)) && !pData->maDockRect.IsEmpty() ) @@ -1682,7 +1682,7 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p Rectangle aSymbolRect( pData->maDockRect ); if ( pOffset ) aSymbolRect.Move( pOffset->X(), pOffset->Y() ); - ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SYMBOL_DOCK, pData->mnDockState ); + ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SymbolType::DOCK, pData->mnDockState ); } if ( ((nDrawFlags & BORDERWINDOW_DRAW_MENU) || (nDrawFlags & BORDERWINDOW_DRAW_TITLE)) && !pData->maMenuRect.IsEmpty() ) @@ -1690,7 +1690,7 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p Rectangle aSymbolRect( pData->maMenuRect ); if ( pOffset ) aSymbolRect.Move( pOffset->X(), pOffset->Y() ); - ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SYMBOL_MENU, pData->mnMenuState ); + ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SymbolType::MENU, pData->mnMenuState ); } if ( ((nDrawFlags & BORDERWINDOW_DRAW_HIDE) || (nDrawFlags & BORDERWINDOW_DRAW_TITLE)) && !pData->maHideRect.IsEmpty() ) @@ -1698,16 +1698,16 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p Rectangle aSymbolRect( pData->maHideRect ); if ( pOffset ) aSymbolRect.Move( pOffset->X(), pOffset->Y() ); - ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SYMBOL_HIDE, pData->mnHideState ); + ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SymbolType::HIDE, pData->mnHideState ); } if ( ((nDrawFlags & BORDERWINDOW_DRAW_ROLL) || (nDrawFlags & BORDERWINDOW_DRAW_TITLE)) && !pData->maRollRect.IsEmpty() ) { SymbolType eType; if ( pBorderWindow->mbRollUp ) - eType = SYMBOL_ROLLDOWN; + eType = SymbolType::ROLLDOWN; else - eType = SYMBOL_ROLLUP; + eType = SymbolType::ROLLUP; Rectangle aSymbolRect( pData->maRollRect ); if ( pOffset ) aSymbolRect.Move( pOffset->X(), pOffset->Y() ); @@ -1720,7 +1720,7 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p Rectangle aSymbolRect( pData->maHelpRect ); if ( pOffset ) aSymbolRect.Move( pOffset->X(), pOffset->Y() ); - ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SYMBOL_HELP, pData->mnHelpState ); + ImplDrawBrdWinSymbolButton( pDev, aSymbolRect, SymbolType::HELP, pData->mnHelpState ); } if ( ((nDrawFlags & BORDERWINDOW_DRAW_PIN) || (nDrawFlags & BORDERWINDOW_DRAW_TITLE)) && !pData->maPinRect.IsEmpty() ) diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index f7ab58f08388..faffeccbb764 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -66,33 +66,33 @@ namespace SymbolType mapStockToSymbol(const OString& sType) { - SymbolType eRet = SYMBOL_NOSYMBOL; + SymbolType eRet = SymbolType::DONTKNOW; if (sType == "gtk-media-next") - eRet = SYMBOL_NEXT; + eRet = SymbolType::NEXT; else if (sType == "gtk-media-previous") - eRet = SYMBOL_PREV; + eRet = SymbolType::PREV; else if (sType == "gtk-media-play") - eRet = SYMBOL_PLAY; + eRet = SymbolType::PLAY; else if (sType == "gtk-goto-first") - eRet = SYMBOL_FIRST; + eRet = SymbolType::FIRST; else if (sType == "gtk-goto-last") - eRet = SYMBOL_LAST; + eRet = SymbolType::LAST; else if (sType == "gtk-go-back") - eRet = SYMBOL_ARROW_LEFT; + eRet = SymbolType::ARROW_LEFT; else if (sType == "gtk-go-forward") - eRet = SYMBOL_ARROW_RIGHT; + eRet = SymbolType::ARROW_RIGHT; else if (sType == "gtk-go-up") - eRet = SYMBOL_ARROW_UP; + eRet = SymbolType::ARROW_UP; else if (sType == "gtk-go-down") - eRet = SYMBOL_ARROW_DOWN; + eRet = SymbolType::ARROW_DOWN; else if (sType == "gtk-missing-image") - eRet = SYMBOL_IMAGE; + eRet = SymbolType::IMAGE; else if (sType == "gtk-help") - eRet = SYMBOL_HELP; + eRet = SymbolType::HELP; else if (sType == "gtk-close") - eRet = SYMBOL_CLOSE; + eRet = SymbolType::CLOSE; else if (mapStockToImageResource(sType)) - eRet = SYMBOL_IMAGE; + eRet = SymbolType::IMAGE; return eRet; } } @@ -389,8 +389,8 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr { const stockinfo &rImageInfo = aFind->second; SymbolType eType = mapStockToSymbol(rImageInfo.m_sStock); - SAL_WARN_IF(eType == SYMBOL_NOSYMBOL, "vcl", "missing stock image element for button"); - if (eType == SYMBOL_NOSYMBOL) + SAL_WARN_IF(eType == SymbolType::DONTKNOW, "vcl", "missing stock image element for button"); + if (eType == SymbolType::DONTKNOW) continue; if (!aI->m_bRadio) { @@ -399,12 +399,12 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr //but images the right size. Really the PushButton::CalcMinimumSize //and PushButton::ImplDrawPushButton are the better place to handle //this, but its such a train-wreck - if (eType != SYMBOL_IMAGE) + if (eType != SymbolType::IMAGE) pTargetButton->SetStyle(pTargetButton->GetStyle() | WB_SMALLSTYLE); } else - SAL_WARN_IF(eType != SYMBOL_IMAGE, "vcl.layout", "inimplemented symbol type for radiobuttons"); - if (eType == SYMBOL_IMAGE) + SAL_WARN_IF(eType != SymbolType::IMAGE, "vcl.layout", "inimplemented symbol type for radiobuttons"); + if (eType == SymbolType::IMAGE) { Bitmap aBitmap(VclResId(mapStockToImageResource(rImageInfo.m_sStock))); Image const aImage(aBitmap); diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 083f13c19692..13b94d2f51cb 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -70,7 +70,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType switch ( eType ) { - case SYMBOL_ARROW_UP: + case SymbolType::ARROW_UP: pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) ); for ( long i=1; i <= n2; ++i ) { @@ -82,7 +82,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType aCenter.X()+n8, nRect.Bottom() ) ); break; - case SYMBOL_ARROW_DOWN: + case SymbolType::ARROW_DOWN: pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) ); for ( long i=1; i <= n2; ++i ) { @@ -94,7 +94,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType aCenter.X()+n8, nRect.Bottom()-1 ) ); break; - case SYMBOL_ARROW_LEFT: + case SymbolType::ARROW_LEFT: pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) ); for ( long i=1; i <= n2; ++i ) { @@ -106,7 +106,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType nRect.Right(), aCenter.Y()+n8 ) ); break; - case SYMBOL_ARROW_RIGHT: + case SymbolType::ARROW_RIGHT: pDev->DrawPixel( Point( nRect.Right(), aCenter.Y() ) ); for ( long i=1; i <= n2; ++i ) { @@ -118,7 +118,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType nRect.Right()-1, aCenter.Y()+n8 ) ); break; - case SYMBOL_SPIN_UP: + case SymbolType::SPIN_UP: nRect.Top() += n4; pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) ); for ( long i=1; i <= n2; ++i ) @@ -129,7 +129,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_SPIN_DOWN: + case SymbolType::SPIN_DOWN: nRect.Bottom() -= n4; pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) ); for ( long i=1; i <= n2; ++i ) @@ -140,12 +140,12 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_SPIN_LEFT: - case SYMBOL_FIRST: - case SYMBOL_PREV: - case SYMBOL_REVERSEPLAY: + case SymbolType::SPIN_LEFT: + case SymbolType::FIRST: + case SymbolType::PREV: + case SymbolType::REVERSEPLAY: nRect.Left() += n4; - if ( eType==SYMBOL_FIRST ) + if ( eType==SymbolType::FIRST ) { pDev->DrawLine( Point( nRect.Left(), nRect.Top() ), Point( nRect.Left(), nRect.Bottom() ) ); @@ -160,12 +160,12 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_SPIN_RIGHT: - case SYMBOL_LAST: - case SYMBOL_NEXT: - case SYMBOL_PLAY: + case SymbolType::SPIN_RIGHT: + case SymbolType::LAST: + case SymbolType::NEXT: + case SymbolType::PLAY: nRect.Right() -= n4; - if ( eType==SYMBOL_LAST ) + if ( eType==SymbolType::LAST ) { pDev->DrawLine( Point( nRect.Right(), nRect.Top() ), Point( nRect.Right(), nRect.Bottom() ) ); @@ -180,7 +180,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_PAGEUP: + case SymbolType::PAGEUP: pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) ); pDev->DrawPixel( Point( aCenter.X(), nRect.Top()+n2 ) ); for ( long i=1; i < n2; ++i ) @@ -193,7 +193,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_PAGEDOWN: + case SymbolType::PAGEDOWN: pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) ); pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom()-n2 ) ); for ( long i=1; i < n2; ++i ) @@ -206,8 +206,8 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_RADIOCHECKMARK: - case SYMBOL_RECORD: + case SymbolType::RADIOCHECKMARK: + case SymbolType::RECORD: { // Midpoint circle algorithm long x = 0; @@ -239,23 +239,23 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_STOP: + case SymbolType::STOP: pDev->DrawRect( nRect ); break; - case SYMBOL_PAUSE: + case SymbolType::PAUSE: pDev->DrawRect( Rectangle ( nRect.Left(), nRect.Top(), aCenter.X()-n8, nRect.Bottom() ) ); pDev->DrawRect( Rectangle ( aCenter.X()+n8, nRect.Top(), nRect.Right(), nRect.Bottom() ) ); break; - case SYMBOL_WINDSTART: + case SymbolType::WINDSTART: pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-n2+1 ), Point( nRect.Left(), aCenter.Y()+n2-1 ) ); ++nRect.Left(); // Intentional fall-through - case SYMBOL_WINDBACKWARD: + case SymbolType::WINDBACKWARD: pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) ); pDev->DrawPixel( Point( nRect.Left()+n2, aCenter.Y() ) ); for ( long i=1; i < n2; ++i ) @@ -268,12 +268,12 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_WINDEND: + case SymbolType::WINDEND: pDev->DrawLine( Point( nRect.Right(), aCenter.Y()-n2+1 ), Point( nRect.Right(), aCenter.Y()+n2-1 ) ); --nRect.Right(); // Intentional fall-through - case SYMBOL_WINDFORWARD: + case SymbolType::WINDFORWARD: pDev->DrawPixel( Point( nRect.Right(), aCenter.Y() ) ); pDev->DrawPixel( Point( nRect.Right()-n2, aCenter.Y() ) ); for ( long i=1; i < n2; ++i ) @@ -286,7 +286,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_CLOSE: + case SymbolType::CLOSE: pDev->DrawLine( Point( nRect.Left(), nRect.Top() ), Point( nRect.Right(), nRect.Bottom() ) ); pDev->DrawLine( Point( nRect.Left(), nRect.Bottom() ), @@ -304,7 +304,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_ROLLDOWN: + case SymbolType::ROLLDOWN: pDev->DrawLine( Point( nRect.Left(), nRect.Top() ), Point( nRect.Left(), nRect.Bottom() ) ); pDev->DrawLine( Point( nRect.Right(), nRect.Top() ), @@ -312,12 +312,12 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType pDev->DrawLine( Point( nRect.Left(), nRect.Bottom() ), Point( nRect.Right(), nRect.Bottom() ) ); // Intentional fall-through - case SYMBOL_ROLLUP: + case SymbolType::ROLLUP: pDev->DrawRect( Rectangle( nRect.Left(), nRect.Top(), nRect.Right(), nRect.Top()+n8 ) ); break; - case SYMBOL_CHECKMARK: + case SymbolType::CHECKMARK: { long n3 = nSide/3; nRect.Top() -= n3/2; @@ -354,7 +354,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_SPIN_UPDOWN: + case SymbolType::SPIN_UPDOWN: pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) ); pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) ); for ( long i=1; i < n2; ++i ) @@ -368,7 +368,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType } break; - case SYMBOL_FLOAT: + case SymbolType::FLOAT: nRect.Right() -= n4; nRect.Top() += n4+1; pDev->DrawRect( Rectangle( nRect.Left(), nRect.Top(), @@ -393,7 +393,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType Point( nRect.Right(), nRect.Bottom() ) ); break; - case SYMBOL_DOCK: + case SymbolType::DOCK: pDev->DrawLine( Point( nRect.Left(), nRect.Top() ), Point( nRect.Right(), nRect.Top() ) ); pDev->DrawLine( Point( nRect.Left(), nRect.Top() ), @@ -404,17 +404,20 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType Point( nRect.Right(), nRect.Bottom() ) ); break; - case SYMBOL_HIDE: + case SymbolType::HIDE: pDev->DrawRect( Rectangle( nRect.Left()+n8, nRect.Bottom()-n8, nRect.Right()-n8, nRect.Bottom() ) ); break; - case SYMBOL_PLUS: + case SymbolType::PLUS: pDev->DrawRect( Rectangle( nRect.Left(), aCenter.Y()-n8, nRect.Right(), aCenter.Y()+n8 ) ); pDev->DrawRect( Rectangle( aCenter.X()-n8, nRect.Top(), aCenter.X()+n8, nRect.Bottom() ) ); break; + case SymbolType::DONTKNOW: + case SymbolType::IMAGE: + case SymbolType::HELP: break; } } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index c925e994ab6e..4ed51747c3d7 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1905,12 +1905,12 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI Size aSymbolSize; if ( pData->nBits & MIB_RADIOCHECK ) { - eSymbol = SYMBOL_RADIOCHECKMARK; + eSymbol = SymbolType::RADIOCHECKMARK; aSymbolSize = Size( nFontHeight/2, nFontHeight/2 ); } else { - eSymbol = SYMBOL_CHECKMARK; + eSymbol = SymbolType::CHECKMARK; aSymbolSize = Size( (nFontHeight*25)/40, nFontHeight/2 ); } aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - aSymbolSize.Width())/2; @@ -2045,7 +2045,7 @@ void Menu::ImplPaint( vcl::Window* pWin, sal_uInt16 nBorder, long nStartY, MenuI } aDecoView.DrawSymbol( Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ), - SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle ); + SymbolType::SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle ); } } diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 9fd93c8e9b11..1f0bcee25caa 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -150,11 +150,11 @@ MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) : aCloseBtn.SetQuickHelpText(IID_DOCUMENTCLOSE, ResId(SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr).toString()); aFloatBtn.SetClickHdl( LINK( this, MenuBarWindow, FloatHdl ) ); - aFloatBtn.SetSymbol( SYMBOL_FLOAT ); + aFloatBtn.SetSymbol( SymbolType::FLOAT ); aFloatBtn.SetQuickHelpText( ResId(SV_HELPTEXT_RESTORE, *pResMgr).toString() ); aHideBtn.SetClickHdl( LINK( this, MenuBarWindow, HideHdl ) ); - aHideBtn.SetSymbol( SYMBOL_HIDE ); + aHideBtn.SetSymbol( SymbolType::HIDE ); aHideBtn.SetQuickHelpText( ResId(SV_HELPTEXT_MINIMIZE, *pResMgr).toString() ); } @@ -938,9 +938,8 @@ void MenuBarWindow::Resize() aHideBtn.setPosSizePixel( nX, nY, n, n ); } - aFloatBtn.SetSymbol( SYMBOL_FLOAT ); - aHideBtn.SetSymbol( SYMBOL_HIDE ); - //aCloseBtn.SetSymbol( SYMBOL_CLOSE ); //is a toolbox now + aFloatBtn.SetSymbol( SymbolType::FLOAT ); + aHideBtn.SetSymbol( SymbolType::HIDE ); Invalidate(); } diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 9ef3f91cdfc0..a61345af1e62 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -1124,7 +1124,7 @@ void MenuFloatingWindow::ImplDrawScroller( bool bUp ) Rectangle aRect( Point( nX, nY ), Size( aOutSz.Width()-nX, nScrollerHeight ) ); DecorationView aDecoView( this ); - SymbolType eSymbol = bUp ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN; + SymbolType eSymbol = bUp ? SymbolType::SPIN_UP : SymbolType::SPIN_DOWN; sal_uInt16 nStyle = 0; if ( ( bUp && !bScrollUp ) || ( !bUp && !bScrollDown ) ) |