summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-06 14:48:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-10-13 17:45:57 +0200
commitaf5ebbf7835441c767f91a620f109ee6722e57bd (patch)
treec72b2a1ddb5aa0a0a369be7babd516a5592d5fac /sw/source/core
parent1156d11ef0bb2bc3d71ae9299656db4fed66f073 (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 'sw/source/core')
-rw-r--r--sw/source/core/doc/notxtfrm.cxx2
-rw-r--r--sw/source/core/draw/dflyobj.cxx2
-rw-r--r--sw/source/core/layout/layact.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx16
-rw-r--r--sw/source/core/layout/virtoutp.cxx2
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx2
-rw-r--r--sw/source/core/text/inftxt.cxx10
-rw-r--r--sw/source/core/text/porlin.cxx4
-rw-r--r--sw/source/core/txtnode/fntcache.cxx2
-rw-r--r--sw/source/core/txtnode/fntcap.cxx2
-rw-r--r--sw/source/core/txtnode/swfont.cxx2
-rw-r--r--sw/source/core/view/vdraw.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx4
-rw-r--r--sw/source/core/view/vprint.cxx2
14 files changed, 27 insertions, 27 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 83b8f8da9006..7f8666064bfe 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -202,7 +202,7 @@ static void lcl_ClearArea( const SwFrm &rFrm,
}
else
{
- rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ rOut.Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
rOut.SetFillColor( rFrm.getRootFrm()->GetCurrShell()->Imp()->GetRetoucheColor());
rOut.SetLineColor();
for( sal_uInt16 i = 0; i < aRegion.size(); ++i )
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 834bc65fc6e3..ad56718a900c 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -412,7 +412,7 @@ namespace
{
if ( pViewShell->getPrePostMapMode() != mpOutDev->GetMapMode() )
{
- mpOutDev->Push(PUSH_MAPMODE);
+ mpOutDev->Push(PushFlags::MAPMODE);
GDIMetaFile* pMetaFile = mpOutDev->GetConnectMetaFile();
if ( pMetaFile &&
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 1902a01dc0ba..ed0a031d4139 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -2116,7 +2116,7 @@ void SwLayIdle::ShowIdle( ColorData eColorData )
Rectangle aRect( 0, 0, 5, 5 );
aRect = pWin->PixelToLogic( aRect );
// OD 2004-04-23 #116347#
- pWin->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ pWin->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
pWin->SetFillColor( eColorData );
pWin->SetLineColor();
pWin->DrawRect( aRect );
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index b2c9f8d0ebea..bbb2cda42a65 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -995,7 +995,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
// #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut );
- pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
pOut->SetFillColor();
pOut->SetLineColor();
ConnectEdges( pOut );
@@ -1166,7 +1166,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
if ( !aLineRects.empty() )
{
- pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
pOut->SetLineColor();
// Reset draw mode in high contrast mode in order to get fill color
@@ -1817,7 +1817,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
const bool bNotInside = bClip && !rOut.IsInside( aAlignedGrfRect );
if ( bNotInside )
{
- pOut->Push( PUSH_CLIPREGION );
+ pOut->Push( PushFlags::CLIPREGION );
pOut->IntersectClipRegion( rOut.SVRect() );
}
@@ -2062,7 +2062,7 @@ void DrawGraphic(
// area, from which the background brush is determined.
aGrf.Pos() = rOrg.Pos();
// setup clipping at output device
- pOutDev->Push( PUSH_CLIPREGION );
+ pOutDev->Push( PushFlags::CLIPREGION );
pOutDev->IntersectClipRegion( rOut.SVRect() );
// use new method <GraphicObject::DrawTiled(::)>
{
@@ -2120,7 +2120,7 @@ void DrawGraphic(
bool bGrfBackgrdAlreadyDrawn = false;
if ( bRetouche )
{
- pOutDev->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ pOutDev->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
pOutDev->SetLineColor();
// check, if a existing background graphic (not filling the complete
@@ -4136,7 +4136,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
aRect._Intersection( Frm() );
OutputDevice* pOut = pGlobalShell->GetOut();
- pOut->Push( PUSH_CLIPREGION );
+ pOut->Push( PushFlags::CLIPREGION );
pOut->SetClipRegion();
const SwPageFrm* pPage = FindPageFrm();
@@ -4239,7 +4239,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
//one.
// OD 2004-04-23 #116347#
- pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
pOut->SetLineColor();
pPage = FindPageFrm();
@@ -6420,7 +6420,7 @@ void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage,
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut );
// OD 2004-04-23 #116347#
- pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
pOut->SetLineColor();
SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)this );
diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx
index 5c141488a774..6a036894091d 100644
--- a/sw/source/core/layout/virtoutp.cxx
+++ b/sw/source/core/layout/virtoutp.cxx
@@ -42,7 +42,7 @@ inline DbgRect::DbgRect( OutputDevice *pOutDev, const Rectangle &rRect,
{
if( pOut )
{
- pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
pOut->SetLineColor( eColor );
pOut->SetFillColor();
pOut->DrawRect( rRect );
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 5d9a4880ba59..d394165166c6 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1546,7 +1546,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Prepare the output device:
- mrOut.Push( PUSH_MAPMODE );
+ mrOut.Push( PushFlags::MAPMODE );
MapMode aMapMode( mrOut.GetMapMode() );
aMapMode.SetMapUnit( MAP_TWIP );
mrOut.SetMapMode( aMapMode );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index b72d18f598ec..311059c51910 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1069,7 +1069,7 @@ void SwTxtPaintInfo::DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool b
!GetOpt().IsPagePreview())
{
OutputDevice* pOut = (OutputDevice*)GetOut();
- pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ pOut->Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
pOut->SetFillColor( SwViewOption::GetFieldShadingsColor() );
pOut->SetLineColor();
pOut->DrawRect( aIntersect.SVRect() );
@@ -1077,7 +1077,7 @@ void SwTxtPaintInfo::DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool b
}
const int delta=10;
Rectangle r(aIntersect.Left()+delta, aIntersect.Top()+delta, aIntersect.Right()-delta, aIntersect.Bottom()-delta);
- m_pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ m_pOut->Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
m_pOut->SetLineColor( Color(0, 0, 0));
m_pOut->SetFillColor();
m_pOut->DrawRect( r );
@@ -1100,7 +1100,7 @@ void SwTxtPaintInfo::DrawBackground( const SwLinePortion &rPor ) const
if ( aIntersect.HasArea() )
{
OutputDevice* pOut = (OutputDevice*)GetOut();
- pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ pOut->Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
// For dark background we do not want to have a filled rectangle
if ( GetVsh() && GetVsh()->GetWin() && lcl_IsDarkBackground( *this ) )
@@ -1151,7 +1151,7 @@ void SwTxtPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const
!GetOpt().IsPagePreview())
{
OutputDevice* pOutDev = (OutputDevice*)GetOut();
- pOutDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ pOutDev->Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
pOutDev->SetFillColor( SwViewOption::GetFieldShadingsColor() );
pOutDev->SetLineColor( );
pOutDev->DrawRect( aIntersect.SVRect() );
@@ -1183,7 +1183,7 @@ void SwTxtPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const
aFillColor = *m_pFnt->GetBackColor();
}
- pTmpOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ pTmpOut->Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
pTmpOut->SetFillColor(aFillColor);
pTmpOut->SetLineColor();
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 68be6f01b416..d1ef7de685d9 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -98,8 +98,8 @@ void SwLinePortion::PrePaint( const SwTxtPaintInfo& rInf,
sal_uInt16 nPos;
SwTxtPaintInfo aInf( rInf );
- const bool bBidiPor = ( rInf.GetTxtFrm()->IsRightToLeft() ) !=
- ( 0 != ( TEXT_LAYOUT_BIDI_RTL & rInf.GetOut()->GetLayoutMode() ) );
+ const bool bBidiPor = rInf.GetTxtFrm()->IsRightToLeft() !=
+ bool( TEXT_LAYOUT_BIDI_RTL & rInf.GetOut()->GetLayoutMode() );
sal_uInt16 nDir = bBidiPor ?
1800 :
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index f3b648bc2af0..c7216d1e190c 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -868,7 +868,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
! rInf.IsIgnoreFrmRTL();
const ComplexTextLayoutMode nMode = rInf.GetOut().GetLayoutMode();
const bool bBidiPor = ( bSwitchL2R !=
- ( 0 != ( TEXT_LAYOUT_BIDI_RTL & nMode ) ) );
+ ( TEXT_LAYOUT_DEFAULT != ( TEXT_LAYOUT_BIDI_RTL & nMode ) ) );
// be sure to have the correct layout mode at the printer
if ( pPrinter )
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 92d7d7e8035c..4dd6e4099c10 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -284,7 +284,7 @@ void SwDoDrawCapital::DrawSpace( Point &rPos )
const ComplexTextLayoutMode nMode = rInf.GetpOut()->GetLayoutMode();
const bool bBidiPor = ( bSwitchL2R !=
- ( 0 != ( TEXT_LAYOUT_BIDI_RTL & nMode ) ) );
+ ( TEXT_LAYOUT_DEFAULT != ( TEXT_LAYOUT_BIDI_RTL & nMode ) ) );
if ( bBidiPor )
nDiff = -nDiff;
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 24afd66d7d7c..3975cc371518 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -1481,7 +1481,7 @@ void SwDrawTextInfo::Shift( sal_uInt16 nDir )
#endif
const bool bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) !=
- ( 0 != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) );
+ ( TEXT_LAYOUT_DEFAULT != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) );
nDir = bBidiPor ?
1800 :
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 4ac29083c745..6c80d1f64b9b 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -130,7 +130,7 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
GetDrawView()->GetModel()->GetDrawOutliner().SetDefaultHorizontalTextDirection( aEEHoriTextDirOfPage );
}
- pOutDev->Push( PUSH_LINECOLOR ); // #114231#
+ pOutDev->Push( PushFlags::LINECOLOR ); // #114231#
if (pPrintData)
{
// hide drawings but not form controls (form controls are handled elsewhere)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index d861c8d51cc8..561bcd9027c9 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1473,7 +1473,7 @@ void SwViewShell::PaintDesktop( const SwRect &rRect )
void SwViewShell::_PaintDesktop( const SwRegionRects &rRegion )
{
// OD 2004-04-23 #116347#
- GetOut()->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ GetOut()->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
GetOut()->SetLineColor();
for ( sal_uInt16 i = 0; i < rRegion.size(); ++i )
@@ -1744,7 +1744,7 @@ void SwViewShell::Paint(const Rectangle &rRect)
const vcl::Region aDLRegion(rRect);
DLPrePaint2(aDLRegion);
- mpOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ mpOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
mpOut->SetFillColor( Imp()->GetRetoucheColor() );
mpOut->SetLineColor();
mpOut->DrawRect( rRect );
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 9db297083121..7f2b520d73ce 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -611,7 +611,7 @@ void SwViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintD
// document because the thumbnail creation will not trigger a complete
// formatting of the document.
- pOleOut->Push( PUSH_CLIPREGION );
+ pOleOut->Push( PushFlags::CLIPREGION );
pOleOut->IntersectClipRegion( aSwRect.SVRect() );
pSh->GetLayout()->Paint( aSwRect );