summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
parent7a0af37989d1f1b508a61f28e785c5b1f27d58af (diff)
convert TEXT_DRAW constants to scoped enum
Change-Id: Ic0f7f8fa236bb478b3598ae3fd3c1b30ebbf1a01
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx2
-rw-r--r--svtools/source/contnr/imivctl.hxx2
-rw-r--r--svtools/source/contnr/imivctl1.cxx10
-rw-r--r--svtools/source/contnr/svlbitm.cxx4
-rw-r--r--svtools/source/control/headbar.cxx2
-rw-r--r--svtools/source/control/roadmap.cxx2
-rw-r--r--svtools/source/control/tabbar.cxx4
-rw-r--r--svtools/source/control/toolbarmenu.cxx6
-rw-r--r--svtools/source/table/gridtablerenderer.cxx28
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.cxx10
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.hxx2
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx2
12 files changed, 37 insertions, 37 deletions
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 0c07e7c7d665..016680358554 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -355,7 +355,7 @@ namespace svt
if (nBrowserFlags & EditBrowseBoxFlags::HANDLE_COLUMN_TEXT )
{
rDev.DrawText( rRect, GetCellText( nPaintRow, 0 ),
- TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER | TEXT_DRAW_CLIP );
+ DrawTextFlags::Center | DrawTextFlags::VCenter | DrawTextFlags::Clip );
}
// draw an image
else if (eStatus != CLEAN && rDev.GetOutDevType() == OUTDEV_WINDOW)
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx
index 9da5b13038b2..0980f0c0f6c6 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -190,7 +190,7 @@ class SvxIconChoiceCtrl_Impl
WinBits nWinBits;
long nMaxBoundHeight; // height of highest BoundRects
sal_uInt16 nFlags;
- sal_uInt16 nCurTextDrawFlags;
+ DrawTextFlags nCurTextDrawFlags;
ImplSVEvent * nUserEventAdjustScrBars;
ImplSVEvent * nUserEventShowCursor;
SvxIconChoiceCtrlEntry* pCurHighlightFrame;
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 1d951235b57c..5459f49ca873 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -43,10 +43,10 @@
#define IMPICNVIEW_ACC_ESCAPE 2
#define DRAWTEXT_FLAGS_ICON \
- ( TEXT_DRAW_CENTER | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | \
- TEXT_DRAW_CLIP | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK | TEXT_DRAW_MNEMONIC )
+ ( DrawTextFlags::Center | DrawTextFlags::Top | DrawTextFlags::EndEllipsis | \
+ DrawTextFlags::Clip | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak | DrawTextFlags::Mnemonic )
-#define DRAWTEXT_FLAGS_SMALLICON (TEXT_DRAW_LEFT|TEXT_DRAW_ENDELLIPSIS|TEXT_DRAW_CLIP)
+#define DRAWTEXT_FLAGS_SMALLICON (DrawTextFlags::Left|DrawTextFlags::EndEllipsis|DrawTextFlags::Clip)
#define EVENTID_SHOW_CURSOR (reinterpret_cast<void*>(1))
#define EVENTID_ADJUST_SCROLLBARS (reinterpret_cast<void*>(2))
@@ -3489,8 +3489,8 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
Rectangle aOptTextRect( aTextRect );
aOptTextRect.Bottom() = LONG_MAX;
- sal_uInt16 nNewFlags = nCurTextDrawFlags;
- nNewFlags &= ~( TEXT_DRAW_CLIP | TEXT_DRAW_ENDELLIPSIS );
+ DrawTextFlags nNewFlags = nCurTextDrawFlags;
+ nNewFlags &= ~DrawTextFlags( DrawTextFlags::Clip | DrawTextFlags::EndEllipsis );
aOptTextRect = pView->GetTextRect( aOptTextRect, aEntryText, nNewFlags );
if ( aOptTextRect != aTextRect || !sQuickHelpText.isEmpty() )
{
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 32990464d6ac..371b407c9d61 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -198,9 +198,9 @@ void SvLBoxString::Paint(
{
if (pEntry)
{
- sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE;
+ DrawTextFlags nStyle = rDev.IsEnabled() ? DrawTextFlags::NONE : DrawTextFlags::Disable;
if (rDev.IsEntryMnemonicsEnabled())
- nStyle |= TEXT_DRAW_MNEMONIC;
+ nStyle |= DrawTextFlags::Mnemonic;
rRenderContext.DrawText(Rectangle(rPos, GetSize(&rDev, pEntry)), maText, nStyle);
}
else
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index 0c75a877060d..3207e998dc29 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -480,7 +480,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
if (IsEnabled())
rRenderContext.DrawText(Point(nTxtPos, nTxtPosY), pItem->maOutText);
else
- rRenderContext.DrawCtrlText(Point(nTxtPos, nTxtPosY), pItem->maOutText, 0, pItem->maOutText.getLength(), TEXT_DRAW_DISABLE);
+ rRenderContext.DrawCtrlText(Point(nTxtPos, nTxtPosY), pItem->maOutText, 0, pItem->maOutText.getLength(), DrawTextFlags::Disable);
if (aSelectionTextColor != Color(COL_TRANSPARENT))
rRenderContext.Pop();
}
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx
index 742cae6142ca..b327ebac5b8a 100644
--- a/svtools/source/control/roadmap.cxx
+++ b/svtools/source/control/roadmap.cxx
@@ -589,7 +589,7 @@ void ORoadmap::DrawHeadline(vcl::RenderContext& rRenderContext)
// draw it
rRenderContext.DrawText(Rectangle(aTextPos, aOutputSize), GetText(),
- TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK);
+ DrawTextFlags::Left | DrawTextFlags::Top | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak);
rRenderContext.DrawTextLine(aTextPos, aOutputSize.Width(), STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, false);
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
rRenderContext.SetLineColor(rStyleSettings.GetFieldTextColor());
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index d440854b205a..ef1cb2887005 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -132,7 +132,7 @@ public:
if (mbEnabled)
mrRenderContext.DrawText(aPos, aText);
else
- mrRenderContext.DrawCtrlText(aPos, aText, 0, aText.getLength(), (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC));
+ mrRenderContext.DrawCtrlText(aPos, aText, 0, aText.getLength(), (DrawTextFlags::Disable | DrawTextFlags::Mnemonic));
}
void drawOverTopBorder()
@@ -1251,7 +1251,7 @@ void TabBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rect)
bool bCustomBgColor = !pItem->IsDefaultTabBgColor() && !rStyleSettings.GetHighContrastMode();
bool bSpecialTab = (pItem->mnBits & TPB_SPECIAL);
bool bEnabled = pItem->mbEnable;
- OUString aText = pItem->mbShort ? rRenderContext.GetEllipsisString(pItem->maText, mnCurMaxWidth, TEXT_DRAW_ENDELLIPSIS) : pItem->maText;
+ OUString aText = pItem->mbShort ? rRenderContext.GetEllipsisString(pItem->maText, mnCurMaxWidth, DrawTextFlags::EndEllipsis) : pItem->maText;
aDrawer.setRect(aRect);
aDrawer.setSelected(bSelected);
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index bb9d1a3325ee..8490cadd4680 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -1329,13 +1329,13 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry
{
long nTextOffsetY = ((pEntry->maSize.Height() - nFontHeight) / 2);
- sal_uInt16 nTextStyle = 0;
+ DrawTextFlags nTextStyle = DrawTextFlags::NONE;
DrawSymbolFlags nSymbolStyle = DrawSymbolFlags::NONE;
sal_uInt16 nImageStyle = 0;
if (!pEntry->mbEnabled)
{
- nTextStyle |= TEXT_DRAW_DISABLE;
+ nTextStyle |= DrawTextFlags::Disable;
nSymbolStyle |= DrawSymbolFlags::Disable;
nImageStyle |= IMAGE_DRAW_DISABLE;
}
@@ -1442,7 +1442,7 @@ void ToolbarMenu::implPaint(vcl::RenderContext& rRenderContext, ToolbarMenuEntry
aTmpPos.X() = aPos.X() + (bTitle ? 4 : mpImpl->mnTextPos);
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
- sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC;
+ DrawTextFlags nStyle = nTextStyle|DrawTextFlags::Mnemonic;
rRenderContext.DrawCtrlText(aTmpPos, pEntry->maText, 0, pEntry->maText.getLength(), nStyle, NULL, NULL);
}
diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx
index ee7600a5f85a..07d721f5855f 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -143,26 +143,26 @@ namespace svt { namespace table
return aTextArea;
}
- static sal_uLong lcl_getAlignmentTextDrawFlags( GridTableRenderer_Impl const & i_impl, ColPos const i_columnPos )
+ static DrawTextFlags lcl_getAlignmentTextDrawFlags( GridTableRenderer_Impl const & i_impl, ColPos const i_columnPos )
{
- sal_uLong nVertFlag = TEXT_DRAW_TOP;
+ DrawTextFlags nVertFlag = DrawTextFlags::Top;
VerticalAlignment const eVertAlign = i_impl.rModel.getVerticalAlign();
switch ( eVertAlign )
{
- case VerticalAlignment_MIDDLE: nVertFlag = TEXT_DRAW_VCENTER; break;
- case VerticalAlignment_BOTTOM: nVertFlag = TEXT_DRAW_BOTTOM; break;
+ case VerticalAlignment_MIDDLE: nVertFlag = DrawTextFlags::VCenter; break;
+ case VerticalAlignment_BOTTOM: nVertFlag = DrawTextFlags::Bottom; break;
default:
break;
}
- sal_uLong nHorzFlag = TEXT_DRAW_LEFT;
+ DrawTextFlags nHorzFlag = DrawTextFlags::Left;
HorizontalAlignment const eHorzAlign = i_impl.rModel.getColumnCount() > 0
? i_impl.rModel.getColumnModel( i_columnPos )->getHorizontalAlign()
: HorizontalAlignment_CENTER;
switch ( eHorzAlign )
{
- case HorizontalAlignment_CENTER: nHorzFlag = TEXT_DRAW_CENTER; break;
- case HorizontalAlignment_RIGHT: nHorzFlag = TEXT_DRAW_RIGHT; break;
+ case HorizontalAlignment_CENTER: nHorzFlag = DrawTextFlags::Center; break;
+ case HorizontalAlignment_RIGHT: nHorzFlag = DrawTextFlags::Right; break;
default:
break;
}
@@ -254,9 +254,9 @@ namespace svt { namespace table
rRenderContext.SetTextColor(textColor);
Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
- sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, _nCol ) | TEXT_DRAW_CLIP;
+ DrawTextFlags nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, _nCol ) | DrawTextFlags::Clip;
if (!m_pImpl->rModel.isEnabled())
- nDrawTextFlags |= TEXT_DRAW_DISABLE;
+ nDrawTextFlags |= DrawTextFlags::Disable;
rRenderContext.DrawText( aTextRect, sHeaderText, nDrawTextFlags );
boost::optional<Color> const aLineColor( m_pImpl->rModel.getLineColor() );
@@ -279,7 +279,7 @@ namespace svt { namespace table
long const nSortIndicatorPaddingX = 2;
long const nSortIndicatorPaddingY = ( nHeaderHeight - aBitmapSize.Height() ) / 2;
- if ( ( nDrawTextFlags & TEXT_DRAW_RIGHT ) != 0 )
+ if ( nDrawTextFlags & DrawTextFlags::Right )
{
// text is right aligned => draw the sort indicator at the left hand side
rRenderContext.DrawBitmapEx(Point(_rArea.Left() + nSortIndicatorPaddingX, _rArea.Top() + nSortIndicatorPaddingY),
@@ -388,9 +388,9 @@ namespace svt { namespace table
rRenderContext.SetTextColor(textColor);
Rectangle const aTextRect(lcl_getTextRenderingArea(lcl_getContentArea(*m_pImpl, _rArea)));
- sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags(*m_pImpl, 0) | TEXT_DRAW_CLIP;
+ DrawTextFlags nDrawTextFlags = lcl_getAlignmentTextDrawFlags(*m_pImpl, 0) | DrawTextFlags::Clip;
if (!m_pImpl->rModel.isEnabled())
- nDrawTextFlags |= TEXT_DRAW_DISABLE;
+ nDrawTextFlags |= DrawTextFlags::Disable;
// TODO: is using the horizontal alignment of the 0'th column a good idea here? This is pretty ... arbitray ..
rRenderContext.DrawText(aTextRect, rowTitle, nDrawTextFlags);
}
@@ -538,9 +538,9 @@ namespace svt { namespace table
}
Rectangle const textRect( lcl_getTextRenderingArea( i_context.aContentArea ) );
- sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, i_context.nColumn ) | TEXT_DRAW_CLIP;
+ DrawTextFlags nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, i_context.nColumn ) | DrawTextFlags::Clip;
if ( !m_pImpl->rModel.isEnabled() )
- nDrawTextFlags |= TEXT_DRAW_DISABLE;
+ nDrawTextFlags |= DrawTextFlags::Disable;
i_context.rDevice.DrawText( textRect, i_text, nDrawTextFlags );
}
diff --git a/svtools/source/toolpanel/toolpaneldrawer.cxx b/svtools/source/toolpanel/toolpaneldrawer.cxx
index 0ce9851ea5e7..85ce017612d8 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.cxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.cxx
@@ -159,16 +159,16 @@ namespace svt
}
- sal_uInt16 ToolPanelDrawer::impl_getTextStyle() const
+ DrawTextFlags ToolPanelDrawer::impl_getTextStyle() const
{
- const sal_uInt16 nBasicStyle = TEXT_DRAW_LEFT
- | TEXT_DRAW_TOP
- | TEXT_DRAW_WORDBREAK;
+ const DrawTextFlags nBasicStyle = DrawTextFlags::Left
+ | DrawTextFlags::Top
+ | DrawTextFlags::WordBreak;
if ( IsEnabled() )
return nBasicStyle;
- return nBasicStyle | TEXT_DRAW_DISABLE;
+ return nBasicStyle | DrawTextFlags::Disable;
}
diff --git a/svtools/source/toolpanel/toolpaneldrawer.hxx b/svtools/source/toolpanel/toolpaneldrawer.hxx
index 403b296c9957..8bef3a3f24b6 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.hxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.hxx
@@ -83,7 +83,7 @@ namespace svt
Rectangle impl_calcTextBoundingBox() const;
Rectangle impl_calcTitleBarBox( const Rectangle& i_rTextBox ) const;
void impl_paintBackground( const Rectangle& i_rTitleBarBox );
- sal_uInt16 impl_getTextStyle() const;
+ DrawTextFlags impl_getTextStyle() const;
void impl_paintFocusIndicator( const Rectangle& i_rTextBox );
Rectangle impl_paintExpansionIndicator( const Rectangle& i_rTextBox );
Image impl_getExpansionIndicator() const;
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index d76c05e45920..850c6fadfeb9 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -1606,7 +1606,7 @@ void UnoTreeListItem::Paint(
aPos.X() += nWidth;
aSize.Width() -= nWidth;
}
- rRenderContext.DrawText(Rectangle(aPos,aSize),maText, rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE);
+ rRenderContext.DrawText(Rectangle(aPos,aSize),maText, rDev.IsEnabled() ? DrawTextFlags::NONE : DrawTextFlags::Disable);
}
else
{