diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-06 14:48:16 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-13 17:45:57 +0200 |
commit | af5ebbf7835441c767f91a620f109ee6722e57bd (patch) | |
tree | c72b2a1ddb5aa0a0a369be7babd516a5592d5fac /svtools | |
parent | 1156d11ef0bb2bc3d71ae9299656db4fed66f073 (diff) |
create a macro library for implementing bit-flags types
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
changed from a macro- to a template-based solution. (Unfortunately MSVC 2012
does not support explicit conversion operators. Worked around that with
explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and
SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a
baseline that requires unconditional support for them.)
Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 4 | ||||
-rw-r--r-- | svtools/source/control/headbar.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/ruler.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/toolbarmenu.cxx | 2 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 4 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 4 | ||||
-rw-r--r-- | svtools/source/table/gridtablerenderer.cxx | 10 | ||||
-rw-r--r-- | svtools/source/toolpanel/paneltabbar.cxx | 6 |
8 files changed, 17 insertions, 17 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index d04a6182e912..4e9e0c671593 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -805,7 +805,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, pFirstCol->Title(), false, false, !IsEnabled()); aButtonFrame.Draw( *pDev ); - pDev->Push( PUSH_LINECOLOR ); + pDev->Push( PushFlags::LINECOLOR ); pDev->SetLineColor( Color( COL_BLACK ) ); pDev->DrawLine( Point( aRealPos.X(), aRealPos.Y() + nTitleHeight-1 ), @@ -1018,7 +1018,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, bool { // draw horizontal delimitation lines _rOut.SetClipRegion(); - _rOut.Push( PUSH_LINECOLOR ); + _rOut.Push( PushFlags::LINECOLOR ); _rOut.SetLineColor( aDelimiterLineColor ); long nY = aPos.Y() + nDataRowHeigt - 1; if (nY <= aOverallAreaBRPos.Y()) diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 82a9bb02d94e..490ad89bcbf0 100644 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -502,7 +502,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, { if( aSelectionTextColor != Color( COL_TRANSPARENT ) ) { - pDev->Push( PUSH_TEXTCOLOR ); + pDev->Push( PushFlags::TEXTCOLOR ); pDev->SetTextColor( aSelectionTextColor ); } if ( IsEnabled() ) diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index f25a0e6a50d5..a85a474293e2 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -2744,7 +2744,7 @@ void Ruler::DrawTab( OutputDevice* pDevice, const Color &rFillColor, const Point Point aPos( rPos ); sal_uInt16 nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL); - pDevice->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); + pDevice->Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR ); pDevice->SetLineColor(); pDevice->SetFillColor(rFillColor); ImplCenterTabPos( aPos, nTabStyle ); diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index cb016846b3d5..f72eb40c3d8b 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -903,7 +903,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) if( IsNativeControlSupported( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL ) ) { Size aPxSize( GetOutputSizePixel() ); - Push( PUSH_CLIPREGION ); + Push( PushFlags::CLIPREGION ); IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pEntry->maSize.Height() ) ) ); Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index be4baa30e6ea..69c710991d5b 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -582,7 +582,7 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, bool bRectClip; const bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); - pOut->Push( PUSH_CLIPREGION ); + pOut->Push( PushFlags::CLIPREGION ); if( bCrop ) { @@ -727,7 +727,7 @@ bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const bool bRectClip; const bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip ); - pOut->Push( PUSH_CLIPREGION ); + pOut->Push( PushFlags::CLIPREGION ); if( bCrop ) { diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 57a1620d5fa7..b61f079d39d2 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -1647,7 +1647,7 @@ void GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& aOutSz = aRotBoundRect.GetSize(); } - pOut->Push( PUSH_CLIPREGION ); + pOut->Push( PushFlags::CLIPREGION ); pOut->IntersectClipRegion( Rectangle( aOutPt, aOutSz ) ); ( (GDIMetaFile&) rMtf ).WindStart(); @@ -1994,7 +1994,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c const Point aOutStart( aOutOrigin.X() + nInvisibleTilesX*rSizePixel.Width(), aOutOrigin.Y() + nInvisibleTilesY*rSizePixel.Height() ); - pOut->Push( PUSH_CLIPREGION ); + pOut->Push( PushFlags::CLIPREGION ); pOut->IntersectClipRegion( rArea ); // Paint all tiles diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index a6d7c613540e..e1eeec061d76 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -225,7 +225,7 @@ namespace svt { namespace table OSL_PRECOND( _bIsColHeaderArea || _bIsRowHeaderArea, "GridTableRenderer::PaintHeaderArea: invalid area flags!" ); - _rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR ); + _rDevice.Push( PushFlags::FILLCOLOR | PushFlags::LINECOLOR ); Color const background = lcl_getEffectiveColor( m_pImpl->rModel.getHeaderBackgroundColor(), _rStyle, &StyleSettings::GetDialogColor ); _rDevice.SetFillColor( background ); @@ -249,7 +249,7 @@ namespace svt { namespace table void GridTableRenderer::PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ) { - _rDevice.Push( PUSH_LINECOLOR); + _rDevice.Push( PushFlags::LINECOLOR); OUString sHeaderText; PColumnModel const pColumn = m_pImpl->rModel.getColumnModel( _nCol ); @@ -320,7 +320,7 @@ namespace svt { namespace table // remember the row for subsequent calls to the other ->ITableRenderer methods m_pImpl->nCurrentRow = _nRow; - _rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR); + _rDevice.Push( PushFlags::FILLCOLOR | PushFlags::LINECOLOR); ::Color backgroundColor = _rStyle.GetFieldColor(); @@ -384,7 +384,7 @@ namespace svt { namespace table void GridTableRenderer::PaintRowHeader( bool i_hasControlFocus, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ) { - _rDevice.Push( PUSH_LINECOLOR | PUSH_TEXTCOLOR ); + _rDevice.Push( PushFlags::LINECOLOR | PushFlags::TEXTCOLOR ); ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() ); ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor; @@ -437,7 +437,7 @@ namespace svt { namespace table void GridTableRenderer::PaintCell( ColPos const i_column, bool _bSelected, bool i_hasControlFocus, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ) { - _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); + _rDevice.Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR ); Rectangle const aContentArea( lcl_getContentArea( *m_pImpl, _rArea ) ); CellRenderContext const aRenderContext( _rDevice, aContentArea, _rStyle, i_column, _bSelected, i_hasControlFocus ); diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 79cf3784dd44..7570adf0ce4e 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -472,7 +472,7 @@ namespace svt ClipItemRegion( const PanelTabBar_Impl& i_rImpl ) :m_rDevice( i_rImpl.m_rTabBar ) { - m_rDevice.Push( PUSH_CLIPREGION ); + m_rDevice.Push( PushFlags::CLIPREGION ); m_rDevice.SetClipRegion(vcl::Region( i_rImpl.m_aNormalizer.getTransformed( i_rImpl.m_aGeometry.getItemsRect(), @@ -683,7 +683,7 @@ namespace svt Point aTextPos( aRenderArea.TopLeft() ); if ( IsVertical() ) { - m_rTabBar.Push( PUSH_FONT ); + m_rTabBar.Push( PushFlags::FONT ); vcl::Font aFont( m_rTabBar.GetFont() ); aFont.SetOrientation( 2700 ); @@ -1046,7 +1046,7 @@ namespace svt // background const Rectangle aNormalizedPaintArea( m_pImpl->m_aNormalizer.getNormalized( i_rRect, m_pImpl->m_eTabAlignment ) ); - m_pImpl->m_aRenderDevice.Push( PUSH_CLIPREGION ); + m_pImpl->m_aRenderDevice.Push( PushFlags::CLIPREGION ); m_pImpl->m_aRenderDevice.SetClipRegion(vcl::Region(aNormalizedPaintArea)); m_pImpl->m_pRenderer->renderBackground(); m_pImpl->m_aRenderDevice.Pop(); |