summaryrefslogtreecommitdiff
path: root/editeng
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 /editeng
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 'editeng')
-rw-r--r--editeng/qa/items/borderline_test.cxx4
-rw-r--r--editeng/source/editeng/impedit.cxx2
-rw-r--r--editeng/source/editeng/impedit2.cxx2
-rw-r--r--editeng/source/editeng/impedit3.cxx12
-rw-r--r--editeng/source/items/borderline.cxx8
-rw-r--r--editeng/source/items/frmitems.cxx8
-rw-r--r--editeng/source/misc/hangulhanja.cxx2
7 files changed, 19 insertions, 19 deletions
diff --git a/editeng/qa/items/borderline_test.cxx b/editeng/qa/items/borderline_test.cxx
index 14322762081d..b97a41432978 100644
--- a/editeng/qa/items/borderline_test.cxx
+++ b/editeng/qa/items/borderline_test.cxx
@@ -134,7 +134,7 @@ void BorderLineTest::testGuessWidthThinthickLargegap()
void BorderLineTest::testGuessWidthNostyleDouble()
{
SvxBorderLine line;
- line.GuessLinesWidths( NONE,
+ line.GuessLinesWidths( css::table::BorderLineStyle::NONE,
THINTHICKLG_OUT_WIDTH,
THINTHICKLG_IN_WIDTH,
THINTHICKLG_DIST_WIDTH );
@@ -152,7 +152,7 @@ void BorderLineTest::testGuessWidthNostyleDouble()
void BorderLineTest::testGuessWidthNostyleSingle()
{
SvxBorderLine line;
- line.GuessLinesWidths( NONE, TEST_WIDTH );
+ line.GuessLinesWidths( css::table::BorderLineStyle::NONE, TEST_WIDTH );
CPPUNIT_ASSERT_EQUAL( SOLID, line.GetBorderLineStyle() );
CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, line.GetWidth() );
}
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 5e112874ecd4..7e069d6da9a6 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -341,7 +341,7 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rD
}
else
{
- _pTarget->Push(PUSH_LINECOLOR|PUSH_FILLCOLOR|PUSH_RASTEROP);
+ _pTarget->Push(PushFlags::LINECOLOR|PushFlags::FILLCOLOR|PushFlags::RASTEROP);
_pTarget->SetLineColor();
_pTarget->SetFillColor(COL_BLACK);
_pTarget->SetRasterOp(ROP_INVERT);
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index f1b0fbc76b97..ed238cda11f1 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3116,7 +3116,7 @@ sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine,
// #114278# Saving both layout mode and language (since I'm
// potentially changing both)
- GetRefDevice()->Push( PUSH_TEXTLAYOUTMODE|PUSH_TEXTLANGUAGE );
+ GetRefDevice()->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
ImplInitLayoutMode( GetRefDevice(), nPara, -1 );
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 1f5cd00bd2b0..e12209db16b3 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -664,7 +664,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
// SW disables TEXT_LAYOUT_COMPLEX_DISABLED, so maybe I have to enable it...
// Saving both layout mode and language (since I'm potentially changing both)
- GetRefDevice()->Push( PUSH_TEXTLAYOUTMODE|PUSH_TEXTLANGUAGE );
+ GetRefDevice()->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
ImplInitLayoutMode( GetRefDevice(), nPara, -1 );
@@ -2271,7 +2271,7 @@ sal_Int32 ImpEditEngine::SplitTextPortion( ParaPortion* pPortion, sal_Int32 nPos
SvxFont aTmpFont( pPortion->GetNode()->GetCharAttribs().GetDefFont() );
SeekCursor( pPortion->GetNode(), nTxtPortionStart+1, aTmpFont );
aTmpFont.SetPhysFont( GetRefDevice() );
- GetRefDevice()->Push( PUSH_TEXTLANGUAGE );
+ GetRefDevice()->Push( PushFlags::TEXTLANGUAGE );
ImplInitDigitMode(GetRefDevice(), aTmpFont.GetLanguage());
Size aSz = aTmpFont.QuickGetTextSize( GetRefDevice(), pPortion->GetNode()->GetString(), nTxtPortionStart, pTextPortion->GetLen(), NULL );
GetRefDevice()->Pop();
@@ -3032,7 +3032,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
// #114278# Saving both layout mode and language (since I'm
// potentially changing both)
- pOutDev->Push( PUSH_TEXTLAYOUTMODE|PUSH_TEXTLANGUAGE );
+ pOutDev->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
ImplInitLayoutMode( pOutDev, n, nIndex );
ImplInitDigitMode(pOutDev, aTmpFont.GetLanguage());
@@ -3096,8 +3096,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
aBottomRightRectPos.Y() += 2 * nHalfBlankWidth;
}
- pOutDev->Push( PUSH_FILLCOLOR );
- pOutDev->Push( PUSH_LINECOLOR );
+ pOutDev->Push( PushFlags::FILLCOLOR );
+ pOutDev->Push( PushFlags::LINECOLOR );
pOutDev->SetFillColor( COL_LIGHTGRAY );
pOutDev->SetLineColor( COL_LIGHTGRAY );
@@ -3776,7 +3776,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev
if ( GetTextRanger() )
{
// Some problems here with push/pop, why?!
-// pTarget->Push( PUSH_CLIPREGION|PUSH_MAPMODE );
+// pTarget->Push( PushFlags::CLIPREGION|PushFlags::MAPMODE );
bClipRegion = pTarget->IsClipRegion();
aOldRegion = pTarget->GetClipRegion();
// How do I get the polygon to the right place??
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 4bea25c9df17..c921c05b4385 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -163,7 +163,7 @@ ConvertBorderStyleFromWord(int const nWordLineStyle)
case 27:
return INSET;
default:
- return NONE;
+ return css::table::BorderLineStyle::NONE;
}
}
@@ -302,7 +302,7 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle )
switch ( nStyle )
{
// No line: no width
- case NONE:
+ case css::table::BorderLineStyle::NONE:
aImpl = BorderWidthImpl( 0, 0.0 );
break;
@@ -431,7 +431,7 @@ void SvxBorderLine::ScaleMetrics( long nMult, long nDiv )
void SvxBorderLine::GuessLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nOut, sal_uInt16 nIn, sal_uInt16 nDist )
{
- if (NONE == nStyle)
+ if (css::table::BorderLineStyle::NONE == nStyle)
{
nStyle = SOLID;
if ( nOut > 0 && nIn > 0 )
@@ -454,7 +454,7 @@ void SvxBorderLine::GuessLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nOut, sa
static size_t const len = SAL_N_ELEMENTS(aDoubleStyles);
long nWidth = 0;
- SvxBorderStyle nTestStyle(NONE);
+ SvxBorderStyle nTestStyle(css::table::BorderLineStyle::NONE);
for (size_t i = 0; i < len && nWidth == 0; ++i)
{
nTestStyle = aDoubleStyles[i];
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 9eb3a253a6b5..ce635812ceaa 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -118,7 +118,7 @@ namespace
SvxBorderLine CreateBorderLine(SvStream &stream, sal_uInt16 version)
{
sal_uInt16 nOutline, nInline, nDistance;
- sal_uInt16 nStyle = NONE;
+ sal_uInt16 nStyle = css::table::BorderLineStyle::NONE;
Color aColor;
ReadColor( stream, aColor ).ReadUInt16( nOutline ).ReadUInt16( nInline ).ReadUInt16( nDistance );
@@ -1905,7 +1905,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
drawing::LineStyle eDrawingStyle;
rVal >>= eDrawingStyle;
- editeng::SvxBorderStyle eBorderStyle = NONE;
+ editeng::SvxBorderStyle eBorderStyle = css::table::BorderLineStyle::NONE;
switch ( eDrawingStyle )
{
default:
@@ -2643,7 +2643,7 @@ SfxPoolItem* SvxBoxInfoItem::Create( SvStream& rStrm, sal_uInt16 ) const
Color aColor;
ReadColor( rStrm, aColor ).ReadInt16( nOutline ).ReadInt16( nInline ).ReadInt16( nDistance );
SvxBorderLine aBorder( &aColor );
- aBorder.GuessLinesWidths(NONE, nOutline, nInline, nDistance);
+ aBorder.GuessLinesWidths(css::table::BorderLineStyle::NONE, nOutline, nInline, nDistance);
switch( cLine )
{
@@ -3239,7 +3239,7 @@ SfxPoolItem* SvxLineItem::Create( SvStream& rStrm, sal_uInt16 ) const
if( nOutline )
{
SvxBorderLine aLine( &aColor );
- aLine.GuessLinesWidths(NONE, nOutline, nInline, nDistance);
+ aLine.GuessLinesWidths(css::table::BorderLineStyle::NONE, nOutline, nInline, nDistance);
_pLine->SetLine( &aLine );
}
return _pLine;
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index c71089c5172b..5414ffa45f2d 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -328,7 +328,7 @@ namespace editeng
sal_Int32 nLength = m_sCurrentPortion.getLength() - nStartSearch;
m_nCurrentConversionType = implGetConversionType();
- m_nCurrentConversionOption = IsByCharacter() ? CHARACTER_BY_CHARACTER : NONE;
+ m_nCurrentConversionOption = IsByCharacter() ? CHARACTER_BY_CHARACTER : css::i18n::TextConversionOption::NONE;
if( m_bIgnorePostPositionalWord )
m_nCurrentConversionOption = m_nCurrentConversionOption | IGNORE_POST_POSITIONAL_WORD;