summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-22 13:48:09 +0200
committerNoel Grandin <noel@peralex.com>2015-05-25 10:31:35 +0200
commit65be8fd0f7f30eaca4fbc35e3fdc9cb7763cb44d (patch)
treebbfe99aba8f0155c7365b4b9d4bcd226654d88d6
parentb419da0f53cf7f65b1d0c58351176ece23fbfe1f (diff)
convert WINDOW_ZORDER constants to scoped enum
Change-Id: I91a583fe7d4195ee6bc73b4854f757517b38408b
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx2
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx4
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx2
-rw-r--r--extensions/source/propctrlr/browserline.cxx8
-rw-r--r--extensions/source/propctrlr/browserline.hxx2
-rw-r--r--extensions/source/propctrlr/browserlistbox.cxx4
-rw-r--r--include/vcl/window.hxx18
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx2
-rw-r--r--sd/source/ui/presenter/PresenterHelper.cxx2
-rw-r--r--svtools/source/toolpanel/drawerlayouter.cxx4
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx2
-rw-r--r--toolkit/source/awt/vclxcontainer.cxx4
-rw-r--r--vcl/source/window/btndlg.cxx2
-rw-r--r--vcl/source/window/stacking.cxx14
15 files changed, 44 insertions, 36 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index c3dc8ef4a089..557e89e82ec9 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -582,7 +582,7 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon
);
pTreeView->notifyHiContrastChanged();
- m_aBorder->SetZOrder(pTreeView, WINDOW_ZORDER_BEHIND);
+ m_aBorder->SetZOrder(pTreeView, ZOrderFlags::Behind);
}
if ( !m_pLists[E_TABLE]->GetEntryCount() )
{
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 3cce5975a3a1..ca610b1467da 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -745,13 +745,13 @@ void OFieldDescControl::ArrangeAggregates()
SetPosSize(adAggregates[i].pctrlInputControl, nCurrentControlPos, adAggregates[i].nPosSizeArgument);
// Set the z-order in a way such that the Controls can be traversed in the same sequence in which they have been arranged here
- adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? WINDOW_ZORDER_BEHIND : WINDOW_ZORDER_FIRST);
- adAggregates[i].pctrlInputControl->SetZOrder(adAggregates[i].pctrlTextControl, WINDOW_ZORDER_BEHIND );
+ adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? ZOrderFlags::Behind : ZOrderFlags::First);
+ adAggregates[i].pctrlInputControl->SetZOrder(adAggregates[i].pctrlTextControl, ZOrderFlags::Behind );
pZOrderPredecessor = adAggregates[i].pctrlInputControl;
if (adAggregates[i].pctrlInputControl == pFormatSample)
{
- pFormat->SetZOrder(pZOrderPredecessor, WINDOW_ZORDER_BEHIND);
+ pFormat->SetZOrder(pZOrderPredecessor, ZOrderFlags::Behind);
pZOrderPredecessor = pFormat;
}
@@ -768,8 +768,8 @@ void OFieldDescControl::ArrangeAggregates()
}
// Finally, put the ScrollBars at the top of the z-order
- m_pVertScroll->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
- m_pHorzScroll->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
+ m_pVertScroll->SetZOrder(NULL, ZOrderFlags::First);
+ m_pHorzScroll->SetZOrder(NULL, ZOrderFlags::First);
}
void OFieldDescControl::ActivateAggregate( EControlType eType )
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 571067e061d6..f5daa40ef329 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -622,7 +622,7 @@ void OJoinTableView::BeginChildMove( OTableWindow* pTabWin, const Point& rMouseP
SetPointer(Pointer(PointerStyle::Move));
Point aMousePos = ScreenToOutputPixel( rMousePos );
m_aDragOffset = aMousePos - pTabWin->GetPosPixel();
- m_pDragWin->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
+ m_pDragWin->SetZOrder(NULL, ZOrderFlags::First);
m_bTrackingInitiallyMoved = false;
StartTracking();
}
@@ -752,7 +752,7 @@ void OJoinTableView::Tracking( const TrackingEvent& rTEvt )
// position window
EndTracking();
- m_pDragWin->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
+ m_pDragWin->SetZOrder(NULL, ZOrderFlags::First);
// check, if I really moved
// (this prevents setting the modified-Flag, when there actually was no change0
TTableWindowData::value_type pData = m_pDragWin->GetData();
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 71efb0999d33..a0c3c2553863 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -288,7 +288,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin
if(aIter != GetTabWinMap().end())
{
- aIter->second->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
+ aIter->second->SetZOrder(NULL, ZOrderFlags::First);
aIter->second->GrabFocus();
EnsureVisible(aIter->second);
// no new one
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index 80cbe9266523..207515f59b78 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -135,17 +135,17 @@ namespace pcr
}
- void OBrowserLine::SetTabOrder(vcl::Window* pRefWindow, sal_uInt16 nFlags )
+ void OBrowserLine::SetTabOrder(vcl::Window* pRefWindow, ZOrderFlags nFlags )
{
m_aFtTitle->SetZOrder(pRefWindow,nFlags);
if ( m_pControlWindow )
- m_pControlWindow->SetZOrder( m_aFtTitle.get(), WINDOW_ZORDER_BEHIND );
+ m_pControlWindow->SetZOrder( m_aFtTitle.get(), ZOrderFlags::Behind );
if ( m_pBrowseButton && m_pControlWindow )
- m_pBrowseButton->SetZOrder( m_pControlWindow, WINDOW_ZORDER_BEHIND );
+ m_pBrowseButton->SetZOrder( m_pControlWindow, ZOrderFlags::Behind );
if ( m_pAdditionalBrowseButton && m_pBrowseButton )
- m_pAdditionalBrowseButton->SetZOrder( m_pBrowseButton, WINDOW_ZORDER_BEHIND );
+ m_pAdditionalBrowseButton->SetZOrder( m_pBrowseButton, ZOrderFlags::Behind );
}
diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx
index 9f39ec6277f3..35c26523d1bb 100644
--- a/extensions/source/propctrlr/browserline.hxx
+++ b/extensions/source/propctrlr/browserline.hxx
@@ -96,7 +96,7 @@ namespace pcr
bool IsVisible();
vcl::Window* GetRefWindow();
- void SetTabOrder(vcl::Window* pRefWindow, sal_uInt16 nFlags );
+ void SetTabOrder(vcl::Window* pRefWindow, ZOrderFlags nFlags );
bool GrabFocus();
void ShowBrowseButton( const OUString& _rImageURL, bool _bPrimary );
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index f5cfc3bc0a18..7f05d1314620 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -1162,9 +1162,9 @@ namespace pcr
rLine.pLine->IndentTitle( _rPropertyData.IndentLevel > 0 );
if ( nPos > 0 )
- rLine.pLine->SetTabOrder( pRefWindow, WINDOW_ZORDER_BEHIND );
+ rLine.pLine->SetTabOrder( pRefWindow, ZOrderFlags::Behind );
else
- rLine.pLine->SetTabOrder( pRefWindow, WINDOW_ZORDER_FIRST );
+ rLine.pLine->SetTabOrder( pRefWindow, ZOrderFlags::First );
m_aOutOfDateLines.insert( nPos );
rLine.pLine->SetComponentHelpIds(
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index fef38e5f06b1..cc5c695a90d6 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -182,10 +182,18 @@ namespace o3tl
}
// Flags for SetZOrder()
-#define WINDOW_ZORDER_BEFOR ((sal_uInt16)0x0001)
-#define WINDOW_ZORDER_BEHIND ((sal_uInt16)0x0002)
-#define WINDOW_ZORDER_FIRST ((sal_uInt16)0x0004)
-#define WINDOW_ZORDER_LAST ((sal_uInt16)0x0008)
+enum class ZOrderFlags
+{
+ NONE = 0x0000,
+ Before = 0x0001,
+ Behind = 0x0002,
+ First = 0x0004,
+ Last = 0x0008,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ZOrderFlags> : is_typed_flags<ZOrderFlags, 0x000f> {};
+}
// Activate-Flags
#define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001)
@@ -1005,7 +1013,7 @@ public:
sal_uInt16 GetActivateMode() const;
void ToTop( sal_uInt16 nFlags = 0 );
- void SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags );
+ void SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags );
void EnableAlwaysOnTop( bool bEnable = true );
bool IsAlwaysOnTopEnabled() const;
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 461272eb42a0..633427ec3e80 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -2309,7 +2309,7 @@ void PropertyControl::setSubControl( PropertySubControl* pSubControl )
if( pControl )
{
pControl->SetPosSizePixel( GetPosPixel(), GetSizePixel() );
- pControl->SetZOrder( this, WINDOW_ZORDER_BEFOR );
+ pControl->SetZOrder( this, ZOrderFlags::Before );
pControl->Show();
Hide();
}
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index 60b7bcb701de..3de26d6c6418 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -183,7 +183,7 @@ void SAL_CALL PresenterHelper::toTop (
if (pWindow != NULL)
{
pWindow->ToTop();
- pWindow->SetZOrder(NULL, WINDOW_ZORDER_LAST);
+ pWindow->SetZOrder(NULL, ZOrderFlags::Last);
}
}
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index c044105d38e1..84edff1f157e 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -156,12 +156,12 @@ namespace svt
// proper Z-Order
if ( i_nPosition == 0 )
{
- pDrawer->SetZOrder( NULL, WINDOW_ZORDER_FIRST );
+ pDrawer->SetZOrder( NULL, ZOrderFlags::First );
}
else
{
ToolPanelDrawer* pFirstDrawer( m_aDrawers[ i_nPosition - 1 ] );
- pDrawer->SetZOrder( pFirstDrawer, WINDOW_ZORDER_BEHIND );
+ pDrawer->SetZOrder( pFirstDrawer, ZOrderFlags::Behind );
}
pDrawer->Show();
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 548ae8849bba..4884a0813235 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -143,7 +143,7 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
// Create the line control
m_pLine = VclPtr<SwDashedLine>::Create(GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor);
- m_pLine->SetZOrder(this, WINDOW_ZORDER_BEFOR);
+ m_pLine->SetZOrder(this, ZOrderFlags::Before);
// Create and set the PopupMenu
m_pPopupMenu = new PopupMenu(SW_RES(MN_HEADERFOOTER_BUTTON));
diff --git a/toolkit/source/awt/vclxcontainer.cxx b/toolkit/source/awt/vclxcontainer.cxx
index aff962396d16..448a09fd8882 100644
--- a/toolkit/source/awt/vclxcontainer.cxx
+++ b/toolkit/source/awt/vclxcontainer.cxx
@@ -143,7 +143,7 @@ void VCLXContainer::setTabOrder( const ::com::sun::star::uno::Sequence< ::com::s
// Order windows before manipulating their style, because elements such as the
// RadioButton considers the PREV-window in StateChanged.
if ( pPrevWin )
- pWin->SetZOrder( pPrevWin, WINDOW_ZORDER_BEHIND );
+ pWin->SetZOrder( pPrevWin, ZOrderFlags::Behind );
WinBits nStyle = pWin->GetStyle();
nStyle &= ~(WB_TABSTOP|WB_NOTABSTOP|WB_GROUP);
@@ -198,7 +198,7 @@ void VCLXContainer::setGroup( const ::com::sun::star::uno::Sequence< ::com::sun:
// Z-Order
if ( pSortBehind )
- pWin->SetZOrder( pSortBehind, WINDOW_ZORDER_BEHIND );
+ pWin->SetZOrder( pSortBehind, ZOrderFlags::Behind );
WinBits nStyle = pWin->GetStyle();
if ( n == 0 )
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index bb0f0a35f600..102f5ce839bd 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -240,7 +240,7 @@ void ButtonDialog::StateChanged( StateChangedType nType )
for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
if ( it->mpPushButton && it->mbOwnButton )
- it->mpPushButton->SetZOrder(0, WINDOW_ZORDER_LAST);
+ it->mpPushButton->SetZOrder(0, ZOrderFlags::Last);
}
// Set focus on default button.
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 3d4fabb3e60f..596f49ae00b2 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -443,7 +443,7 @@ void Window::ToTop( sal_uInt16 nFlags )
ImplFocusToTop( nFlags, IsReallyVisible() );
}
-void Window::SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags )
+void Window::SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags )
{
if ( mpWindowImpl->mpBorderWindow )
@@ -452,21 +452,21 @@ void Window::SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags )
return;
}
- if ( nFlags & WINDOW_ZORDER_FIRST )
+ if ( nFlags & ZOrderFlags::First )
{
if ( ImplIsOverlapWindow() )
pRefWindow = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
else
pRefWindow = mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild;
- nFlags |= WINDOW_ZORDER_BEFOR;
+ nFlags |= ZOrderFlags::Before;
}
- else if ( nFlags & WINDOW_ZORDER_LAST )
+ else if ( nFlags & ZOrderFlags::Last )
{
if ( ImplIsOverlapWindow() )
pRefWindow = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap;
else
pRefWindow = mpWindowImpl->mpParent->mpWindowImpl->mpLastChild;
- nFlags |= WINDOW_ZORDER_BEHIND;
+ nFlags |= ZOrderFlags::Behind;
}
while ( pRefWindow && pRefWindow->mpWindowImpl->mpBorderWindow )
@@ -475,7 +475,7 @@ void Window::SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags )
return;
DBG_ASSERT( pRefWindow->mpWindowImpl->mpParent == mpWindowImpl->mpParent, "Window::SetZOrder() - pRefWindow has other parent" );
- if ( nFlags & WINDOW_ZORDER_BEFOR )
+ if ( nFlags & ZOrderFlags::Before )
{
if ( pRefWindow->mpWindowImpl->mpPrev.get() == this )
return;
@@ -513,7 +513,7 @@ void Window::SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags )
mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this;
mpWindowImpl->mpNext->mpWindowImpl->mpPrev = this;
}
- else if ( nFlags & WINDOW_ZORDER_BEHIND )
+ else if ( nFlags & ZOrderFlags::Behind )
{
if ( pRefWindow->mpWindowImpl->mpNext.get() == this )
return;