summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-07 16:08:25 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-10-11 15:14:32 +0000
commitcb7ede2d9970a4d162dc71922f578922c0d6235a (patch)
tree141884aa4a9d7c2c3cfb6fdf850ddf71cad0e7a4 /svtools
parent0bc6ea3637e279fa2807d8ee649fb33f1ae6da47 (diff)
convert vcl StateChangedType to enum class
Change-Id: Ifa46523619ae7fb8d112525b8df594836e51bb8f Reviewed-on: https://gerrit.libreoffice.org/11843 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx2
-rw-r--r--svtools/source/brwbox/brwbox2.cxx14
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx2
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx12
-rw-r--r--svtools/source/contnr/fileview.cxx2
-rw-r--r--svtools/source/contnr/treelistbox.cxx4
-rw-r--r--svtools/source/control/calendar.cxx4
-rw-r--r--svtools/source/control/filectrl.cxx12
-rw-r--r--svtools/source/control/headbar.cxx10
-rw-r--r--svtools/source/control/ruler.cxx12
-rw-r--r--svtools/source/control/tabbar.cxx12
-rw-r--r--svtools/source/control/toolbarmenu.cxx2
-rw-r--r--svtools/source/control/valueset.cxx16
-rw-r--r--svtools/source/dialogs/wizdlg.cxx2
-rw-r--r--svtools/source/table/tablecontrol.cxx9
15 files changed, 58 insertions, 57 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index e69a4e0f8450..f7374bf91db1 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -2329,7 +2329,7 @@ void BrowseBox::SetMode( BrowserMode nMode )
if ( bBootstrapped )
{
- StateChanged( STATE_CHANGE_INITSHOW );
+ StateChanged( StateChangedType::INITSHOW );
if ( bMultiSelection && !pOldRowSel &&
nOldRowSel != BROWSER_ENDOFSELECTION )
uRow.pSel->Select( nOldRowSel );
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index d4c0e7d46f4e..d04a6182e912 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -131,7 +131,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
{
Control::StateChanged( nStateChange );
- if ( STATE_CHANGE_MIRRORING == nStateChange )
+ if ( StateChangedType::MIRRORING == nStateChange )
{
getDataWindow()->EnableRTL( IsRTLEnabled() );
@@ -143,7 +143,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
pVScroll->EnableRTL( IsRTLEnabled() );
Resize();
}
- else if ( STATE_CHANGE_INITSHOW == nStateChange )
+ else if ( StateChangedType::INITSHOW == nStateChange )
{
bBootstrapped = true; // must be set first!
@@ -165,7 +165,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
AutoSizeLastColumn();
CursorMoved();
}
- else if (STATE_CHANGE_ZOOM == nStateChange)
+ else if (StateChangedType::ZOOM == nStateChange)
{
pDataWin->SetZoom(GetZoom());
HeaderBar* pHeaderBar = getDataWindow()->pHeaderBar;
@@ -183,7 +183,7 @@ void BrowseBox::StateChanged( StateChangedType nStateChange )
// all our controls have to be repositioned
Resize();
}
- else if (STATE_CHANGE_ENABLE == nStateChange)
+ else if (StateChangedType::ENABLE == nStateChange)
{
// do we have a handle column?
bool bHandleCol = !pCols->empty() && (0 == (*pCols)[ 0 ]->GetId());
@@ -536,7 +536,7 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
void BrowseBox::Resize()
{
if ( !bBootstrapped && IsReallyVisible() )
- BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
+ BrowseBox::StateChanged( StateChangedType::INITSHOW );
if ( pCols->empty() )
{
getDataWindow()->bResizeOnPaint = true;
@@ -616,7 +616,7 @@ void BrowseBox::Paint( const Rectangle& rRect )
// initializations
if ( !bBootstrapped && IsReallyVisible() )
- BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
+ BrowseBox::StateChanged( StateChangedType::INITSHOW );
if ( pCols->empty() )
return;
@@ -1104,7 +1104,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, bool
void BrowseBox::PaintData( vcl::Window& rWin, const Rectangle& rRect )
{
if ( !bBootstrapped && IsReallyVisible() )
- BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
+ BrowseBox::StateChanged( StateChangedType::INITSHOW );
// initializations
if ( !pCols || pCols->empty() || !rWin.IsUpdateMode() )
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 86281790a647..2d12692c74a2 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -299,7 +299,7 @@ namespace svt
void CheckBoxControl::StateChanged( StateChangedType nStateChange )
{
Control::StateChanged(nStateChange);
- if ( nStateChange == STATE_CHANGE_ZOOM )
+ if ( nStateChange == StateChangedType::ZOOM )
pBox->SetZoom(GetZoom());
}
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index f9fe560da615..e009e82c885d 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -755,31 +755,31 @@ namespace svt
BrowseBox::StateChanged( nType );
bool bNeedCellReActivation = false;
- if ( nType == STATE_CHANGE_MIRRORING )
+ if ( nType == StateChangedType::MIRRORING )
{
bNeedCellReActivation = true;
}
- else if ( nType == STATE_CHANGE_ZOOM )
+ else if ( nType == StateChangedType::ZOOM )
{
ImplInitSettings( true, false, false );
bNeedCellReActivation = true;
}
- else if ( nType == STATE_CHANGE_CONTROLFONT )
+ else if ( nType == StateChangedType::CONTROLFONT )
{
ImplInitSettings( true, false, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ else if ( nType == StateChangedType::CONTROLFOREGROUND )
{
ImplInitSettings( false, true, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ else if ( nType == StateChangedType::CONTROLBACKGROUND )
{
ImplInitSettings( false, false, true );
Invalidate();
}
- else if (nType == STATE_CHANGE_STYLE)
+ else if (nType == StateChangedType::STYLE)
{
WinBits nStyle = GetStyle();
if (!(nStyle & WB_NOTABSTOP) )
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 1d2e63d33734..974ac7a20079 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1487,7 +1487,7 @@ void SvtFileView::SetConfigString( const OUString& rCfgStr )
void SvtFileView::StateChanged( StateChangedType nStateChange )
{
- if ( nStateChange == STATE_CHANGE_ENABLE )
+ if ( nStateChange == StateChangedType::ENABLE )
Invalidate();
Control::StateChanged( nStateChange );
}
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 35c47af64bb8..59c18fd615a6 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3784,12 +3784,12 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
void SvTreeListBox::StateChanged( StateChangedType eType )
{
- if( eType == STATE_CHANGE_ENABLE )
+ if( eType == StateChangedType::ENABLE )
Invalidate( INVALIDATE_CHILDREN );
Control::StateChanged( eType );
- if ( eType == STATE_CHANGE_STYLE )
+ if ( eType == StateChangedType::STYLE )
ImplInitStyle();
}
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index ff3a748a4475..348f9d741289 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -1759,7 +1759,7 @@ void Calendar::StateChanged( StateChangedType nType )
{
Control::StateChanged( nType );
- if ( nType == STATE_CHANGE_INITSHOW )
+ if ( nType == StateChangedType::INITSHOW )
ImplFormat();
}
@@ -2540,7 +2540,7 @@ void CalendarField::StateChanged( StateChangedType nStateChange )
{
DateField::StateChanged( nStateChange );
- if ( ( nStateChange == STATE_CHANGE_STYLE ) && GetSubEdit() )
+ if ( ( nStateChange == StateChangedType::STYLE ) && GetSubEdit() )
{
WinBits nAllAlignmentBits = ( WB_LEFT | WB_CENTER | WB_RIGHT | WB_TOP | WB_VCENTER | WB_BOTTOM );
WinBits nMyAlignment = GetStyle() & nAllAlignmentBits;
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index f6df0e4fac02..cf72f0f2080a 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -108,21 +108,21 @@ OUString FileControl::GetText() const
void FileControl::StateChanged( StateChangedType nType )
{
- if ( nType == STATE_CHANGE_ENABLE )
+ if ( nType == StateChangedType::ENABLE )
{
maEdit.Enable( IsEnabled() );
maButton.Enable( IsEnabled() );
}
- else if ( nType == STATE_CHANGE_ZOOM )
+ else if ( nType == StateChangedType::ZOOM )
{
GetEdit().SetZoom( GetZoom() );
GetButton().SetZoom( GetZoom() );
}
- else if ( nType == STATE_CHANGE_STYLE )
+ else if ( nType == StateChangedType::STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
}
- else if ( nType == STATE_CHANGE_CONTROLFONT )
+ else if ( nType == StateChangedType::CONTROLFONT )
{
GetEdit().SetControlFont( GetControlFont() );
// Only use height of the button, as in HTML
@@ -131,12 +131,12 @@ void FileControl::StateChanged( StateChangedType nType )
aFont.SetSize( GetControlFont().GetSize() );
GetButton().SetControlFont( aFont );
}
- else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ else if ( nType == StateChangedType::CONTROLFOREGROUND )
{
GetEdit().SetControlForeground( GetControlForeground() );
GetButton().SetControlForeground( GetControlForeground() );
}
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ else if ( nType == StateChangedType::CONTROLBACKGROUND )
{
GetEdit().SetControlBackground( GetControlBackground() );
GetButton().SetControlBackground( GetControlBackground() );
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index b5d56bac97b3..82a9bb02d94e 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -1166,20 +1166,20 @@ void HeaderBar::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
- if ( nType == STATE_CHANGE_ENABLE )
+ if ( nType == StateChangedType::ENABLE )
Invalidate();
- else if ( (nType == STATE_CHANGE_ZOOM) ||
- (nType == STATE_CHANGE_CONTROLFONT) )
+ else if ( (nType == StateChangedType::ZOOM) ||
+ (nType == StateChangedType::CONTROLFONT) )
{
ImplInitSettings( true, false, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ else if ( nType == StateChangedType::CONTROLFOREGROUND )
{
ImplInitSettings( false, true, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ else if ( nType == StateChangedType::CONTROLBACKGROUND )
{
ImplInitSettings( false, false, true );
Invalidate();
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index a74ce2d4fcae..f25a0e6a50d5 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -2199,25 +2199,25 @@ void Ruler::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
- if ( nType == STATE_CHANGE_INITSHOW )
+ if ( nType == StateChangedType::INITSHOW )
ImplFormat();
- else if ( nType == STATE_CHANGE_UPDATEMODE )
+ else if ( nType == StateChangedType::UPDATEMODE )
{
if ( IsReallyVisible() && IsUpdateMode() )
Paint(Rectangle());
}
- else if ( (nType == STATE_CHANGE_ZOOM) ||
- (nType == STATE_CHANGE_CONTROLFONT) )
+ else if ( (nType == StateChangedType::ZOOM) ||
+ (nType == StateChangedType::CONTROLFONT) )
{
ImplInitSettings( true, false, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ else if ( nType == StateChangedType::CONTROLFOREGROUND )
{
ImplInitSettings( false, true, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ else if ( nType == StateChangedType::CONTROLBACKGROUND )
{
ImplInitSettings( false, false, true );
Invalidate();
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 9c4fc546657c..20d570b0e7c1 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1558,25 +1558,25 @@ void TabBar::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
- if ( nType == STATE_CHANGE_INITSHOW )
+ if ( nType == StateChangedType::INITSHOW )
{
if ( (mbSizeFormat || mbFormat) && !mpItemList->empty() )
ImplFormat();
}
- else if ( (nType == STATE_CHANGE_ZOOM) ||
- (nType == STATE_CHANGE_CONTROLFONT) )
+ else if ( (nType == StateChangedType::ZOOM) ||
+ (nType == StateChangedType::CONTROLFONT) )
{
ImplInitSettings( true, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ else if ( nType == StateChangedType::CONTROLFOREGROUND )
Invalidate();
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ else if ( nType == StateChangedType::CONTROLBACKGROUND )
{
ImplInitSettings( false, true );
Invalidate();
}
- else if ( nType == STATE_CHANGE_MIRRORING )
+ else if ( nType == StateChangedType::MIRRORING )
{
// reacts on calls of EnableRTL, have to mirror all child controls
if( mpFirstBtn ) mpFirstBtn->EnableRTL( IsRTLEnabled() );
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index b28a9e4953e9..cb016846b3d5 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -1512,7 +1512,7 @@ void ToolbarMenu::StateChanged( StateChangedType nType )
{
DockingWindow::StateChanged( nType );
- if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) )
+ if ( ( nType == StateChangedType::CONTROLFOREGROUND ) || ( nType == StateChangedType::CONTROLBACKGROUND ) )
{
initWindow();
Invalidate();
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 9bdd65a34705..a0d84467386a 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1486,17 +1486,17 @@ void ValueSet::StateChanged( StateChangedType nType )
{
Control::StateChanged( nType );
- if ( nType == STATE_CHANGE_INITSHOW )
+ if ( nType == StateChangedType::INITSHOW )
{
if ( mbFormat )
Format();
}
- else if ( nType == STATE_CHANGE_UPDATEMODE )
+ else if ( nType == StateChangedType::UPDATEMODE )
{
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
- else if ( nType == STATE_CHANGE_TEXT )
+ else if ( nType == StateChangedType::TEXT )
{
if ( mpNoneItem.get() && !mbFormat && IsReallyVisible() && IsUpdateMode() )
{
@@ -1504,23 +1504,23 @@ void ValueSet::StateChanged( StateChangedType nType )
Invalidate( maNoneItemRect );
}
}
- else if ( (nType == STATE_CHANGE_ZOOM) ||
- (nType == STATE_CHANGE_CONTROLFONT) )
+ else if ( (nType == StateChangedType::ZOOM) ||
+ (nType == StateChangedType::CONTROLFONT) )
{
ImplInitSettings( true, false, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ else if ( nType == StateChangedType::CONTROLFOREGROUND )
{
ImplInitSettings( false, true, false );
Invalidate();
}
- else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ else if ( nType == StateChangedType::CONTROLBACKGROUND )
{
ImplInitSettings( false, false, true );
Invalidate();
}
- else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) )
+ else if ( (nType == StateChangedType::STYLE) || (nType == StateChangedType::ENABLE) )
{
mbFormat = true;
ImplInitSettings( false, false, true );
diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx
index 54febf2b8797..8b0b3d5ede1e 100644
--- a/svtools/source/dialogs/wizdlg.cxx
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -391,7 +391,7 @@ void WizardDialog::Resize()
void WizardDialog::StateChanged( StateChangedType nType )
{
- if ( nType == STATE_CHANGE_INITSHOW )
+ if ( nType == StateChangedType::INITSHOW )
{
if ( IsDefaultSize() )
{
diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx
index 9afa63df04cc..eefe81ab2ea5 100644
--- a/svtools/source/table/tablecontrol.cxx
+++ b/svtools/source/table/tablecontrol.cxx
@@ -122,30 +122,31 @@ namespace svt { namespace table
// forward certain settings to the data window
switch ( i_nStateChange )
{
- case STATE_CHANGE_CONTROL_FOCUS:
+ case StateChangedType::CONTROL_FOCUS:
m_pImpl->invalidateSelectedRows();
break;
- case STATE_CHANGE_CONTROLBACKGROUND:
+ case StateChangedType::CONTROLBACKGROUND:
if ( IsControlBackground() )
getDataWindow().SetControlBackground( GetControlBackground() );
else
getDataWindow().SetControlBackground();
break;
- case STATE_CHANGE_CONTROLFOREGROUND:
+ case StateChangedType::CONTROLFOREGROUND:
if ( IsControlForeground() )
getDataWindow().SetControlForeground( GetControlForeground() );
else
getDataWindow().SetControlForeground();
break;
- case STATE_CHANGE_CONTROLFONT:
+ case StateChangedType::CONTROLFONT:
if ( IsControlFont() )
getDataWindow().SetControlFont( GetControlFont() );
else
getDataWindow().SetControlFont();
break;
+ default:;
}
}