summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-18 13:36:39 +0200
committerNoel Grandin <noel@peralex.com>2015-05-20 09:52:08 +0200
commit25a47c5cd54c73e754de988bde8ec8a202d27717 (patch)
tree479c07ba52f718f03770fba60121d2a0ef3a3b08 /cui
parent7a0af37989d1f1b508a61f28e785c5b1f27d58af (diff)
convert TEXT_DRAW constants to scoped enum
Change-Id: Ic0f7f8fa236bb478b3598ae3fd3c1b30ebbf1a01
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/acccfg.cxx2
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx41
-rw-r--r--cui/source/dialogs/hlmarkwn.cxx2
-rw-r--r--cui/source/dialogs/linkdlg.cxx2
-rw-r--r--cui/source/options/connpooloptions.cxx8
5 files changed, 27 insertions, 28 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 45e8ae8946d8..b3511e977198 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -649,7 +649,7 @@ void SfxAccCfgLBoxString_Impl::Paint(const Point& aPos, SvTreeListBox& /*rDevice
if (pUserData->m_bIsConfigurable)
rRenderContext.DrawText(aPos, GetText());
else
- rRenderContext.DrawCtrlText(aPos, GetText(), 0, -1, TEXT_DRAW_DISABLE);
+ rRenderContext.DrawCtrlText(aPos, GetText(), 0, -1, DrawTextFlags::Disable);
}
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 839cb1f5d3b1..db448d2dc28d 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -99,7 +99,7 @@ namespace svx
const OUString& getSecondaryText() const { return m_sSecondaryText; }
public:
- void Paint( OutputDevice& _rDevice, const Rectangle& _rRect, sal_uInt16 _nTextStyle,
+ void Paint( OutputDevice& _rDevice, const Rectangle& _rRect, DrawTextFlags _nTextStyle,
Rectangle* _pPrimaryLocation = NULL, Rectangle* _pSecondaryLocation = NULL,
vcl::ControlLayoutData* _pLayoutData = NULL );
};
@@ -117,7 +117,7 @@ namespace svx
}
- void PseudoRubyText::Paint(vcl::RenderContext& rRenderContext, const Rectangle& _rRect, sal_uInt16 _nTextStyle,
+ void PseudoRubyText::Paint(vcl::RenderContext& rRenderContext, const Rectangle& _rRect, DrawTextFlags _nTextStyle,
Rectangle* _pPrimaryLocation, Rectangle* _pSecondaryLocation,
vcl::ControlLayoutData* _pLayoutData )
{
@@ -147,13 +147,13 @@ namespace svx
// widest of both text rects
aPrimaryRect.Left() = aSecondaryRect.Left() = _rRect.Left();
aPrimaryRect.Right() = aSecondaryRect.Right() = _rRect.Left() + nCombinedWidth;
- if (TEXT_DRAW_RIGHT & _nTextStyle)
+ if (DrawTextFlags::Right & _nTextStyle)
{
// move the rectangles to the right
aPrimaryRect.Move( aPlaygroundSize.Width() - nCombinedWidth, 0 );
aSecondaryRect.Move( aPlaygroundSize.Width() - nCombinedWidth, 0 );
}
- else if (TEXT_DRAW_CENTER & _nTextStyle)
+ else if (DrawTextFlags::Center & _nTextStyle)
{
// center the rectangles
aPrimaryRect.Move( ( aPlaygroundSize.Width() - nCombinedWidth ) / 2, 0 );
@@ -165,13 +165,13 @@ namespace svx
// align to the top, for the moment
aPrimaryRect.Move( 0, _rRect.Top() - aPrimaryRect.Top() );
aSecondaryRect.Move( 0, aPrimaryRect.Top() + aPrimaryRect.GetHeight() - aSecondaryRect.Top() );
- if (TEXT_DRAW_BOTTOM & _nTextStyle)
+ if (DrawTextFlags::Bottom & _nTextStyle)
{
// move the rects to the bottom
aPrimaryRect.Move( 0, aPlaygroundSize.Height() - nCombinedHeight );
aSecondaryRect.Move( 0, aPlaygroundSize.Height() - nCombinedHeight );
}
- else if (TEXT_DRAW_VCENTER & _nTextStyle)
+ else if (DrawTextFlags::VCenter & _nTextStyle)
{
// move the rects to the bottom
aPrimaryRect.Move( 0, ( aPlaygroundSize.Height() - nCombinedHeight ) / 2 );
@@ -190,9 +190,9 @@ namespace svx
// now draw the texts
// as we already calculated the precise rectangles for the texts, we don't want to
// use the alignment flags given - within it's rect, every text is centered
- sal_uInt16 nDrawTextStyle( _nTextStyle );
- nDrawTextStyle &= ~( TEXT_DRAW_RIGHT | TEXT_DRAW_LEFT | TEXT_DRAW_BOTTOM | TEXT_DRAW_TOP );
- nDrawTextStyle |= TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER;
+ DrawTextFlags nDrawTextStyle( _nTextStyle );
+ nDrawTextStyle &= ~DrawTextFlags( DrawTextFlags::Right | DrawTextFlags::Left | DrawTextFlags::Bottom | DrawTextFlags::Top );
+ nDrawTextStyle |= DrawTextFlags::Center | DrawTextFlags::VCenter;
rRenderContext.DrawText( aPrimaryRect, m_sPrimaryText, nDrawTextStyle, pTextMetrics, pDisplayText );
{
@@ -251,26 +251,26 @@ namespace svx
++aTextRect.Top(); --aTextRect.Bottom();
// calculate the text flags for the painting
- sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC;
+ DrawTextFlags nTextStyle = DrawTextFlags::Mnemonic;
WinBits nStyle = GetStyle( );
// the horizontal alignment
if ( nStyle & WB_RIGHT )
- nTextStyle |= TEXT_DRAW_RIGHT;
+ nTextStyle |= DrawTextFlags::Right;
else if ( nStyle & WB_CENTER )
- nTextStyle |= TEXT_DRAW_CENTER;
+ nTextStyle |= DrawTextFlags::Center;
else
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
// the vertical alignment
if ( nStyle & WB_BOTTOM )
- nTextStyle |= TEXT_DRAW_BOTTOM;
+ nTextStyle |= DrawTextFlags::Bottom;
else if ( nStyle & WB_VCENTER )
- nTextStyle |= TEXT_DRAW_VCENTER;
+ nTextStyle |= DrawTextFlags::VCenter;
else
- nTextStyle |= TEXT_DRAW_TOP;
+ nTextStyle |= DrawTextFlags::Top;
// mnemonics
if ( 0 == ( nStyle & WB_NOLABEL ) )
- nTextStyle |= TEXT_DRAW_MNEMONIC;
+ nTextStyle |= DrawTextFlags::Mnemonic;
// paint the ruby text
Rectangle aPrimaryTextLocation;
@@ -311,13 +311,12 @@ namespace svx
vcl::Font aSmallerFont( GetFont() );
aSmallerFont.SetHeight( static_cast<long>( 0.8 * aSmallerFont.GetHeight() ) );
Rectangle rect( Point(), Size( SAL_MAX_INT32, SAL_MAX_INT32 ) );
- sal_uInt16 style = GetStyle();
- Size aPrimarySize = GetTextRect( rect, m_aRubyText.getPrimaryText(), style ).GetSize();
+ Size aPrimarySize = GetTextRect( rect, m_aRubyText.getPrimaryText() ).GetSize();
Size aSecondarySize;
{
FontSwitch aFontRestore( const_cast<RubyRadioButton&>(*this), aSmallerFont );
- aSecondarySize = GetTextRect( rect, m_aRubyText.getSecondaryText(), style ).GetSize();
+ aSecondarySize = GetTextRect( rect, m_aRubyText.getSecondaryText() ).GetSize();
}
Size minimumSize = CalcMinimumSize();
@@ -352,7 +351,7 @@ namespace svx
sal_uInt16 nItemId = rUDEvt.GetItemId();
OUString sText = *static_cast< OUString* >( GetItemData( nItemId ) );
- pDev->DrawText( aRect, sText, TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER );
+ pDev->DrawText( aRect, sText, DrawTextFlags::Center | DrawTextFlags::VCenter );
}
void SuggestionSet::ClearSet()
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index b43338f693b0..9add30bc15b5 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -122,7 +122,7 @@ void SvxHlmarkTreeLBox::Paint(vcl::RenderContext& rRenderContext, const Rectangl
break;
}
- rRenderContext.DrawText(aDrawRect, aStrMessage, TEXT_DRAW_LEFT | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK);
+ rRenderContext.DrawText(aDrawRect, aStrMessage, DrawTextFlags::Left | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak);
}
}
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index b3a9c76c96b7..f1652f82d9eb 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -648,7 +648,7 @@ void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, sal_uLong nPos, bool
// So the first text column's width is Tab(2)-Tab(1).
long nWidthPixel = m_pTbLinks->GetLogicTab( 2 ) - m_pTbLinks->GetLogicTab( 1 );
nWidthPixel -= SV_TAB_BORDER;
- OUString aTxt = m_pTbLinks->GetEllipsisString( sFileNm, nWidthPixel, TEXT_DRAW_PATHELLIPSIS );
+ OUString aTxt = m_pTbLinks->GetEllipsisString( sFileNm, nWidthPixel, DrawTextFlags::PathEllipsis );
INetURLObject aPath( sFileNm, INetProtocol::File );
OUString aFileName = aPath.getName();
aFileName = INetURLObject::decode(aFileName, INetURLObject::DECODE_UNAMBIGUOUS);
diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx
index 5d62d4d44c67..a5093b3260a5 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -278,14 +278,14 @@ namespace offapp
{
rDev.SetClipRegion(vcl::Region(rRect));
- sal_uInt16 nStyle = TEXT_DRAW_CLIP;
+ DrawTextFlags nStyle = DrawTextFlags::Clip;
if (!IsEnabled())
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
switch (nColId)
{
- case 1: nStyle |= TEXT_DRAW_LEFT; break;
+ case 1: nStyle |= DrawTextFlags::Left; break;
case 2:
- case 3: nStyle |= TEXT_DRAW_CENTER; break;
+ case 3: nStyle |= DrawTextFlags::Center; break;
}
rDev.DrawText(rRect, implGetCellText(m_aSeekRow, nColId), nStyle);