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 /starmath/source | |
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 'starmath/source')
-rw-r--r-- | starmath/source/dialog.cxx | 2 | ||||
-rw-r--r-- | starmath/source/document.cxx | 4 | ||||
-rw-r--r-- | starmath/source/node.cxx | 2 | ||||
-rw-r--r-- | starmath/source/rect.cxx | 4 | ||||
-rw-r--r-- | starmath/source/tmpdevice.cxx | 4 | ||||
-rw-r--r-- | starmath/source/visitors.cxx | 8 |
6 files changed, 12 insertions, 12 deletions
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 2f1bf0a4bd93..50aa25ef53c8 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1062,7 +1062,7 @@ Point SmShowSymbolSetWindow::OffsetPoint(const Point &rPoint) const void SmShowSymbolSetWindow::Paint(const Rectangle&) { - Push(PUSH_MAPMODE); + Push(PushFlags::MAPMODE); // set MapUnit for which 'nLen' has been calculated SetMapMode(MapMode(MAP_PIXEL)); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index fbc9a1b27cfa..b8a37740f135 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -507,7 +507,7 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell ) { if ( 0 != (pPrinter = rDocShell.GetPrt()) ) { - pPrinter->Push( PUSH_MAPMODE ); + pPrinter->Push( PushFlags::MAPMODE ); if ( SFX_CREATE_MODE_EMBEDDED == rDocShell.GetCreateMode() ) { // if it is an embedded object (without it's own printer) @@ -532,7 +532,7 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell ) } if ( 0 != (pRefDev = rDocShell.GetRefDev()) && pPrinter != pRefDev ) { - pRefDev->Push( PUSH_MAPMODE ); + pRefDev->Push( PushFlags::MAPMODE ); if ( SFX_CREATE_MODE_EMBEDDED == rDocShell.GetCreateMode() ) { // if it is an embedded object (without it's own printer) diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 0b7af71cb03c..dd1c51c4b4b9 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2675,7 +2675,7 @@ void SmMathSymbolNode::AdaptToY(const OutputDevice &rDev, sal_uLong nHeight) if (aFntSize.Width() == 0) { OutputDevice &rDevNC = (OutputDevice &) rDev; - rDevNC.Push(PUSH_FONT | PUSH_MAPMODE); + rDevNC.Push(PushFlags::FONT | PushFlags::MAPMODE); rDevNC.SetFont(GetFont()); aFntSize.Width() = rDev.GetFontMetric().GetSize().Width(); rDevNC.Pop(); diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index 8eef2bcb15e0..53775b128a01 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -154,7 +154,7 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat, { OutputDevice *pWindow = Application::GetDefaultDevice(); - pWindow->Push(PUSH_MAPMODE | PUSH_FONT); + pWindow->Push(PushFlags::MAPMODE | PushFlags::FONT); pWindow->SetMapMode(rDev.GetMapMode()); pWindow->SetFont(rDev.GetFontMetric()); @@ -618,7 +618,7 @@ bool SmGetGlyphBoundRect(const OutputDevice &rDev, const FontMetric aDevFM (rDev.GetFontMetric()); - pGlyphDev->Push(PUSH_FONT | PUSH_MAPMODE); + pGlyphDev->Push(PushFlags::FONT | PushFlags::MAPMODE); vcl::Font aFnt(rDev.GetFont()); aFnt.SetAlign(ALIGN_TOP); diff --git a/starmath/source/tmpdevice.cxx b/starmath/source/tmpdevice.cxx index 2a6c3babce57..934bff4030f1 100644 --- a/starmath/source/tmpdevice.cxx +++ b/starmath/source/tmpdevice.cxx @@ -33,8 +33,8 @@ SmTmpDevice::SmTmpDevice(OutputDevice &rTheDev, bool bUseMap100th_mm) : rOutDev(rTheDev) { - rOutDev.Push( PUSH_FONT | PUSH_MAPMODE | - PUSH_LINECOLOR | PUSH_FILLCOLOR | PUSH_TEXTCOLOR ); + rOutDev.Push( PushFlags::FONT | PushFlags::MAPMODE | + PushFlags::LINECOLOR | PushFlags::FILLCOLOR | PushFlags::TEXTCOLOR ); if (bUseMap100th_mm && MAP_100TH_MM != rOutDev.GetMapMode().GetMapUnit()) { SAL_WARN("starmath", "incorrect MapMode?"); diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index d0882b231fdf..9ffdc4d7f291 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -359,7 +359,7 @@ SmCaretDrawingVisitor::SmCaretDrawingVisitor( OutputDevice& rDevice, return; //Save device state - rDev.Push( PUSH_FONT | PUSH_MAPMODE | PUSH_LINECOLOR | PUSH_FILLCOLOR | PUSH_TEXTCOLOR ); + rDev.Push( PushFlags::FONT | PushFlags::MAPMODE | PushFlags::LINECOLOR | PushFlags::FILLCOLOR | PushFlags::TEXTCOLOR ); pos.pSelectedNode->Accept( this ); //Restore device state @@ -433,7 +433,7 @@ void SmCaretDrawingVisitor::DefaultVisit( SmNode* pNode ) void SmCaretPos2LineVisitor::Visit( SmTextNode* pNode ) { //Save device state - pDev->Push( PUSH_FONT | PUSH_TEXTCOLOR ); + pDev->Push( PushFlags::FONT | PushFlags::TEXTCOLOR ); long i = pos.Index; @@ -2070,7 +2070,7 @@ SmSelectionDrawingVisitor::SmSelectionDrawingVisitor( OutputDevice& rDevice, SmN aSelectionArea.Move( Offset.X( ), Offset.Y( ) ); //Save device state - rDev.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); + rDev.Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR ); //Change colors rDev.SetLineColor( ); rDev.SetFillColor( Color( COL_LIGHTGRAY ) ); @@ -2109,7 +2109,7 @@ void SmSelectionDrawingVisitor::VisitChildren( SmNode* pNode ) void SmSelectionDrawingVisitor::Visit( SmTextNode* pNode ) { if( pNode->IsSelected( ) ){ - rDev.Push( PUSH_TEXTCOLOR | PUSH_FONT ); + rDev.Push( PushFlags::TEXTCOLOR | PushFlags::FONT ); rDev.SetFont( pNode->GetFont( ) ); Point Position = pNode->GetTopLeft( ); |