summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/moduldl2.cxx2
-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
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx4
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnection.cxx4
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx4
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx2
-rw-r--r--extensions/source/propctrlr/inspectorhelpwindow.cxx2
-rw-r--r--extensions/source/update/ui/updatecheckui.cxx8
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx2
-rw-r--r--include/drawinglayer/primitive2d/textlayoutdevice.hxx4
-rw-r--r--include/vcl/button.hxx6
-rw-r--r--include/vcl/ctrl.hxx2
-rw-r--r--include/vcl/fixed.hxx2
-rw-r--r--include/vcl/metaact.hxx9
-rw-r--r--include/vcl/outdev.hxx67
-rw-r--r--include/vcl/pdfwriter.hxx19
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx2
-rw-r--r--sc/source/ui/sidebar/CellLineStyleValueSet.cxx2
-rw-r--r--sd/source/filter/html/htmlattr.cxx8
-rw-r--r--sd/source/ui/animations/CustomAnimationCreateDialog.cxx2
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx2
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx2
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx10
-rw-r--r--sfx2/source/dialog/titledockwin.cxx2
-rw-r--r--sfx2/source/doc/doctemplates.cxx8
-rw-r--r--sfx2/source/sidebar/TitleBar.cxx4
-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
-rw-r--r--svx/source/dialog/dialcontrol.cxx2
-rw-r--r--svx/source/fmcomp/gridcell.cxx34
-rw-r--r--svx/source/sidebar/line/LineWidthValueSet.cxx4
-rw-r--r--svx/source/sidebar/tools/ValueSetWithTextControl.cxx6
-rw-r--r--sw/source/core/layout/paintfrm.cxx6
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx6
-rw-r--r--sw/source/ui/index/cnttab.cxx2
-rw-r--r--sw/source/uibase/docvw/AnnotationMenuButton.cxx2
-rw-r--r--sw/source/uibase/docvw/edtwin2.cxx2
-rw-r--r--toolkit/source/helper/formpdfexport.cxx22
-rw-r--r--vcl/inc/ilstbox.hxx2
-rw-r--r--vcl/inc/textlayout.hxx2
-rw-r--r--vcl/source/app/help.cxx12
-rw-r--r--vcl/source/control/button.cxx58
-rw-r--r--vcl/source/control/combobox.cxx8
-rw-r--r--vcl/source/control/ctrl.cxx2
-rw-r--r--vcl/source/control/fixed.cxx52
-rw-r--r--vcl/source/control/group.cxx12
-rw-r--r--vcl/source/control/ilstbox.cxx30
-rw-r--r--vcl/source/control/imgctrl.cxx4
-rw-r--r--vcl/source/control/lstbox.cxx8
-rw-r--r--vcl/source/control/tabctrl.cxx4
-rw-r--r--vcl/source/gdi/metaact.cxx10
-rw-r--r--vcl/source/gdi/pdfwriter.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx84
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx6
-rw-r--r--vcl/source/gdi/textlayout.cxx6
-rw-r--r--vcl/source/outdev/text.cxx112
-rw-r--r--vcl/source/window/brdwin.cxx2
-rw-r--r--vcl/source/window/menu.cxx12
-rw-r--r--vcl/source/window/msgbox.cxx4
-rw-r--r--vcl/source/window/printdlg.cxx4
-rw-r--r--vcl/source/window/status.cxx4
-rw-r--r--vcl/source/window/toolbox.cxx6
-rw-r--r--vcl/workben/svptest.cxx2
-rw-r--r--vcl/workben/vcldemo.cxx4
82 files changed, 433 insertions, 423 deletions
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index b8f68eed3495..68499f3ca18a 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -133,7 +133,7 @@ void LibLBoxString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::Rende
|| (xDlgLibContainer.is() && xDlgLibContainer->hasByName(aLibName) && xDlgLibContainer->isLibraryReadOnly(aLibName));
}
if (bReadOnly)
- rRenderContext.DrawCtrlText(rPos, GetText(), 0, -1, TEXT_DRAW_DISABLE);
+ rRenderContext.DrawCtrlText(rPos, GetText(), 0, -1, DrawTextFlags::Disable);
else
rRenderContext.DrawText(rPos, GetText());
}
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);
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index aa4f5034e90e..7dcf64813ef4 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -500,7 +500,7 @@ void OSQLMessageBox::impl_positionControls()
// determine which space the secondary text would occupy
if ( bHaveSecondaryText )
- aSecondaryRect = GetTextRect( aSecondaryRect, sSecondary, TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE | TEXT_DRAW_LEFT );
+ aSecondaryRect = GetTextRect( aSecondaryRect, sSecondary, DrawTextFlags::WordBreak | DrawTextFlags::MultiLine | DrawTextFlags::Left );
else
aSecondaryRect.Bottom() = aSecondaryRect.Top() - 1;
@@ -511,7 +511,7 @@ void OSQLMessageBox::impl_positionControls()
// if there's no secondary text ...
if ( !bHaveSecondaryText )
{ // then give the primary text as much horizontal space as it needs
- Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sPrimary, TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE | TEXT_DRAW_CENTER ) );
+ Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sPrimary, DrawTextFlags::WordBreak | DrawTextFlags::MultiLine | DrawTextFlags::Center ) );
aPrimaryRect.Right() = aPrimaryRect.Left() + aSuggestedRect.GetWidth();
aPrimaryRect.Bottom() = aPrimaryRect.Top() + aSuggestedRect.GetHeight();
// and center it horizontally
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 3bf8774b764f..74006eac0a29 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1226,7 +1226,7 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect,
if (nRow == BROW_VIS_ROW)
PaintTristate(rDev, rRect, pEntry->IsVisible() ? TRISTATE_TRUE : TRISTATE_FALSE);
else
- rDev.DrawText(rRect, GetCellText(nRow, nColumnId),TEXT_DRAW_VCENTER);
+ rDev.DrawText(rRect, GetCellText(nRow, nColumnId),DrawTextFlags::VCenter);
rDev.SetClipRegion( );
}
@@ -1240,7 +1240,7 @@ void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const Rectangle& r
// from BROW_CRIT2_ROW onwards all rows are shown "or"
sal_Int32 nToken = (m_nSeekRow >= GetBrowseRow(BROW_CRIT2_ROW))
? BROW_CRIT2_ROW : GetRealRow(m_nSeekRow);
- rDev.DrawText(aRect, aLabel.getToken(nToken, ';'),TEXT_DRAW_VCENTER);
+ rDev.DrawText(aRect, aLabel.getToken(nToken, ';'),DrawTextFlags::VCenter);
}
void OSelectionBrowseBox::RemoveColumn(sal_uInt16 _nColumnId)
diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
index b4f05c24fbd1..35cc2e16d8f7 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
@@ -112,8 +112,8 @@ void ORelationTableConnection::Draw(vcl::RenderContext& rRenderContext, const Re
else
rRenderContext.SetTextColor(Application::GetSettings().GetStyleSettings().GetWindowTextColor());
- rRenderContext.DrawText(aSourcePos, aSourceText, TEXT_DRAW_CLIP | TEXT_DRAW_CENTER | TEXT_DRAW_BOTTOM);
- rRenderContext.DrawText(aDestPos, aDestText, TEXT_DRAW_CLIP | TEXT_DRAW_CENTER | TEXT_DRAW_BOTTOM);
+ rRenderContext.DrawText(aSourcePos, aSourceText, DrawTextFlags::Clip | DrawTextFlags::Center | DrawTextFlags::Bottom);
+ rRenderContext.DrawText(aDestPos, aDestText, DrawTextFlags::Clip | DrawTextFlags::Center | DrawTextFlags::Bottom);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 9074ac93d45e..cc134b2872cc 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -309,7 +309,7 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const Rectangle& rRect,
rDev.Push( PushFlags::CLIPREGION );
rDev.SetClipRegion(vcl::Region(rRect));
- rDev.DrawText( rRect, aText, TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER );
+ rDev.DrawText( rRect, aText, DrawTextFlags::Left | DrawTextFlags::VCenter );
rDev.Pop();
}
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index e1cf1da17e4f..3989e2d8ae3a 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -390,7 +390,7 @@ void ExtensionBox_Impl::CalcActiveHeight( const long nPos )
aText += m_vEntries[ nPos ]->m_sDescription;
Rectangle aRect = GetTextRect( Rectangle( Point(), aSize ), aText,
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
aTextHeight += aRect.GetHeight();
if ( aTextHeight < m_nStdHeight )
@@ -613,7 +613,7 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const Rectan
nExtraHeight = m_nExtraHeight;
rRenderContext.DrawText(Rectangle(aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - nExtraHeight),
- sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ sDescription, DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
}
else
{
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index a9dfdb6a75bc..2eefc3fe55c8 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -327,7 +327,7 @@ namespace drawinglayer
void TextLayouterDevice::addTextRectActions(
const Rectangle& rRectangle,
const OUString& rText,
- sal_uInt16 nStyle,
+ DrawTextFlags nStyle,
GDIMetaFile& rGDIMetaFile) const
{
mrDevice.AddTextRectActions(
diff --git a/extensions/source/propctrlr/inspectorhelpwindow.cxx b/extensions/source/propctrlr/inspectorhelpwindow.cxx
index b174b69bd6c2..c0090fa582bd 100644
--- a/extensions/source/propctrlr/inspectorhelpwindow.cxx
+++ b/extensions/source/propctrlr/inspectorhelpwindow.cxx
@@ -113,7 +113,7 @@ namespace pcr
Rectangle aTextRect( Point( 0, 0 ), m_aHelpText->GetOutputSizePixel() );
aTextRect = m_aHelpText->GetTextRect( aTextRect, m_aHelpText->GetText(),
- TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ DrawTextFlags::Left | DrawTextFlags::Top | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
long nActTextWindowHeight = impl_getHelpTextBorderHeight() + aTextRect.GetHeight();
long nOptTextWindowHeight = ::std::max( nMinTextWindowHeight, ::std::min( nMaxTextWindowHeight, nActTextWindowHeight ) );
diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx
index 4a9fbe9bb640..10ef520420ca 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -847,12 +847,12 @@ void BubbleWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle
SetFont( aBoldFont );
Rectangle aTitleRect = maTitleRect;
aTitleRect.Move( aImgSize.Width(), 0 );
- DrawText( aTitleRect, maBubbleTitle, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ DrawText( aTitleRect, maBubbleTitle, DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
SetFont( aOldFont );
Rectangle aTextRect = maTextRect;
aTextRect.Move( aImgSize.Width(), 0 );
- DrawText( aTextRect, maBubbleText, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ DrawText( aTextRect, maBubbleText, DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
}
@@ -926,12 +926,12 @@ void BubbleWindow::RecalcTextRects()
maTitleRect = GetTextRect( Rectangle( Point( 0, 0 ), maMaxTextSize ),
maBubbleTitle,
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
SetFont( aOldFont );
maTextRect = GetTextRect( Rectangle( Point( 0, 0 ), maMaxTextSize ),
maBubbleText,
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
if ( maTextRect.GetHeight() < 10 )
maTextRect.setHeight( 10 );
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index 668311ff1e08..730dd8076d49 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -509,7 +509,7 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
aString += " LanguageLevel:" + OUString::number( nNumber );
}
}
- pVDev->DrawText( aRect, aString, TEXT_DRAW_CLIP | TEXT_DRAW_MULTILINE );
+ pVDev->DrawText( aRect, aString, DrawTextFlags::Clip | DrawTextFlags::MultiLine );
pVDev->Pop();
aMtf.Stop();
aMtf.WindStart();
diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
index 024e7b45d950..de23883b8494 100644
--- a/include/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -36,7 +36,7 @@ namespace rtl {
};
class OutputDevice;
class GDIMetaFile;
-
+enum class DrawTextFlags;
namespace drawinglayer { namespace attribute {
class FontAttribute;
}}
@@ -102,7 +102,7 @@ namespace drawinglayer
void addTextRectActions(
const Rectangle& rRectangle,
const rtl::OUString& rText,
- sal_uInt16 nStyle,
+ DrawTextFlags nStyle,
GDIMetaFile& rGDIMetaFile) const;
::std::vector< double > getTextArray(
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index f8bfddfecc7f..6c79094ee6ef 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -49,10 +49,10 @@ private:
public:
SAL_DLLPRIVATE DrawButtonFlags ImplGetButtonState() const;
SAL_DLLPRIVATE DrawButtonFlags& ImplGetButtonState();
- SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( OUString& rText, WinBits nWinStyle, sal_uLong nDrawFlags );
+ SAL_DLLPRIVATE DrawTextFlags ImplGetTextStyle( OUString& rText, WinBits nWinStyle, sal_uLong nDrawFlags );
SAL_DLLPRIVATE void ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Size& rSize,
bool bLayout, sal_uLong nImageSep, sal_uLong nDrawFlags,
- sal_uInt16 nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
+ DrawTextFlags nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
SAL_DLLPRIVATE void ImplSetFocusRect( const Rectangle &rFocusRect );
SAL_DLLPRIVATE const Rectangle& ImplGetFocusRect() const;
SAL_DLLPRIVATE void ImplSetSymbolAlign( SymbolAlign eAlign );
@@ -130,7 +130,7 @@ protected:
const Rectangle& rRect, bool bLayout, bool bMenuBtnSep);
SAL_DLLPRIVATE void ImplDrawPushButton(vcl::RenderContext& rRenderContext, bool bLayout = false);
using Button::ImplGetTextStyle;
- SAL_DLLPRIVATE sal_uInt16 ImplGetTextStyle( sal_uLong nDrawFlags ) const;
+ SAL_DLLPRIVATE DrawTextFlags ImplGetTextStyle( sal_uLong nDrawFlags ) const;
SAL_DLLPRIVATE bool IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); }
SAL_DLLPRIVATE bool IsImage() const { return Button::HasImage(); }
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index ee5b8845efc6..6741a229dd4d 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -88,7 +88,7 @@ protected:
directly at the target device, or taking the reference device into account) when returning.
*/
void DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect,
- const OUString& _rStr, sal_uInt16 _nStyle,
+ const OUString& _rStr, DrawTextFlags _nStyle,
MetricVector* _pVector, OUString* _pDisplayText ) const;
virtual const vcl::Font&
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
index 3f9e13485028..15e838bdd4f7 100644
--- a/include/vcl/fixed.hxx
+++ b/include/vcl/fixed.hxx
@@ -48,7 +48,7 @@ private:
SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize, bool bFillLayout = false ) const;
public:
- SAL_DLLPRIVATE static sal_uInt16 ImplGetTextStyle( WinBits nWinBits );
+ SAL_DLLPRIVATE static DrawTextFlags ImplGetTextStyle( WinBits nWinBits );
protected:
virtual void FillLayoutData() const SAL_OVERRIDE;
virtual const vcl::Font&
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 9885498c3075..18e73033b7b3 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -38,6 +38,7 @@
#include <vcl/outdevstate.hxx>
class SvStream;
+enum class DrawTextFlags;
struct ImplMetaReadData
{
@@ -546,7 +547,7 @@ private:
Rectangle maRect;
OUString maStr;
- sal_uInt16 mnStyle;
+ DrawTextFlags mnStyle;
virtual bool Compare( const MetaAction& ) const SAL_OVERRIDE;
@@ -561,14 +562,14 @@ public:
virtual void Read( SvStream& rIStm, ImplMetaReadData* pData ) SAL_OVERRIDE;
MetaTextRectAction( const Rectangle& rRect,
- const OUString& rStr, sal_uInt16 nStyle );
+ const OUString& rStr, DrawTextFlags nStyle );
virtual void Move( long nHorzMove, long nVertMove ) SAL_OVERRIDE;
virtual void Scale( double fScaleX, double fScaleY ) SAL_OVERRIDE;
const Rectangle& GetRect() const { return maRect; }
- const OUString& GetText() const { return maStr; }
- sal_uInt16 GetStyle() const { return mnStyle; }
+ const OUString& GetText() const { return maStr; }
+ DrawTextFlags GetStyle() const { return mnStyle; }
};
class VCL_DLLPUBLIC MetaTextLineAction : public MetaAction
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index da18ee8993f9..728ce4278ee5 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -158,26 +158,33 @@ typedef std::vector< Rectangle > MetricVector;
// OutputDevice-Types
// Flags for DrawText()
-#define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001)
-#define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0002)
-#define TEXT_DRAW_MONO ((sal_uInt16)0x0004)
-#define TEXT_DRAW_CLIP ((sal_uInt16)0x0008)
-#define TEXT_DRAW_LEFT ((sal_uInt16)0x0010)
-#define TEXT_DRAW_CENTER ((sal_uInt16)0x0020)
-#define TEXT_DRAW_RIGHT ((sal_uInt16)0x0040)
-#define TEXT_DRAW_TOP ((sal_uInt16)0x0080)
-#define TEXT_DRAW_VCENTER ((sal_uInt16)0x0100)
-#define TEXT_DRAW_BOTTOM ((sal_uInt16)0x0200)
-#define TEXT_DRAW_ENDELLIPSIS ((sal_uInt16)0x0400)
-#define TEXT_DRAW_PATHELLIPSIS ((sal_uInt16)0x0800)
-#define TEXT_DRAW_MULTILINE ((sal_uInt16)0x1000)
-#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x2000)
-#define TEXT_DRAW_NEWSELLIPSIS ((sal_uInt16)0x4000)
-// in the long run we should make text style flags longer
-// but at the moment we can get away with this 2 bit field for ellipsis style
-#define TEXT_DRAW_CENTERELLIPSIS (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS)
-
-#define TEXT_DRAW_WORDBREAK_HYPHENATION (((sal_uInt16)0x8000) | TEXT_DRAW_WORDBREAK)
+enum class DrawTextFlags
+{
+ NONE = 0x0000,
+ Disable = 0x0001,
+ Mnemonic = 0x0002,
+ Mono = 0x0004,
+ Clip = 0x0008,
+ Left = 0x0010,
+ Center = 0x0020,
+ Right = 0x0040,
+ Top = 0x0080,
+ VCenter = 0x0100,
+ Bottom = 0x0200,
+ EndEllipsis = 0x0400,
+ PathEllipsis = 0x0800,
+ MultiLine = 0x1000,
+ WordBreak = 0x2000,
+ NewsEllipsis = 0x4000,
+ // in the long run we should make text style flags longer
+ // but at the moment we can get away with this 2 bit field for ellipsis style
+ CenterEllipsis = EndEllipsis | PathEllipsis,
+ WordBreakHyphenation = 0x8000 | WordBreak,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<DrawTextFlags> : is_typed_flags<DrawTextFlags, 0xffff> {};
+}
// Flags for CopyArea()
#define COPYAREA_WINDOWINVALIDATE ((sal_uInt16)0x0001)
@@ -945,12 +952,12 @@ public:
MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
void DrawText( const Rectangle& rRect,
- const OUString& rStr, sal_uInt16 nStyle = 0,
+ const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::NONE,
MetricVector* pVector = NULL, OUString* pDisplayText = NULL,
vcl::ITextLayout* _pTextLayout = NULL );
static void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
- const OUString& rOrigStr, sal_uInt16 nStyle,
+ const OUString& rOrigStr, DrawTextFlags nStyle,
MetricVector* pVector, OUString* pDisplayText, vcl::ITextLayout& _rLayout );
void ImplDrawText( SalLayout& );
@@ -959,7 +966,7 @@ public:
void DrawCtrlText( const Point& rPos, const OUString& rStr,
sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
+ DrawTextFlags nStyle = DrawTextFlags::Mnemonic, MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
void DrawTextLine( const Point& rPos, long nWidth,
FontStrikeout eStrikeout,
@@ -979,7 +986,7 @@ public:
bool ImplDrawRotateText( SalLayout& );
Rectangle GetTextRect( const Rectangle& rRect,
- const OUString& rStr, sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
+ const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::WordBreak,
TextRectInfo* pInfo = NULL,
const vcl::ITextLayout* _pTextLayout = NULL ) const;
@@ -1055,11 +1062,11 @@ public:
OUString GetEllipsisString( const OUString& rStr, long nMaxWidth,
- sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
+ DrawTextFlags nStyle = DrawTextFlags::EndEllipsis ) const;
long GetCtrlTextWidth( const OUString& rStr, sal_Int32 nIndex = 0,
sal_Int32 nLen = -1,
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC ) const;
+ DrawTextFlags nStyle = DrawTextFlags::Mnemonic ) const;
static OUString GetNonMnemonicString( const OUString& rStr, sal_Int32& rMnemonicPos );
@@ -1075,8 +1082,8 @@ public:
DrawText().
*/
void AddTextRectActions( const Rectangle& rRect,
- const OUString& rOrigStr,
- sal_uInt16 nStyle,
+ const OUString& rOrigStr,
+ DrawTextFlags nStyle,
GDIMetaFile& rMtf );
void SetTextColor( const Color& rColor );
@@ -1164,7 +1171,7 @@ private:
SAL_DLLPRIVATE static bool ImplIsUnderlineAbove( const vcl::Font& );
static
- SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const OUString& rStr, sal_uInt16 nStyle, const vcl::ITextLayout& _rLayout );
+ SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const OUString& rStr, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout );
///@}
@@ -1265,7 +1272,7 @@ private:
static
SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const OUString& rStr,
- long nMaxWidth, sal_uInt16 nStyle, const vcl::ITextLayout& _rLayout );
+ long nMaxWidth, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout );
SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const tools::PolyPolygon& rPolyPoly, bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 );
SAL_DLLPRIVATE void ImplDrawEmphasisMarks( SalLayout& );
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index d8c64c483963..05679575d125 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -29,6 +29,7 @@
#include <vcl/font.hxx>
#include <vcl/graphictools.hxx>
#include <vcl/outdevstate.hxx>
+#include <vcl/outdev.hxx>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
@@ -225,10 +226,10 @@ public:
protected:
WidgetType Type; // primitive RTTI
public:
- OUString Name; // a distinct name to identify the control
- OUString Description;// descriptive text for the contro (e.g. for tool tip)
- OUString Text; // user text to appear on the control
- sal_uInt16 TextStyle; // style flags
+ OUString Name; // a distinct name to identify the control
+ OUString Description;// descriptive text for the contro (e.g. for tool tip)
+ OUString Text; // user text to appear on the control
+ DrawTextFlags TextStyle; // style flags
bool ReadOnly;
Rectangle Location; // describes the area filled by the control
bool Border; // true: widget should have a border, false: no border
@@ -242,9 +243,9 @@ public:
/* style flags for text are those for OutputDevice::DrawText
allowed values are:
- TEXT_DRAW_LEFT, TEXT_DRAW_CENTER, TEXT_DRAW_RIGHT, TEXT_DRAW_TOP,
- TEXT_DRAW_VCENTER, TEXT_DRAW_BOTTOM,
- TEXT_DRAW_MULTILINE, TEXT_DRAW_WORDBREAK
+ DrawTextFlags::Left, DrawTextFlags::Center, DrawTextFlags::Right, DrawTextFlags::Top,
+ DrawTextFlags::VCenter, DrawTextFlags::Bottom,
+ DrawTextFlags::MultiLine, DrawTextFlags::WordBreak
if TextStyle is 0, then each control will fill in default values
*/
@@ -257,7 +258,7 @@ public:
AnyWidget( WidgetType eType ) :
Type( eType ),
- TextStyle( 0 ),
+ TextStyle( DrawTextFlags::NONE ),
ReadOnly( false ),
Border( false ),
BorderColor( COL_TRANSPARENT ),
@@ -779,7 +780,7 @@ The following structure describes the permissions used in PDF security
const OUString& rStr,
sal_Int32 nIndex, sal_Int32 nLen );
void DrawText( const Rectangle& rRect,
- const OUString& rStr, sal_uInt16 nStyle = 0 );
+ const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::NONE );
void DrawPixel( const Point& rPt, const Color& rColor );
void DrawPixel( const Point& rPt )
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 67be6fe68829..470a0b8f5782 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -362,7 +362,7 @@ void ScMenuFloatingWindow::drawMenuItem(vcl::RenderContext& rRenderContext, size
long nYOffset = (aSize.Height() - maLabelFont.GetHeight())/2;
rRenderContext. DrawCtrlText(Point(aPos.X()+nXOffset, aPos.Y() + nYOffset), maMenuItems[nPos].maText, 0,
maMenuItems[nPos].maText.getLength(),
- maMenuItems[nPos].mbEnabled ? TEXT_DRAW_MNEMONIC : TEXT_DRAW_DISABLE);
+ maMenuItems[nPos].mbEnabled ? DrawTextFlags::Mnemonic : DrawTextFlags::Disable);
if (maMenuItems[nPos].mpSubMenuWin)
{
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
index c3fdeb5986f5..81a33e9b44c9 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
@@ -111,7 +111,7 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
pDev->SetFont(aFont);
Point aStart(aBLPos.X() + nRectWidth * 7 / 9 - 5 , aBLPos.Y() + nRectHeight/6);
- pDev->DrawText(aStart, maStrUnit[nItemId - 1]); //can't set TEXT_DRAW_ENDELLIPSIS here, or the text will disappear
+ pDev->DrawText(aStart, maStrUnit[nItemId - 1]); //can't set DrawTextFlags::EndEllipsis here, or the text will disappear
//draw line
if( nSelItem == nItemId )
diff --git a/sd/source/filter/html/htmlattr.cxx b/sd/source/filter/html/htmlattr.cxx
index 4a7732f88315..fe709ff7bea4 100644
--- a/sd/source/filter/html/htmlattr.cxx
+++ b/sd/source/filter/html/htmlattr.cxx
@@ -58,19 +58,19 @@ void SdHtmlAttrPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangl
aTextRect.Bottom() = nHeight + aTextRect.Top();
rRenderContext.SetTextColor(m_aTextColor);
- rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_TEXT), TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER);
+ rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_TEXT), DrawTextFlags::Center | DrawTextFlags::VCenter);
aTextRect.Move(0,nHeight);
rRenderContext.SetTextColor(m_aLinkColor);
- rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_LINK), TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER);
+ rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_LINK), DrawTextFlags::Center | DrawTextFlags::VCenter);
aTextRect.Move(0,nHeight);
rRenderContext.SetTextColor(m_aALinkColor);
- rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_ALINK), TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER);
+ rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_ALINK), DrawTextFlags::Center | DrawTextFlags::VCenter);
aTextRect.Move(0,nHeight);
rRenderContext.SetTextColor(m_aVLinkColor);
- rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_VLINK), TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER);
+ rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_VLINK), DrawTextFlags::Center | DrawTextFlags::VCenter);
}
void SdHtmlAttrPreview::SetColors(Color& aBack, Color& aText, Color& aLink,
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index 5fa9de5a7258..333baa7b0b35 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -129,7 +129,7 @@ void CategoryListBox::UserDraw( const UserDrawEvent& rUDEvt )
pDev->DrawPixel( Point(aOutRect.Right(), aOutRect.Bottom()));
// draw the category title
- pDev->DrawText (aOutRect, GetEntry(nItem), TEXT_DRAW_CENTER );
+ pDev->DrawText (aOutRect, GetEntry(nItem), DrawTextFlags::Center );
}
else
{
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 6f93769dfc3a..90735cd40a6f 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -951,7 +951,7 @@ void CustomAnimationList::Paint(vcl::RenderContext& rRenderContext, const Rectan
aRect.Bottom() -= aOffset.Y();
rRenderContext.DrawText(aRect, SD_RESSTR(STR_CUSTOMANIMATION_LIST_HELPTEXT),
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK | TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER );
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak | DrawTextFlags::Center | DrawTextFlags::VCenter );
rRenderContext.SetTextColor(aOldColor);
}
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index 24a5821bf390..06ac9c383441 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -342,7 +342,7 @@ void ClientBox::DrawRow(vcl::RenderContext& rRenderContext, const Rectangle& rRe
if (rEntry->m_bActive)
{
OUString sPinText(SD_RESSTR(STR_ENTER_PIN));
- DrawText(m_sPinTextRect, sPinText, 0);
+ DrawText(m_sPinTextRect, sPinText);
}
rRenderContext.SetLineColor(Color(COL_LIGHTGRAY));
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index 51565b02101d..c1428c874c59 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -649,7 +649,7 @@ void SlideSorterView::CompleteRedraw (
mrSlideSorter.GetContentWindow()->DrawText(
gFrameTimeBox,
OUString::number(1 / (gFrameTimeSum / gFrameTimeCount)),
- TEXT_DRAW_RIGHT | TEXT_DRAW_VCENTER);
+ DrawTextFlags::Right | DrawTextFlags::VCenter);
// mrSlideSorter.GetContentWindow()->Invalidate(gFrameTimeBox);
#endif
}
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 4aebbbef8a9a..52020df71b9a 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -264,7 +264,7 @@ void PageObjectPainter::PaintPageNumber (
const OUString sPageNumber(OUString::number(nPageNumber));
rDevice.SetFont(*mpPageNumberFont);
rDevice.SetTextColor(aPageNumberColor);
- rDevice.DrawText(aBox, sPageNumber, TEXT_DRAW_RIGHT | TEXT_DRAW_VCENTER);
+ rDevice.DrawText(aBox, sPageNumber, DrawTextFlags::Right | DrawTextFlags::VCenter);
}
void PageObjectPainter::PaintTransitionEffect (
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index 774cf1d50d08..e6034a87482c 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -340,11 +340,11 @@ void PreviewRenderer::PaintSubstitutionText (const OUString& rSubstitutionText)
Point(0,0),
mpPreviewDevice->PixelToLogic(
mpPreviewDevice->GetOutputSizePixel()));
- sal_uInt16 nTextStyle =
- TEXT_DRAW_CENTER
- | TEXT_DRAW_VCENTER
- | TEXT_DRAW_MULTILINE
- | TEXT_DRAW_WORDBREAK;
+ DrawTextFlags nTextStyle =
+ DrawTextFlags::Center
+ | DrawTextFlags::VCenter
+ | DrawTextFlags::MultiLine
+ | DrawTextFlags::WordBreak;
mpPreviewDevice->DrawText (aTextBox, rSubstitutionText, nTextStyle);
// Restore the font.
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index 91623bfe6105..a80d77d6c1c0 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -210,7 +210,7 @@ namespace sfx2
rRenderContext.SetLineColor(rStyleSettings.GetActiveTextColor());
aTitleBarBox.Left() += 3;
rRenderContext.DrawText(aTitleBarBox, impl_getTitle(),
- TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK);
+ DrawTextFlags::Left | DrawTextFlags::VCenter | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak);
// Restore original values of the output device.
rRenderContext.Pop();
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index bef67c9ddbe6..2c728c085020 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -127,9 +127,9 @@ namespace {
class WaitWindow_Impl : public WorkWindow
{
- Rectangle maRect;
- sal_uInt16 mnTextStyle;
- OUString maText;
+ Rectangle maRect;
+ DrawTextFlags mnTextStyle;
+ OUString maText;
public:
WaitWindow_Impl();
@@ -2425,7 +2425,7 @@ void SAL_CALL Updater_Impl::onTerminated()
WaitWindow_Impl::WaitWindow_Impl() : WorkWindow(NULL, WB_BORDER | WB_3DLOOK)
{
Rectangle aRect = Rectangle(0, 0, 300, 30000);
- mnTextStyle = TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER | TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE;
+ mnTextStyle = DrawTextFlags::Center | DrawTextFlags::VCenter | DrawTextFlags::WordBreak | DrawTextFlags::MultiLine;
maText = SfxResId(RID_CNT_STR_WAITING).toString();
maRect = GetTextRect(aRect, maText, mnTextStyle);
aRect = maRect;
diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx
index 3e4d77584ac8..da27a66e828d 100644
--- a/sfx2/source/sidebar/TitleBar.cxx
+++ b/sfx2/source/sidebar/TitleBar.cxx
@@ -134,7 +134,7 @@ void TitleBar::PaintTitle(vcl::RenderContext& rRenderContext, const Rectangle& r
// Paint title bar text.
rRenderContext.SetTextColor(rRenderContext.GetTextColor());
- rRenderContext.DrawText(aTitleBox, msTitle, TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER);
+ rRenderContext.DrawText(aTitleBox, msTitle, DrawTextFlags::Left | DrawTextFlags::VCenter);
rRenderContext.Pop();
}
@@ -146,7 +146,7 @@ void TitleBar::PaintFocus(vcl::RenderContext& rRenderContext, const Rectangle& r
aFont.SetWeight(WEIGHT_BOLD);
rRenderContext.SetFont(aFont);
- const Rectangle aTextBox(rRenderContext.GetTextRect(rFocusBox, msTitle, TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER));
+ const Rectangle aTextBox(rRenderContext.GetTextRect(rFocusBox, msTitle, DrawTextFlags::Left | DrawTextFlags::VCenter));
const Rectangle aLargerTextBox(aTextBox.Left() - 2,
aTextBox.Top() - 2,
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
{
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index 21755f8d25fc..8c318494870a 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -87,7 +87,7 @@ void DialControlBmp::DrawElements( const OUString& rText, sal_Int32 nAngle )
long nX = static_cast< long >( mnCenterX - fWidth * fCos - fHeight * fSin );
long nY = static_cast< long >( mnCenterY + fWidth * fSin - fHeight * fCos );
Rectangle aRect( nX, nY, 2 * mnCenterX - nX, 2 * mnCenterY - nY );
- DrawText( aRect, rText, mbEnabled ? 0 : TEXT_DRAW_DISABLE );
+ DrawText( aRect, rText, mbEnabled ? DrawTextFlags::NONE : DrawTextFlags::Disable );
}
else
{
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 326f6fbf5c3c..0b8e49e74856 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -467,28 +467,28 @@ void DbGridColumn::Paint(OutputDevice& rDev,
{
if (!pRow || !pRow->IsValid())
{
- sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_CENTER;
+ DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::Center;
if ( !bEnabled )
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
rDev.DrawText(rRect, OUString(INVALIDTEXT), nStyle);
}
else if (m_bAutoValue && pRow->IsNew())
{
- sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_VCENTER;
+ DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::VCenter;
if ( !bEnabled )
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
switch (GetAlignment())
{
case ::com::sun::star::awt::TextAlign::RIGHT:
- nStyle |= TEXT_DRAW_RIGHT;
+ nStyle |= DrawTextFlags::Right;
break;
case ::com::sun::star::awt::TextAlign::CENTER:
- nStyle |= TEXT_DRAW_CENTER;
+ nStyle |= DrawTextFlags::Center;
break;
default:
- nStyle |= TEXT_DRAW_LEFT;
+ nStyle |= DrawTextFlags::Left;
}
rDev.DrawText(rRect, SVX_RESSTR(RID_STR_AUTOFIELD), nStyle);
@@ -502,17 +502,17 @@ void DbGridColumn::Paint(OutputDevice& rDev,
{
if (!pRow || !pRow->IsValid())
{
- sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_CENTER;
+ DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::Center;
if ( !bEnabled )
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
rDev.DrawText(rRect, OUString(INVALIDTEXT), nStyle);
}
else if (pRow->HasField(m_nFieldPos) && m_bObject)
{
- sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_CENTER;
+ DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::Center;
if ( !bEnabled )
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
rDev.DrawText(rRect, OUString(OBJECTTEXT), nStyle);
}
}
@@ -2698,7 +2698,7 @@ DbFilterField::~DbFilterField()
void DbFilterField::PaintCell(OutputDevice& rDev, const Rectangle& rRect)
{
- static sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_VCENTER | TEXT_DRAW_LEFT;
+ static const DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::VCenter | DrawTextFlags::Left;
switch (m_nControlClass)
{
case FormComponentType::CHECKBOX:
@@ -3538,20 +3538,20 @@ void FmXTextCell::PaintFieldToCell(OutputDevice& rDev,
return;
}
- sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_VCENTER;
+ DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::VCenter;
if ( ( rDev.GetOutDevType() == OUTDEV_WINDOW ) && !static_cast< vcl::Window& >( rDev ).IsEnabled() )
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
switch (m_pColumn->GetAlignment())
{
case ::com::sun::star::awt::TextAlign::RIGHT:
- nStyle |= TEXT_DRAW_RIGHT;
+ nStyle |= DrawTextFlags::Right;
break;
case ::com::sun::star::awt::TextAlign::CENTER:
- nStyle |= TEXT_DRAW_CENTER;
+ nStyle |= DrawTextFlags::Center;
break;
default:
- nStyle |= TEXT_DRAW_LEFT;
+ nStyle |= DrawTextFlags::Left;
}
Color* pColor = NULL;
diff --git a/svx/source/sidebar/line/LineWidthValueSet.cxx b/svx/source/sidebar/line/LineWidthValueSet.cxx
index db6ac1b17fbb..85b59696fe11 100644
--- a/svx/source/sidebar/line/LineWidthValueSet.cxx
+++ b/svx/source/sidebar/line/LineWidthValueSet.cxx
@@ -138,7 +138,7 @@ void LineWidthValueSet::UserDraw( const UserDrawEvent& rUDEvt )
aFont.SetColor(GetSettings().GetStyleSettings().GetDisableColor());
pDev->SetFont(aFont);
- pDev->DrawText(aStrRect, strUnit[ nItemId - 1 ], TEXT_DRAW_ENDELLIPSIS);
+ pDev->DrawText(aStrRect, strUnit[ nItemId - 1 ], DrawTextFlags::EndEllipsis);
}
else
{
@@ -164,7 +164,7 @@ void LineWidthValueSet::UserDraw( const UserDrawEvent& rUDEvt )
aFont.SetColor(GetSettings().GetStyleSettings().GetFieldTextColor());
pDev->SetFont(aFont);
Point aStart(aBLPos.X() + nRectWidth * 7 / 9 , aBLPos.Y() + nRectHeight/6);
- pDev->DrawText(aStart, strUnit[ nItemId - 1 ]); //can't set TEXT_DRAW_ENDELLIPSIS here ,or the text will disappear
+ pDev->DrawText(aStart, strUnit[ nItemId - 1 ]); //can't set DrawTextFlags::EndEllipsis here ,or the text will disappear
//draw line
if( nSelItem == nItemId )
diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index ab47fbb752d0..889c8377c2b0 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -204,7 +204,7 @@ void ValueSetWithTextControl::UserDraw( const UserDrawEvent& rUDEvt )
aStrRect.Left() += pImage->GetSizePixel().Width() + 12;
pDev->SetFont(aFont);
- pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText, TEXT_DRAW_ENDELLIPSIS);
+ pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText, DrawTextFlags::EndEllipsis);
}
break;
case TEXT_TEXT:
@@ -213,10 +213,10 @@ void ValueSetWithTextControl::UserDraw( const UserDrawEvent& rUDEvt )
aStrRect.Left() += 8;
aStrRect.Right() -= (nRectWidth*2)/3;
pDev->SetFont(aFont);
- pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText, TEXT_DRAW_ENDELLIPSIS);
+ pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText, DrawTextFlags::EndEllipsis);
aStrRect.Left() += nRectWidth/3;
aStrRect.Right() += (nRectWidth*2)/3;
- pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText2, TEXT_DRAW_ENDELLIPSIS);
+ pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText2, DrawTextFlags::EndEllipsis);
}
break;
}
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index e5c5c6f0eaed..23be1e1736da 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3490,9 +3490,9 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
pSh->GetOut()->SetFont( rEmptyPageFont );
pSh->GetOut()->DrawText( aEmptyPageRect.SVRect(), SW_RESSTR( STR_EMPTYPAGE ),
- TEXT_DRAW_VCENTER |
- TEXT_DRAW_CENTER |
- TEXT_DRAW_CLIP );
+ DrawTextFlags::VCenter |
+ DrawTextFlags::Center |
+ DrawTextFlags::Clip );
pSh->GetOut()->SetFont( aOldFont );
// paint shadow and border for empty page
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 28e8160fd925..bb154c64c7e9 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1082,9 +1082,9 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan
vcl::Font aOldFont( pOutputDev->GetFont() );
pOutputDev->SetFont( rEmptyPgFont );
pOutputDev->DrawText( aPageRect, SW_RESSTR( STR_EMPTYPAGE ),
- TEXT_DRAW_VCENTER |
- TEXT_DRAW_CENTER |
- TEXT_DRAW_CLIP );
+ DrawTextFlags::VCenter |
+ DrawTextFlags::Center |
+ DrawTextFlags::Clip );
pOutputDev->SetFont( aOldFont );
// paint shadow and border for empty page
// OD 19.02.2003 #107369# - use new method to paint page border and shadow
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 9c5a03ffa1bd..fe40ea44873e 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -4009,7 +4009,7 @@ OUString SwEntryBrowseBox::GetCellText(long nRow, sal_uInt16 nColumn) const
void SwEntryBrowseBox::PaintCell(OutputDevice& rDev,
const Rectangle& rRect, sal_uInt16 nColumnId) const
{
- const sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_CENTER;
+ const DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::Center;
rDev.DrawText( rRect, GetCellText( nCurrentRow, nColumnId ), nStyle );
}
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index 046cf49bb769..b2ff36866f55 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -165,7 +165,7 @@ void AnnotationMenuButton::Paint(vcl::RenderContext& rRenderContext, const Recta
aFont.SetHeight(200);
aFont.SetWeight(WEIGHT_MEDIUM);
rRenderContext.SetFont(aFont);
- rRenderContext.DrawText(aRect, OUString("Edit Note"), TEXT_DRAW_CENTER);
+ rRenderContext.DrawText(aRect, OUString("Edit Note"), DrawTextFlags::Center);
rRenderContext.SetFont(aOldFont);
}
else
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index 38bef344f67d..28f5929a83df 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -98,7 +98,7 @@ OUString SwEditWin::ClipLongToolTip(const OUString& rTxt)
long nMaxWidth = GetDesktopRectPixel().GetWidth() * 2 / 3;
nMaxWidth = PixelToLogic(Size(nMaxWidth, 0)).Width();
if (nTextWidth > nMaxWidth)
- sDisplayTxt = GetEllipsisString(sDisplayTxt, nMaxWidth, TEXT_DRAW_CENTERELLIPSIS);
+ sDisplayTxt = GetEllipsisString(sDisplayTxt, nMaxWidth, DrawTextFlags::CenterEllipsis);
return sDisplayTxt;
}
diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx
index 332d9fd4e0c9..e498fb0d512b 100644
--- a/toolkit/source/helper/formpdfexport.cxx
+++ b/toolkit/source/helper/formpdfexport.cxx
@@ -346,7 +346,7 @@ namespace toolkitform
// text style
- Descriptor->TextStyle = 0;
+ Descriptor->TextStyle = DrawTextFlags::NONE;
// multi line and word break
// The MultiLine property of the control is mapped to both the "MULTILINE" and
@@ -357,7 +357,7 @@ namespace toolkitform
bool bMultiLine = false;
OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_MULTILINE ) >>= bMultiLine );
if ( bMultiLine )
- Descriptor->TextStyle |= TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK;
+ Descriptor->TextStyle |= DrawTextFlags::MultiLine | DrawTextFlags::WordBreak;
}
// horizontal alignment
@@ -370,9 +370,9 @@ namespace toolkitform
// means something else than LEFT?
switch ( nAlign )
{
- case awt::TextAlign::LEFT: Descriptor->TextStyle |= TEXT_DRAW_LEFT; break;
- case awt::TextAlign::CENTER: Descriptor->TextStyle |= TEXT_DRAW_CENTER; break;
- case awt::TextAlign::RIGHT: Descriptor->TextStyle |= TEXT_DRAW_RIGHT; break;
+ case awt::TextAlign::LEFT: Descriptor->TextStyle |= DrawTextFlags::Left; break;
+ case awt::TextAlign::CENTER: Descriptor->TextStyle |= DrawTextFlags::Center; break;
+ case awt::TextAlign::RIGHT: Descriptor->TextStyle |= DrawTextFlags::Right; break;
default:
OSL_FAIL( "describePDFControl: invalid text align!" );
}
@@ -387,9 +387,9 @@ namespace toolkitform
xModelProps->getPropertyValue( sVertAlignPropertyName ) >>= nAlign;
switch ( nAlign )
{
- case VerticalAlignment_TOP: Descriptor->TextStyle |= TEXT_DRAW_TOP; break;
- case VerticalAlignment_MIDDLE: Descriptor->TextStyle |= TEXT_DRAW_VCENTER; break;
- case VerticalAlignment_BOTTOM: Descriptor->TextStyle |= TEXT_DRAW_BOTTOM; break;
+ case VerticalAlignment_TOP: Descriptor->TextStyle |= DrawTextFlags::Top; break;
+ case VerticalAlignment_MIDDLE: Descriptor->TextStyle |= DrawTextFlags::VCenter; break;
+ case VerticalAlignment_BOTTOM: Descriptor->TextStyle |= DrawTextFlags::Bottom; break;
default:
OSL_FAIL( "describePDFControl: invalid vertical text align!" );
}
@@ -423,7 +423,7 @@ namespace toolkitform
vcl::PDFWriter::EditWidget* pEditWidget = static_cast< vcl::PDFWriter::EditWidget* >( Descriptor.get() );
// multiline (already flagged in the TextStyle)
- pEditWidget->MultiLine = ( Descriptor->TextStyle & TEXT_DRAW_MULTILINE ) != 0;
+ pEditWidget->MultiLine = bool( Descriptor->TextStyle & DrawTextFlags::MultiLine );
// password input
OUString sEchoCharPropName( "EchoChar" );
@@ -512,8 +512,8 @@ namespace toolkitform
// the PDF exporter defaults the text style, if 0. To prevent this, we have to transfer the UNO
// defaults to the PDF widget
- if ( !pButtonWidget->TextStyle )
- pButtonWidget->TextStyle = TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER;
+ if ( pButtonWidget->TextStyle == DrawTextFlags::NONE )
+ pButtonWidget->TextStyle = DrawTextFlags::Center | DrawTextFlags::VCenter;
}
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index f019b699932e..bceba393ec53 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -359,7 +359,7 @@ public:
void SetReadOnly( bool bReadOnly ) { mbReadOnly = bReadOnly; }
bool IsReadOnly() const { return mbReadOnly; }
- sal_uInt16 ImplGetTextStyle() const;
+ DrawTextFlags ImplGetTextStyle() const;
/// pb: #106948# explicit mirroring for calc
inline void EnableMirroring() { mbMirroring = true; }
diff --git a/vcl/inc/textlayout.hxx b/vcl/inc/textlayout.hxx
index 3510df221a66..6b86aafc422a 100644
--- a/vcl/inc/textlayout.hxx
+++ b/vcl/inc/textlayout.hxx
@@ -93,7 +93,7 @@ namespace vcl
virtual ~ControlTextRenderer();
Rectangle DrawText( const Rectangle& _rRect,
- const OUString& _rText, sal_uInt16 _nStyle = 0,
+ const OUString& _rText, DrawTextFlags _nStyle = DrawTextFlags::NONE,
MetricVector* _pVector = NULL, OUString* _pDisplayText = NULL );
private:
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index cc346f4e1fd7..7014a790f789 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -332,10 +332,10 @@ void HelpTextWindow::SetHelpText( const OUString& rHelpText )
long nWidth = GetTextWidth( aXXX );
Size aTmpSize( nWidth, 0x7FFFFFFF );
Rectangle aTry1( aTmpPoint, aTmpSize );
- sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK |
- TEXT_DRAW_LEFT | TEXT_DRAW_TOP;
+ DrawTextFlags nDrawFlags = DrawTextFlags::MultiLine | DrawTextFlags::WordBreak |
+ DrawTextFlags::Left | DrawTextFlags::Top;
if ( mnStyle & QuickHelpFlags::CtrlText )
- nDrawFlags |= TEXT_DRAW_MNEMONIC;
+ nDrawFlags |= DrawTextFlags::Mnemonic;
Rectangle aTextRect = GetTextRect( aTry1, maHelpText, nDrawFlags );
// get a better width later...
@@ -380,10 +380,10 @@ void HelpTextWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle&
}
else // HELPWINSTYLE_BALLOON
{
- sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
- TEXT_DRAW_LEFT|TEXT_DRAW_TOP;
+ DrawTextFlags nDrawFlags = DrawTextFlags::MultiLine|DrawTextFlags::WordBreak|
+ DrawTextFlags::Left|DrawTextFlags::Top;
if (mnStyle & QuickHelpFlags::CtrlText)
- nDrawFlags |= TEXT_DRAW_MNEMONIC;
+ nDrawFlags |= DrawTextFlags::Mnemonic;
rRenderContext.DrawText(maTextRect, maHelpText, nDrawFlags);
}
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index fac1562bc2e7..f66067237494 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -207,30 +207,30 @@ void Button::ImplSetSeparatorX( long nX )
mpButtonData->mnSeparatorX = nX;
}
-sal_uInt16 Button::ImplGetTextStyle( OUString& rText, WinBits nWinStyle,
+DrawTextFlags Button::ImplGetTextStyle( OUString& rText, WinBits nWinStyle,
sal_uLong nDrawFlags )
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle & ~WB_DEFBUTTON );
+ DrawTextFlags nTextStyle = FixedText::ImplGetTextStyle( nWinStyle & ~WB_DEFBUTTON );
if ( nDrawFlags & WINDOW_DRAW_NOMNEMONIC )
{
- if ( nTextStyle & TEXT_DRAW_MNEMONIC )
+ if ( nTextStyle & DrawTextFlags::Mnemonic )
{
rText = GetNonMnemonicString( rText );
- nTextStyle &= ~TEXT_DRAW_MNEMONIC;
+ nTextStyle &= ~DrawTextFlags::Mnemonic;
}
}
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
if ( !IsEnabled() )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ nTextStyle |= DrawTextFlags::Disable;
}
if ( (nDrawFlags & WINDOW_DRAW_MONO) ||
(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
- nTextStyle |= TEXT_DRAW_MONO;
+ nTextStyle |= DrawTextFlags::Mono;
return nTextStyle;
}
@@ -238,7 +238,7 @@ sal_uInt16 Button::ImplGetTextStyle( OUString& rText, WinBits nWinStyle,
void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
Size& rSize, bool bLayout,
sal_uLong nImageSep, sal_uLong nDrawFlags,
- sal_uInt16 nTextStyle, Rectangle *pSymbolRect,
+ DrawTextFlags nTextStyle, Rectangle *pSymbolRect,
bool bAddImageSep )
{
OUString aText( GetText() );
@@ -258,10 +258,10 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
Size aImageSize = mpButtonData->maImage.GetSizePixel();
if ( ( nDrawFlags & WINDOW_DRAW_NOMNEMONIC ) &&
- ( nTextStyle & TEXT_DRAW_MNEMONIC ) )
+ ( nTextStyle & DrawTextFlags::Mnemonic ) )
{
aText = GetNonMnemonicString( aText );
- nTextStyle &= ~TEXT_DRAW_MNEMONIC;
+ nTextStyle &= ~DrawTextFlags::Mnemonic;
}
aImageSize.Width() = CalcZoom( aImageSize.Width() );
@@ -736,37 +736,37 @@ bool PushButton::ImplHitTestPushButton( vcl::Window* pDev,
return aTestRect.IsInside( rPos );
}
-sal_uInt16 PushButton::ImplGetTextStyle( sal_uLong nDrawFlags ) const
+DrawTextFlags PushButton::ImplGetTextStyle( sal_uLong nDrawFlags ) const
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_MULTILINE | TEXT_DRAW_ENDELLIPSIS;
+ DrawTextFlags nTextStyle = DrawTextFlags::Mnemonic | DrawTextFlags::MultiLine | DrawTextFlags::EndEllipsis;
if ( ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO ) ||
( nDrawFlags & WINDOW_DRAW_MONO ) )
- nTextStyle |= TEXT_DRAW_MONO;
+ nTextStyle |= DrawTextFlags::Mono;
if ( GetStyle() & WB_WORDBREAK )
- nTextStyle |= TEXT_DRAW_WORDBREAK;
+ nTextStyle |= DrawTextFlags::WordBreak;
if ( GetStyle() & WB_NOLABEL )
- nTextStyle &= ~TEXT_DRAW_MNEMONIC;
+ nTextStyle &= ~DrawTextFlags::Mnemonic;
if ( GetStyle() & WB_LEFT )
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
else if ( GetStyle() & WB_RIGHT )
- nTextStyle |= TEXT_DRAW_RIGHT;
+ nTextStyle |= DrawTextFlags::Right;
else
- nTextStyle |= TEXT_DRAW_CENTER;
+ nTextStyle |= DrawTextFlags::Center;
if ( GetStyle() & WB_TOP )
- nTextStyle |= TEXT_DRAW_TOP;
+ nTextStyle |= DrawTextFlags::Top;
else if ( GetStyle() & WB_BOTTOM )
- nTextStyle |= TEXT_DRAW_BOTTOM;
+ nTextStyle |= DrawTextFlags::Bottom;
else
- nTextStyle |= TEXT_DRAW_VCENTER;
+ nTextStyle |= DrawTextFlags::VCenter;
if ( ! ( (nDrawFlags & WINDOW_DRAW_NODISABLE) || IsEnabled() ) )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ nTextStyle |= DrawTextFlags::Disable;
return nTextStyle;
}
@@ -804,7 +804,7 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, sal_uLong nDrawFl
Rectangle aInRect = rRect;
Color aColor;
OUString aText = PushButton::GetText(); // PushButton:: because of MoreButton
- sal_uInt16 nTextStyle = ImplGetTextStyle( nDrawFlags );
+ DrawTextFlags nTextStyle = ImplGetTextStyle( nDrawFlags );
DrawSymbolFlags nStyle;
if( aInRect.Right() < aInRect.Left() || aInRect.Bottom() < aInRect.Top() )
@@ -2002,7 +2002,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
if ( ( !aText.isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) ) ||
( HasImage() && ! (ImplGetButtonState() & DrawButtonFlags::NoImage) ) )
{
- sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ DrawTextFlags nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
@@ -2015,8 +2015,8 @@ void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
if( (nWinStyle & (WB_TOP|WB_VCENTER|WB_BOTTOM)) == 0 &&
(rImageSize.Height() > rSize.Height() || ! (nWinStyle & WB_WORDBREAK) ) )
{
- nTextStyle &= ~(TEXT_DRAW_TOP|TEXT_DRAW_BOTTOM);
- nTextStyle |= TEXT_DRAW_VCENTER;
+ nTextStyle &= ~DrawTextFlags(DrawTextFlags::Top|DrawTextFlags::Bottom);
+ nTextStyle |= DrawTextFlags::VCenter;
aSize.Height() = rImageSize.Height();
}
@@ -2109,7 +2109,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
aTxtPos.X() += aImageRect.Right()+8;
aTxtPos.Y() += (rSize.Height()-nTextHeight)/2;
}
- pDev->DrawCtrlText( aTxtPos, aText, 0, aText.getLength(), TEXT_DRAW_MNEMONIC, pVector, pDisplayText );
+ pDev->DrawCtrlText( aTxtPos, aText, 0, aText.getLength(), DrawTextFlags::Mnemonic, pVector, pDisplayText );
}
rMouseRect = aImageRect;
@@ -3077,7 +3077,7 @@ void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
if ( ( !aText.isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) ) ||
( HasImage() && ! (ImplGetButtonState() & DrawButtonFlags::NoImage) ) )
{
- sal_uInt16 nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
+ DrawTextFlags nTextStyle = Button::ImplGetTextStyle( aText, nWinStyle, nDrawFlags );
const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() );
Size aSize( rSize );
@@ -3090,8 +3090,8 @@ void CheckBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
if( (nWinStyle & (WB_TOP|WB_VCENTER|WB_BOTTOM)) == 0 &&
(rImageSize.Height() > rSize.Height() || ! (nWinStyle & WB_WORDBREAK) ) )
{
- nTextStyle &= ~(TEXT_DRAW_TOP|TEXT_DRAW_BOTTOM);
- nTextStyle |= TEXT_DRAW_VCENTER;
+ nTextStyle &= ~DrawTextFlags(DrawTextFlags::Top|DrawTextFlags::Bottom);
+ nTextStyle |= DrawTextFlags::VCenter;
aSize.Height() = rImageSize.Height();
}
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 787d3b2ad9ed..b30317ff816e 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -1169,18 +1169,18 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, s
long nOnePixel = GetDrawPixel( pDev, 1 );
long nTextHeight = pDev->GetTextHeight();
long nEditHeight = nTextHeight + 6*nOnePixel;
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ DrawTextFlags nTextStyle = DrawTextFlags::VCenter;
// First, draw the edit part
mpSubEdit->Draw( pDev, aPos, Size( aSize.Width(), nEditHeight ), nFlags );
// Second, draw the listbox
if ( GetStyle() & WB_CENTER )
- nTextStyle |= TEXT_DRAW_CENTER;
+ nTextStyle |= DrawTextFlags::Center;
else if ( GetStyle() & WB_RIGHT )
- nTextStyle |= TEXT_DRAW_RIGHT;
+ nTextStyle |= DrawTextFlags::Right;
else
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
if ( ( nFlags & WINDOW_DRAW_MONO ) || ( eOutDevType == OUTDEV_PRINTER ) )
{
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index a0aa05a6031b..38aa4168847a 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -450,7 +450,7 @@ void Control::ImplInitSettings( const bool _bFont, const bool _bForeground )
}
void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, const OUString& _rStr,
- sal_uInt16 _nStyle, MetricVector* _pVector, OUString* _pDisplayText ) const
+ DrawTextFlags _nStyle, MetricVector* _pVector, OUString* _pDisplayText ) const
{
if ( !mpControlData->mpReferenceDevice || ( mpControlData->mpReferenceDevice == &_rTargetDevice ) )
{
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 19988dfc7bf5..edeb7baeac54 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -157,33 +157,33 @@ FixedText::FixedText( vcl::Window* pParent, const ResId& rResId )
Show();
}
-sal_uInt16 FixedText::ImplGetTextStyle( WinBits nWinStyle )
+DrawTextFlags FixedText::ImplGetTextStyle( WinBits nWinStyle )
{
- sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_ENDELLIPSIS;
+ DrawTextFlags nTextStyle = DrawTextFlags::Mnemonic | DrawTextFlags::EndEllipsis;
if( ! (nWinStyle & WB_NOMULTILINE) )
- nTextStyle |= TEXT_DRAW_MULTILINE;
+ nTextStyle |= DrawTextFlags::MultiLine;
if ( nWinStyle & WB_RIGHT )
- nTextStyle |= TEXT_DRAW_RIGHT;
+ nTextStyle |= DrawTextFlags::Right;
else if ( nWinStyle & WB_CENTER )
- nTextStyle |= TEXT_DRAW_CENTER;
+ nTextStyle |= DrawTextFlags::Center;
else
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
if ( nWinStyle & WB_BOTTOM )
- nTextStyle |= TEXT_DRAW_BOTTOM;
+ nTextStyle |= DrawTextFlags::Bottom;
else if ( nWinStyle & WB_VCENTER )
- nTextStyle |= TEXT_DRAW_VCENTER;
+ nTextStyle |= DrawTextFlags::VCenter;
else
- nTextStyle |= TEXT_DRAW_TOP;
+ nTextStyle |= DrawTextFlags::Top;
if ( nWinStyle & WB_WORDBREAK )
{
- nTextStyle |= TEXT_DRAW_WORDBREAK;
+ nTextStyle |= DrawTextFlags::WordBreak;
if ( (nWinStyle & WB_HYPHENATION ) == WB_HYPHENATION )
- nTextStyle |= TEXT_DRAW_WORDBREAK_HYPHENATION;
+ nTextStyle |= DrawTextFlags::WordBreakHyphenation;
}
if ( nWinStyle & WB_NOLABEL )
- nTextStyle &= ~TEXT_DRAW_MNEMONIC;
+ nTextStyle &= ~DrawTextFlags::Mnemonic;
return nTextStyle;
}
@@ -195,7 +195,7 @@ void FixedText::ImplDraw(OutputDevice* pDev, sal_uLong nDrawFlags,
const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
WinBits nWinStyle = GetStyle();
OUString aText(GetText());
- sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ DrawTextFlags nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
Point aPos = rPos;
if ( nWinStyle & WB_EXTRAOFFSET )
@@ -203,25 +203,25 @@ void FixedText::ImplDraw(OutputDevice* pDev, sal_uLong nDrawFlags,
if ( nWinStyle & WB_PATHELLIPSIS )
{
- nTextStyle &= ~(TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK);
- nTextStyle |= TEXT_DRAW_PATHELLIPSIS;
+ nTextStyle &= ~DrawTextFlags(DrawTextFlags::EndEllipsis | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak);
+ nTextStyle |= DrawTextFlags::PathEllipsis;
}
if ( nDrawFlags & WINDOW_DRAW_NOMNEMONIC )
{
- if ( nTextStyle & TEXT_DRAW_MNEMONIC )
+ if ( nTextStyle & DrawTextFlags::Mnemonic )
{
aText = GetNonMnemonicString( aText );
- nTextStyle &= ~TEXT_DRAW_MNEMONIC;
+ nTextStyle &= ~DrawTextFlags::Mnemonic;
}
}
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
if ( !IsEnabled() )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ nTextStyle |= DrawTextFlags::Disable;
}
if ( (nDrawFlags & WINDOW_DRAW_MONO) ||
(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
- nTextStyle |= TEXT_DRAW_MONO;
+ nTextStyle |= DrawTextFlags::Mono;
if( bFillLayout )
(mpControlData->mpLayoutData->m_aDisplayText).clear();
@@ -336,9 +336,9 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt )
Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt, long nMaxWidth)
{
- sal_uInt16 nStyle = ImplGetTextStyle( pControl->GetStyle() );
+ DrawTextFlags nStyle = ImplGetTextStyle( pControl->GetStyle() );
if ( !( pControl->GetStyle() & WB_NOLABEL ) )
- nStyle |= TEXT_DRAW_MNEMONIC;
+ nStyle |= DrawTextFlags::Mnemonic;
return pControl->GetTextRect(Rectangle( Point(), Size(nMaxWidth, 0x7fffffff)),
rTxt, nStyle).GetSize();
@@ -589,18 +589,18 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext, bool bLayout)
}
else
{
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS;
+ DrawTextFlags nStyle = DrawTextFlags::Mnemonic | DrawTextFlags::Left | DrawTextFlags::VCenter | DrawTextFlags::EndEllipsis;
Rectangle aRect(0, 0, aOutSize.Width(), aOutSize.Height());
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
if (nWinStyle & WB_CENTER)
- nStyle |= TEXT_DRAW_CENTER;
+ nStyle |= DrawTextFlags::Center;
if (!IsEnabled())
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
if (GetStyle() & WB_NOLABEL)
- nStyle &= ~TEXT_DRAW_MNEMONIC;
+ nStyle &= ~DrawTextFlags::Mnemonic;
if (rStyleSettings.GetOptions() & STYLE_OPTION_MONO)
- nStyle |= TEXT_DRAW_MONO;
+ nStyle |= DrawTextFlags::Mono;
DrawControlText(*this, aRect, aText, nStyle, pVector, pDisplayText);
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index 9d6de9fe488a..e1d871849553 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -100,27 +100,27 @@ void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
OUString aText( GetText() );
Rectangle aRect( rPos, rSize );
- sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_MNEMONIC;
+ DrawTextFlags nTextStyle = DrawTextFlags::Left | DrawTextFlags::Top | DrawTextFlags::EndEllipsis | DrawTextFlags::Mnemonic;
if ( GetStyle() & WB_NOLABEL )
- nTextStyle &= ~TEXT_DRAW_MNEMONIC;
+ nTextStyle &= ~DrawTextFlags::Mnemonic;
if ( nDrawFlags & WINDOW_DRAW_NOMNEMONIC )
{
- if ( nTextStyle & TEXT_DRAW_MNEMONIC )
+ if ( nTextStyle & DrawTextFlags::Mnemonic )
{
aText = GetNonMnemonicString( aText );
- nTextStyle &= ~TEXT_DRAW_MNEMONIC;
+ nTextStyle &= ~DrawTextFlags::Mnemonic;
}
}
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
if ( !IsEnabled() )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ nTextStyle |= DrawTextFlags::Disable;
}
if ( (nDrawFlags & WINDOW_DRAW_MONO) ||
(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
{
- nTextStyle |= TEXT_DRAW_MONO;
+ nTextStyle |= DrawTextFlags::Mono;
nDrawFlags |= WINDOW_DRAW_MONO;
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 40bba26acc1c..47bf65fccd59 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -43,7 +43,7 @@
#include <limits>
-#define MULTILINE_ENTRY_DRAW_FLAGS ( TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE | TEXT_DRAW_VCENTER )
+#define MULTILINE_ENTRY_DRAW_FLAGS ( DrawTextFlags::WordBreak | DrawTextFlags::MultiLine | DrawTextFlags::VCenter )
using namespace ::com::sun::star;
@@ -661,7 +661,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
// GetTextRect should shrink it to the actual size
aCurSize.Height() = 0x7fffff;
Rectangle aTextRect( Point( 0, 0 ), aCurSize );
- aTextRect = GetTextRect( aTextRect, rEntry.maStr, TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE );
+ aTextRect = GetTextRect( aTextRect, rEntry.maStr, DrawTextFlags::WordBreak | DrawTextFlags::MultiLine );
aMetrics.nTextWidth = aTextRect.GetWidth();
if( aMetrics.nTextWidth > mnMaxTxtWidth )
mnMaxTxtWidth = aMetrics.nTextWidth;
@@ -1864,11 +1864,11 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32
aTextRect.Left() -= (aImgSz.Width() + IMG_TXT_DISTANCE);
}
- sal_uInt16 nDrawStyle = ImplGetTextStyle();
+ DrawTextFlags nDrawStyle = ImplGetTextStyle();
if ((pEntry->mnFlags & ListBoxEntryFlags::MultiLine))
nDrawStyle |= MULTILINE_ENTRY_DRAW_FLAGS;
if ((pEntry->mnFlags & ListBoxEntryFlags::DrawDisabled))
- nDrawStyle |= TEXT_DRAW_DISABLE;
+ nDrawStyle |= DrawTextFlags::Disable;
rRenderContext.DrawText(aTextRect, aStr, nDrawStyle, pVector, pDisplayText);
}
@@ -2137,18 +2137,18 @@ void ImplListBoxWindow::DataChanged( const DataChangedEvent& rDCEvt )
}
}
-sal_uInt16 ImplListBoxWindow::ImplGetTextStyle() const
+DrawTextFlags ImplListBoxWindow::ImplGetTextStyle() const
{
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ DrawTextFlags nTextStyle = DrawTextFlags::VCenter;
if (mpEntryList->HasImages())
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
else if (mbCenter)
- nTextStyle |= TEXT_DRAW_CENTER;
+ nTextStyle |= DrawTextFlags::Center;
else if (mbRight)
- nTextStyle |= TEXT_DRAW_RIGHT;
+ nTextStyle |= DrawTextFlags::Right;
else
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
return nTextStyle;
}
@@ -2884,16 +2884,16 @@ void ImplWin::DrawEntry( bool bDrawImage, bool bDrawText, bool bDrawTextAtImageP
if( bDrawText && !maString.isEmpty() )
{
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ DrawTextFlags nTextStyle = DrawTextFlags::VCenter;
if ( bDrawImage && bImage && !bLayout )
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
else if ( GetStyle() & WB_CENTER )
- nTextStyle |= TEXT_DRAW_CENTER;
+ nTextStyle |= DrawTextFlags::Center;
else if ( GetStyle() & WB_RIGHT )
- nTextStyle |= TEXT_DRAW_RIGHT;
+ nTextStyle |= DrawTextFlags::Right;
else
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
Rectangle aTextRect( Point( nBorder, 0 ), Size( aOutSz.Width()-2*nBorder, aOutSz.Height() ) );
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index 9050a9bd86c6..1ba4fcbf535b 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -86,10 +86,10 @@ void ImageControl::ImplDraw(OutputDevice& rDev, sal_uLong nDrawFlags, const Poin
return;
WinBits nWinStyle = GetStyle();
- sal_uInt16 nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ DrawTextFlags nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
if ( !IsEnabled() )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ nTextStyle |= DrawTextFlags::Disable;
rDev.DrawText( aDrawRect, sText, nTextStyle );
return;
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 9f582144e0c0..3a4d63317692 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -421,15 +421,15 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sa
}
long nOnePixel = GetDrawPixel( pDev, 1 );
- sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
+ DrawTextFlags nTextStyle = DrawTextFlags::VCenter;
Rectangle aTextRect( aPos, aSize );
if ( GetStyle() & WB_CENTER )
- nTextStyle |= TEXT_DRAW_CENTER;
+ nTextStyle |= DrawTextFlags::Center;
else if ( GetStyle() & WB_RIGHT )
- nTextStyle |= TEXT_DRAW_RIGHT;
+ nTextStyle |= DrawTextFlags::Right;
else
- nTextStyle |= TEXT_DRAW_LEFT;
+ nTextStyle |= DrawTextFlags::Left;
aTextRect.Left() += 3*nOnePixel;
aTextRect.Right() -= 3*nOnePixel;
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index c39b34deb257..86915d956f01 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -938,9 +938,9 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p
long nYPos = aRect.Top() + ((aTabSize.Height() - nTextHeight) / 2) - nOff3;
if (!pItem->maFormatText.isEmpty())
{
- sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC;
+ DrawTextFlags nStyle = DrawTextFlags::Mnemonic;
if (!pItem->mbEnabled)
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
Color aColor(rStyleSettings.GetTabTextColor());
if (nState & ControlState::SELECTED)
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 9395dabdb0e9..887bf7f621db 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1422,14 +1422,14 @@ void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
MetaTextRectAction::MetaTextRectAction() :
MetaAction ( MetaActionType::TEXTRECT ),
- mnStyle ( 0 )
+ mnStyle ( DrawTextFlags::NONE )
{}
MetaTextRectAction::~MetaTextRectAction()
{}
MetaTextRectAction::MetaTextRectAction( const Rectangle& rRect,
- const OUString& rStr, sal_uInt16 nStyle ) :
+ const OUString& rStr, DrawTextFlags nStyle ) :
MetaAction ( MetaActionType::TEXTRECT ),
maRect ( rRect ),
maStr ( rStr ),
@@ -1471,7 +1471,7 @@ void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
VersionCompat aCompat(rOStm, StreamMode::WRITE, 2);
WriteRectangle( rOStm, maRect );
rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
- rOStm.WriteUInt16( mnStyle );
+ rOStm.WriteUInt16( static_cast<sal_uInt16>(mnStyle) );
write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
}
@@ -1481,7 +1481,9 @@ void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
VersionCompat aCompat(rIStm, StreamMode::READ);
ReadRectangle( rIStm, maRect );
maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
- rIStm .ReadUInt16( mnStyle );
+ sal_uInt16 nTmp;
+ rIStm .ReadUInt16( nTmp );
+ mnStyle = static_cast<DrawTextFlags>(nTmp);
if ( aCompat.GetVersion() >= 2 ) // Version 2
maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm);
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 4701eded681f..85fae2d4b181 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -101,7 +101,7 @@ void PDFWriter::DrawStretchText(
void PDFWriter::DrawText(
const Rectangle& rRect,
const OUString& rStr,
- sal_uInt16 nStyle )
+ DrawTextFlags nStyle )
{
xImplementation->drawText( rRect, rStr, nStyle );
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 4848bf5d99d6..f995b78f1583 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -209,7 +209,7 @@ void doTestCode()
aWriter.SetStructureAttribute( PDFWriter::TextDecorationType, PDFWriter::Underline );
aWriter.DrawText( Rectangle( Point( 4500, 10000 ), Size( 12000, 6000 ) ),
"It was the best of PDF, it was the worst of PDF ... or so. This is a pretty nonsensical text to denote a paragraph. I suggest you stop reading it. Because if you read on you might get bored. So continue on your on risk. Hey, you're still here ? Why do you continue to read this as it is of no use at all ? OK, it's your time, but still... . Woah, i even get bored writing this, so let's end this here and now.",
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak
);
aWriter.SetActualText( "It was the best of PDF, it was the worst of PDF ... or so. This is a pretty nonsensical text to denote a paragraph. I suggest you stop reading it. Because if you read on you might get bored. So continue on your on risk. Hey, you're still here ? Why do you continue to read this as it is of no use at all ? OK, it's your time, but still... . Woah, i even get bored writing this, so let's end this here and now." );
aWriter.SetAlternateText( "This paragraph contains some lengthy nonsense to test structural element emission of PDFWriter." );
@@ -218,7 +218,7 @@ void doTestCode()
aWriter.SetStructureAttribute( PDFWriter::WritingMode, PDFWriter::LrTb );
aWriter.DrawText( Rectangle( Point( 4500, 19000 ), Size( 12000, 1000 ) ),
"This paragraph is nothing special either but ends on the next page structurewise",
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak
);
aWriter.NewPage( 595, 842 );
@@ -231,7 +231,7 @@ void doTestCode()
aWriter.SetFont( Font( OUString( "Times" ), Size( 0, 500 ) ) );
aWriter.DrawText( Rectangle( Point( 4500, 1500 ), Size( 12000, 3000 ) ),
"Here's where all things come to an end ... well at least the paragraph from the last page.",
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak
);
aWriter.EndStructureElement();
@@ -287,7 +287,7 @@ void doTestCode()
aWriter.SetTextColor( Color( COL_LIGHTBLUE ) );
aWriter.DrawText( aTranspRect,
"Some transparent text",
- TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ DrawTextFlags::Center | DrawTextFlags::VCenter | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
aWriter.EndTransparencyGroup( aTranspRect, 50 );
@@ -311,7 +311,7 @@ void doTestCode()
aWriter.SetTextColor( Color( COL_LIGHTBLUE ) );
aWriter.DrawText( aTranspRect,
"Some transparent text",
- TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ DrawTextFlags::Center | DrawTextFlags::VCenter | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
aTranspRect = Rectangle( Point( 1500, 16500 ), Size( 4800, 3000 ) );
aWriter.SetFillColor( Color( COL_LIGHTRED ) );
aWriter.DrawRect( aTranspRect );
@@ -449,7 +449,7 @@ void doTestCode()
aEditBox.Name = "testEdit";
aEditBox.Description = "A test edit field";
aEditBox.Text = "A little test text";
- aEditBox.TextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER;
+ aEditBox.TextStyle = DrawTextFlags::Left | DrawTextFlags::VCenter;
aEditBox.Location = Rectangle( Point( 10000, 18000 ), Size( 5000, 1500 ) );
aEditBox.MaxLen = 100;
aEditBox.Border = aEditBox.Background = true;
@@ -5586,9 +5586,9 @@ bool PDFWriterImpl::emitWidgetAnnotations()
aLine.append( "/DA" );
appendLiteralStringEncrypt( rWidget.m_aDAString, rWidget.m_nObject, aLine );
aLine.append( "\n" );
- if( rWidget.m_nTextStyle & TEXT_DRAW_CENTER )
+ if( rWidget.m_nTextStyle & DrawTextFlags::Center )
aLine.append( "/Q 1\n" );
- else if( rWidget.m_nTextStyle & TEXT_DRAW_RIGHT )
+ else if( rWidget.m_nTextStyle & DrawTextFlags::Right )
aLine.append( "/Q 2\n" );
}
// appearance charactristics for terminal fields
@@ -9343,7 +9343,7 @@ void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const
}
}
-void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr, sal_uInt16 nStyle, bool bTextLines )
+void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle, bool bTextLines )
{
long nWidth = rRect.GetWidth();
long nHeight = rRect.GetHeight();
@@ -9370,11 +9370,11 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr,
sal_Int32 nMnemonicPos = -1;
OUString aStr = rOrigStr;
- if ( nStyle & TEXT_DRAW_MNEMONIC )
+ if ( nStyle & DrawTextFlags::Mnemonic )
aStr = OutputDevice::GetNonMnemonicString( aStr, nMnemonicPos );
// multiline text
- if ( nStyle & TEXT_DRAW_MULTILINE )
+ if ( nStyle & DrawTextFlags::MultiLine )
{
OUString aLastLine;
ImplMultiTextLineInfo aMultiLineInfo;
@@ -9393,7 +9393,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr,
nLines = 1;
if ( nFormatLines > nLines )
{
- if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ if ( nStyle & DrawTextFlags::EndEllipsis )
{
// handle last line
nFormatLines = nLines-1;
@@ -9403,24 +9403,24 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr,
// replace line feed by space
aLastLine = aLastLine.replace('\n', ' ');
aLastLine = m_pReferenceDevice->GetEllipsisString( aLastLine, nWidth, nStyle );
- nStyle &= ~(TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM);
- nStyle |= TEXT_DRAW_TOP;
+ nStyle &= ~DrawTextFlags(DrawTextFlags::VCenter | DrawTextFlags::Bottom);
+ nStyle |= DrawTextFlags::Top;
}
}
// vertical alignment
- if ( nStyle & TEXT_DRAW_BOTTOM )
+ if ( nStyle & DrawTextFlags::Bottom )
aPos.Y() += nHeight-(nFormatLines*nTextHeight);
- else if ( nStyle & TEXT_DRAW_VCENTER )
+ else if ( nStyle & DrawTextFlags::VCenter )
aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2;
// draw all lines excluding the last
for ( i = 0; i < nFormatLines; i++ )
{
pLineInfo = aMultiLineInfo.GetLine( i );
- if ( nStyle & TEXT_DRAW_RIGHT )
+ if ( nStyle & DrawTextFlags::Right )
aPos.X() += nWidth-pLineInfo->GetWidth();
- else if ( nStyle & TEXT_DRAW_CENTER )
+ else if ( nStyle & DrawTextFlags::Center )
aPos.X() += (nWidth-pLineInfo->GetWidth())/2;
sal_Int32 nIndex = pLineInfo->GetIndex();
sal_Int32 nLineLen = pLineInfo->GetLen();
@@ -9443,24 +9443,24 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const OUString& rOrigStr,
// Evt. Text kuerzen
if ( nTextWidth > nWidth )
{
- if ( nStyle & (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS | TEXT_DRAW_NEWSELLIPSIS) )
+ if ( nStyle & (DrawTextFlags::EndEllipsis | DrawTextFlags::PathEllipsis | DrawTextFlags::NewsEllipsis) )
{
aStr = m_pReferenceDevice->GetEllipsisString( aStr, nWidth, nStyle );
- nStyle &= ~(TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT);
- nStyle |= TEXT_DRAW_LEFT;
+ nStyle &= ~DrawTextFlags(DrawTextFlags::Center | DrawTextFlags::Right);
+ nStyle |= DrawTextFlags::Left;
nTextWidth = m_pReferenceDevice->GetTextWidth( aStr );
}
}
// vertical alignment
- if ( nStyle & TEXT_DRAW_RIGHT )
+ if ( nStyle & DrawTextFlags::Right )
aPos.X() += nWidth-nTextWidth;
- else if ( nStyle & TEXT_DRAW_CENTER )
+ else if ( nStyle & DrawTextFlags::Center )
aPos.X() += (nWidth-nTextWidth)/2;
- if ( nStyle & TEXT_DRAW_BOTTOM )
+ if ( nStyle & DrawTextFlags::Bottom )
aPos.Y() += nHeight-nTextHeight;
- else if ( nStyle & TEXT_DRAW_VCENTER )
+ else if ( nStyle & DrawTextFlags::VCenter )
aPos.Y() += (nHeight-nTextHeight)/2;
// mnemonics should be inserted here if the need arises
@@ -13312,9 +13312,9 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_aDescription = rControl.Description;
rNewWidget.m_aText = rControl.Text;
rNewWidget.m_nTextStyle = rControl.TextStyle &
- ( TEXT_DRAW_LEFT | TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT | TEXT_DRAW_TOP |
- TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM |
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+ ( DrawTextFlags::Left | DrawTextFlags::Center | DrawTextFlags::Right | DrawTextFlags::Top |
+ DrawTextFlags::VCenter | DrawTextFlags::Bottom |
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak );
rNewWidget.m_nTabOrder = rControl.TabOrder;
// various properties are set via the flags (/Ff) property of the field dict
@@ -13323,10 +13323,10 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
if( rControl.getType() == PDFWriter::PushButton )
{
const PDFWriter::PushButtonWidget& rBtn = static_cast<const PDFWriter::PushButtonWidget&>(rControl);
- if( rNewWidget.m_nTextStyle == 0 )
+ if( rNewWidget.m_nTextStyle == DrawTextFlags::NONE )
rNewWidget.m_nTextStyle =
- TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER |
- TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK;
+ DrawTextFlags::Center | DrawTextFlags::VCenter |
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak;
rNewWidget.m_nFlags |= 0x00010000;
if( !rBtn.URL.isEmpty() )
@@ -13339,9 +13339,9 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
else if( rControl.getType() == PDFWriter::RadioButton )
{
const PDFWriter::RadioButtonWidget& rBtn = static_cast<const PDFWriter::RadioButtonWidget&>(rControl);
- if( rNewWidget.m_nTextStyle == 0 )
+ if( rNewWidget.m_nTextStyle == DrawTextFlags::NONE )
rNewWidget.m_nTextStyle =
- TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK;
+ DrawTextFlags::VCenter | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak;
/* PDF sees a RadioButton group as one radio button with
* children which are in turn check boxes
*
@@ -13375,9 +13375,9 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
else if( rControl.getType() == PDFWriter::CheckBox )
{
const PDFWriter::CheckBoxWidget& rBox = static_cast<const PDFWriter::CheckBoxWidget&>(rControl);
- if( rNewWidget.m_nTextStyle == 0 )
+ if( rNewWidget.m_nTextStyle == DrawTextFlags::NONE )
rNewWidget.m_nTextStyle =
- TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK;
+ DrawTextFlags::VCenter | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak;
rNewWidget.m_aValue = rBox.Checked ? OUString("Yes") : OUString("Off" );
// create default appearance before m_aRect gets transformed
@@ -13385,8 +13385,8 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
}
else if( rControl.getType() == PDFWriter::ListBox )
{
- if( rNewWidget.m_nTextStyle == 0 )
- rNewWidget.m_nTextStyle = TEXT_DRAW_VCENTER;
+ if( rNewWidget.m_nTextStyle == DrawTextFlags::NONE )
+ rNewWidget.m_nTextStyle = DrawTextFlags::VCenter;
const PDFWriter::ListBoxWidget& rLstBox = static_cast<const PDFWriter::ListBoxWidget&>(rControl);
rNewWidget.m_aListEntries = rLstBox.Entries;
@@ -13403,8 +13403,8 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
}
else if( rControl.getType() == PDFWriter::ComboBox )
{
- if( rNewWidget.m_nTextStyle == 0 )
- rNewWidget.m_nTextStyle = TEXT_DRAW_VCENTER;
+ if( rNewWidget.m_nTextStyle == DrawTextFlags::NONE )
+ rNewWidget.m_nTextStyle = DrawTextFlags::VCenter;
const PDFWriter::ComboBoxWidget& rBox = static_cast<const PDFWriter::ComboBoxWidget&>(rControl);
rNewWidget.m_aValue = rBox.Text;
@@ -13434,14 +13434,14 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
}
else if( rControl.getType() == PDFWriter::Edit )
{
- if( rNewWidget.m_nTextStyle == 0 )
- rNewWidget.m_nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER;
+ if( rNewWidget.m_nTextStyle == DrawTextFlags::NONE )
+ rNewWidget.m_nTextStyle = DrawTextFlags::Left | DrawTextFlags::VCenter;
const PDFWriter::EditWidget& rEdit = static_cast<const PDFWriter::EditWidget&>(rControl);
if( rEdit.MultiLine )
{
rNewWidget.m_nFlags |= 0x00001000;
- rNewWidget.m_nTextStyle |= TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK;
+ rNewWidget.m_nTextStyle |= DrawTextFlags::MultiLine | DrawTextFlags::WordBreak;
}
if( rEdit.Password )
rNewWidget.m_nFlags |= 0x00002000;
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 60e12f58786b..ccd8ada7ce18 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -446,7 +446,7 @@ public:
OString m_aName;
OUString m_aDescription;
OUString m_aText;
- sal_uInt16 m_nTextStyle;
+ DrawTextFlags m_nTextStyle;
OUString m_aValue;
OString m_aDAString;
OString m_aDRDict;
@@ -472,7 +472,7 @@ public:
PDFAppearanceMap m_aAppearances;
PDFWidget()
: m_eType( PDFWriter::PushButton ),
- m_nTextStyle( 0 ),
+ m_nTextStyle( DrawTextFlags::NONE ),
m_nFlags( 0 ),
m_nParent( 0 ),
m_nTabOrder( 0 ),
@@ -1206,7 +1206,7 @@ public:
void drawStretchText( const Point& rPos, sal_uLong nWidth, const OUString& rText,
sal_Int32 nIndex, sal_Int32 nLen,
bool bTextLines = true );
- void drawText( const Rectangle& rRect, const OUString& rOrigStr, sal_uInt16 nStyle, bool bTextLines = true );
+ void drawText( const Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle, bool bTextLines = true );
void drawTextLine( const Point& rPos, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, bool bUnderlineAbove );
void drawWaveTextLine( OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove );
void drawStraightTextLine( OStringBuffer& aLine, long nWidth, FontUnderline eTextLine, Color aColor, bool bIsAbove );
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index f6a054518550..5b369b6f218b 100644
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -88,7 +88,7 @@ namespace vcl
public:
// equivalents to the respective OutputDevice methods, which take the reference device into account
long GetTextArray( const OUString& _rText, long* _pDXAry, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const;
- Rectangle DrawText( const Rectangle& _rRect, const OUString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, OUString* _pDisplayText );
+ Rectangle DrawText( const Rectangle& _rRect, const OUString& _rText, DrawTextFlags _nStyle, MetricVector* _pVector, OUString* _pDisplayText );
protected:
void onBeginDrawText()
@@ -258,7 +258,7 @@ namespace vcl
return true;
}
- Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const OUString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, OUString* _pDisplayText )
+ Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const OUString& _rText, DrawTextFlags _nStyle, MetricVector* _pVector, OUString* _pDisplayText )
{
if ( _rText.isEmpty() )
return Rectangle();
@@ -317,7 +317,7 @@ namespace vcl
{
}
- Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const OUString& _rText, sal_uInt16 _nStyle,
+ Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const OUString& _rText, DrawTextFlags _nStyle,
MetricVector* _pVector, OUString* _pDisplayText )
{
return m_pImpl->DrawText( _rRect, _rText, _nStyle, _pVector, _pDisplayText );
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 832cdbc4d0a5..e860df14073c 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -52,7 +52,7 @@
#endif
-#define TEXT_DRAW_ELLIPSIS (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS | TEXT_DRAW_NEWSELLIPSIS)
+#define TEXT_DRAW_ELLIPSIS (DrawTextFlags::EndEllipsis | DrawTextFlags::PathEllipsis | DrawTextFlags::NewsEllipsis)
ImplMultiTextLineInfo::ImplMultiTextLineInfo()
{
@@ -494,7 +494,7 @@ void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
long nWidth, const OUString& rStr,
- sal_uInt16 nStyle, const vcl::ITextLayout& _rLayout )
+ DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout )
{
DBG_ASSERTWARNING( nWidth >= 0, "ImplGetTextLines: nWidth <= 0!" );
@@ -509,8 +509,8 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
// get service provider
css::uno::Reference< css::uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
- bool bHyphenate = (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION)
- == TEXT_DRAW_WORDBREAK_HYPHENATION;
+ bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation)
+ == DrawTextFlags::WordBreakHyphenation;
css::uno::Reference< css::linguistic2::XHyphenator > xHyph;
if ( bHyphenate )
{
@@ -528,7 +528,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
nBreakPos++;
long nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
- if ( ( nLineWidth > nWidth ) && ( nStyle & TEXT_DRAW_WORDBREAK ) )
+ if ( ( nLineWidth > nWidth ) && ( nStyle & DrawTextFlags::WordBreak ) )
{
if ( !xBI.is() )
xBI = vcl::unohelper::CreateBreakIterator();
@@ -1535,7 +1535,7 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
}
void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
- const OUString& rOrigStr, sal_uInt16 nStyle,
+ const OUString& rOrigStr, DrawTextFlags nStyle,
MetricVector* pVector, OUString* pDisplayText,
vcl::ITextLayout& _rLayout )
{
@@ -1543,7 +1543,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
Color aOldTextColor;
Color aOldTextFillColor;
bool bRestoreFillColor = false;
- if ( (nStyle & TEXT_DRAW_DISABLE) && ! pVector )
+ if ( (nStyle & DrawTextFlags::Disable) && ! pVector )
{
bool bHighContrastBlack = false;
bool bHighContrastWhite = false;
@@ -1584,7 +1584,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
long nWidth = rRect.GetWidth();
long nHeight = rRect.GetHeight();
- if ( ((nWidth <= 0) || (nHeight <= 0)) && (nStyle & TEXT_DRAW_CLIP) )
+ if ( ((nWidth <= 0) || (nHeight <= 0)) && (nStyle & DrawTextFlags::Clip) )
return;
Point aPos = rRect.TopLeft();
@@ -1594,13 +1594,13 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
sal_Int32 nMnemonicPos = -1;
OUString aStr = rOrigStr;
- if ( nStyle & TEXT_DRAW_MNEMONIC )
+ if ( nStyle & DrawTextFlags::Mnemonic )
aStr = GetNonMnemonicString( aStr, nMnemonicPos );
const bool bDrawMnemonics = !(rTargetDevice.GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector;
// We treat multiline text differently
- if ( nStyle & TEXT_DRAW_MULTILINE )
+ if ( nStyle & DrawTextFlags::MultiLine )
{
OUString aLastLine;
@@ -1619,7 +1619,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
nLines = 1;
if ( nFormatLines > nLines )
{
- if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ if ( nStyle & DrawTextFlags::EndEllipsis )
{
// Create last line and shorten it
nFormatLines = nLines-1;
@@ -1636,31 +1636,31 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
}
aLastLine = aLastLineBuffer.makeStringAndClear();
aLastLine = ImplGetEllipsisString( rTargetDevice, aLastLine, nWidth, nStyle, _rLayout );
- nStyle &= ~(TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM);
- nStyle |= TEXT_DRAW_TOP;
+ nStyle &= ~DrawTextFlags(DrawTextFlags::VCenter | DrawTextFlags::Bottom);
+ nStyle |= DrawTextFlags::Top;
}
}
else
{
if ( nMaxTextWidth <= nWidth )
- nStyle &= ~TEXT_DRAW_CLIP;
+ nStyle &= ~DrawTextFlags::Clip;
}
// Do we need to clip the height?
if ( nFormatLines*nTextHeight > nHeight )
- nStyle |= TEXT_DRAW_CLIP;
+ nStyle |= DrawTextFlags::Clip;
// Set clipping
- if ( nStyle & TEXT_DRAW_CLIP )
+ if ( nStyle & DrawTextFlags::Clip )
{
rTargetDevice.Push( PushFlags::CLIPREGION );
rTargetDevice.IntersectClipRegion( rRect );
}
// Vertical alignment
- if ( nStyle & TEXT_DRAW_BOTTOM )
+ if ( nStyle & DrawTextFlags::Bottom )
aPos.Y() += nHeight-(nFormatLines*nTextHeight);
- else if ( nStyle & TEXT_DRAW_VCENTER )
+ else if ( nStyle & DrawTextFlags::VCenter )
aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2;
// Font alignment
@@ -1673,9 +1673,9 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
for ( i = 0; i < nFormatLines; i++ )
{
pLineInfo = aMultiLineInfo.GetLine( i );
- if ( nStyle & TEXT_DRAW_RIGHT )
+ if ( nStyle & DrawTextFlags::Right )
aPos.X() += nWidth-pLineInfo->GetWidth();
- else if ( nStyle & TEXT_DRAW_CENTER )
+ else if ( nStyle & DrawTextFlags::Center )
aPos.X() += (nWidth-pLineInfo->GetWidth())/2;
sal_Int32 nIndex = pLineInfo->GetIndex();
sal_Int32 nLineLen = pLineInfo->GetLen();
@@ -1710,7 +1710,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
_rLayout.DrawText( aPos, aLastLine, 0, aLastLine.getLength(), pVector, pDisplayText );
// Reset clipping
- if ( nStyle & TEXT_DRAW_CLIP )
+ if ( nStyle & DrawTextFlags::Clip )
rTargetDevice.Pop();
}
}
@@ -1724,21 +1724,21 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
if ( nStyle & TEXT_DRAW_ELLIPSIS )
{
aStr = ImplGetEllipsisString( rTargetDevice, aStr, nWidth, nStyle, _rLayout );
- nStyle &= ~(TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT);
- nStyle |= TEXT_DRAW_LEFT;
+ nStyle &= ~DrawTextFlags(DrawTextFlags::Center | DrawTextFlags::Right);
+ nStyle |= DrawTextFlags::Left;
nTextWidth = _rLayout.GetTextWidth( aStr, 0, aStr.getLength() );
}
}
else
{
if ( nTextHeight <= nHeight )
- nStyle &= ~TEXT_DRAW_CLIP;
+ nStyle &= ~DrawTextFlags::Clip;
}
// horizontal text alignment
- if ( nStyle & TEXT_DRAW_RIGHT )
+ if ( nStyle & DrawTextFlags::Right )
aPos.X() += nWidth-nTextWidth;
- else if ( nStyle & TEXT_DRAW_CENTER )
+ else if ( nStyle & DrawTextFlags::Center )
aPos.X() += (nWidth-nTextWidth)/2;
// vertical font alignment
@@ -1747,9 +1747,9 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
else if ( eAlign == ALIGN_BASELINE )
aPos.Y() += rTargetDevice.GetFontMetric().GetAscent();
- if ( nStyle & TEXT_DRAW_BOTTOM )
+ if ( nStyle & DrawTextFlags::Bottom )
aPos.Y() += nHeight-nTextHeight;
- else if ( nStyle & TEXT_DRAW_VCENTER )
+ else if ( nStyle & DrawTextFlags::VCenter )
aPos.Y() += (nHeight-nTextHeight)/2;
long nMnemonicX = 0;
@@ -1768,7 +1768,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() );
}
- if ( nStyle & TEXT_DRAW_CLIP )
+ if ( nStyle & DrawTextFlags::Clip )
{
rTargetDevice.Push( PushFlags::CLIPREGION );
rTargetDevice.IntersectClipRegion( rRect );
@@ -1791,7 +1791,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
}
}
- if ( nStyle & TEXT_DRAW_DISABLE && !pVector )
+ if ( nStyle & DrawTextFlags::Disable && !pVector )
{
rTargetDevice.SetTextColor( aOldTextColor );
if ( bRestoreFillColor )
@@ -1801,7 +1801,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
void OutputDevice::AddTextRectActions( const Rectangle& rRect,
const OUString& rOrigStr,
- sal_uInt16 nStyle,
+ DrawTextFlags nStyle,
GDIMetaFile& rMtf )
{
@@ -1832,7 +1832,7 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
mpMetaFile = pMtf;
}
-void OutputDevice::DrawText( const Rectangle& rRect, const OUString& rOrigStr, sal_uInt16 nStyle,
+void OutputDevice::DrawText( const Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle,
MetricVector* pVector, OUString* pDisplayText,
vcl::ITextLayout* _pTextLayout )
{
@@ -1876,7 +1876,7 @@ void OutputDevice::DrawText( const Rectangle& rRect, const OUString& rOrigStr, s
}
Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
- const OUString& rStr, sal_uInt16 nStyle,
+ const OUString& rStr, DrawTextFlags nStyle,
TextRectInfo* pInfo,
const vcl::ITextLayout* _pTextLayout ) const
{
@@ -1888,10 +1888,10 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
long nTextHeight = GetTextHeight();
OUString aStr = rStr;
- if ( nStyle & TEXT_DRAW_MNEMONIC )
+ if ( nStyle & DrawTextFlags::Mnemonic )
aStr = GetNonMnemonicString( aStr );
- if ( nStyle & TEXT_DRAW_MULTILINE )
+ if ( nStyle & DrawTextFlags::MultiLine )
{
ImplMultiTextLineInfo aMultiLineInfo;
ImplTextLineInfo* pLineInfo;
@@ -1913,7 +1913,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
nLines = nFormatLines;
else
{
- if ( !(nStyle & TEXT_DRAW_ENDELLIPSIS) )
+ if ( !(nStyle & DrawTextFlags::EndEllipsis) )
nLines = nFormatLines;
else
{
@@ -1964,9 +1964,9 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
}
}
- if ( nStyle & TEXT_DRAW_RIGHT )
+ if ( nStyle & DrawTextFlags::Right )
aRect.Left() = aRect.Right()-nMaxWidth+1;
- else if ( nStyle & TEXT_DRAW_CENTER )
+ else if ( nStyle & DrawTextFlags::Center )
{
aRect.Left() += (nWidth-nMaxWidth)/2;
aRect.Right() = aRect.Left()+nMaxWidth-1;
@@ -1974,9 +1974,9 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
else
aRect.Right() = aRect.Left()+nMaxWidth-1;
- if ( nStyle & TEXT_DRAW_BOTTOM )
+ if ( nStyle & DrawTextFlags::Bottom )
aRect.Top() = aRect.Bottom()-(nTextHeight*nLines)+1;
- else if ( nStyle & TEXT_DRAW_VCENTER )
+ else if ( nStyle & DrawTextFlags::VCenter )
{
aRect.Top() += (aRect.GetHeight()-(nTextHeight*nLines))/2;
aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1;
@@ -1985,7 +1985,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1;
// #99188# get rid of rounding problems when using this rect later
- if (nStyle & TEXT_DRAW_RIGHT)
+ if (nStyle & DrawTextFlags::Right)
aRect.Left()--;
else
aRect.Right()++;
@@ -2005,21 +2005,21 @@ static bool ImplIsCharIn( sal_Unicode c, const sal_Char* pStr )
}
OUString OutputDevice::GetEllipsisString( const OUString& rOrigStr, long nMaxWidth,
- sal_uInt16 nStyle ) const
+ DrawTextFlags nStyle ) const
{
vcl::DefaultTextLayout aTextLayout( *const_cast< OutputDevice* >( this ) );
return ImplGetEllipsisString( *this, rOrigStr, nMaxWidth, nStyle, aTextLayout );
}
OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, const OUString& rOrigStr, long nMaxWidth,
- sal_uInt16 nStyle, const vcl::ITextLayout& _rLayout )
+ DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout )
{
OUString aStr = rOrigStr;
sal_Int32 nIndex = _rLayout.GetTextBreak( aStr, nMaxWidth, 0, aStr.getLength() );
if ( nIndex != -1 )
{
- if( (nStyle & TEXT_DRAW_CENTERELLIPSIS) == TEXT_DRAW_CENTERELLIPSIS )
+ if( (nStyle & DrawTextFlags::CenterEllipsis) == DrawTextFlags::CenterEllipsis )
{
OUStringBuffer aTmpStr( aStr );
// speed it up by removing all but 1.33x as many as the break pos.
@@ -2033,7 +2033,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
}
aStr = aTmpStr.makeStringAndClear();
}
- else if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ else if ( nStyle & DrawTextFlags::EndEllipsis )
{
aStr = aStr.copy(0, nIndex);
if ( nIndex > 1 )
@@ -2047,17 +2047,17 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
}
}
- if ( aStr.isEmpty() && (nStyle & TEXT_DRAW_CLIP) )
+ if ( aStr.isEmpty() && (nStyle & DrawTextFlags::Clip) )
aStr += OUString(rOrigStr[ 0 ]);
}
- else if ( nStyle & TEXT_DRAW_PATHELLIPSIS )
+ else if ( nStyle & DrawTextFlags::PathEllipsis )
{
OUString aPath( rOrigStr );
OUString aAbbreviatedPath;
osl_abbreviateSystemPath( aPath.pData, &aAbbreviatedPath.pData, nIndex, NULL );
aStr = aAbbreviatedPath;
}
- else if ( nStyle & TEXT_DRAW_NEWSELLIPSIS )
+ else if ( nStyle & DrawTextFlags::NewsEllipsis )
{
static sal_Char const pSepChars[] = ".";
// Determine last section
@@ -2076,7 +2076,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
OUString aTempLastStr1( "..." );
aTempLastStr1 += aLastStr;
if ( _rLayout.GetTextWidth( aTempLastStr1, 0, aTempLastStr1.getLength() ) > nMaxWidth )
- aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
+ aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout );
else
{
sal_Int32 nFirstContent = 0;
@@ -2091,7 +2091,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
nFirstContent++;
// MEM continue here
if ( nFirstContent >= nLastContent )
- aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
+ aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout );
else
{
if ( nFirstContent > 4 )
@@ -2100,7 +2100,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
aFirstStr += "...";
OUString aTempStr = aFirstStr + aLastStr;
if ( _rLayout.GetTextWidth( aTempStr, 0, aTempStr.getLength() ) > nMaxWidth )
- aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
+ aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout );
else
{
do
@@ -2140,7 +2140,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
sal_Int32 nIndex, sal_Int32 nLen,
- sal_uInt16 nStyle, MetricVector* pVector, OUString* pDisplayText )
+ DrawTextFlags nStyle, MetricVector* pVector, OUString* pDisplayText )
{
if(nLen == 0x0FFFF)
@@ -2178,7 +2178,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
long nMnemonicX = 0;
long nMnemonicY = 0;
long nMnemonicWidth = 0;
- if ( (nStyle & TEXT_DRAW_MNEMONIC) && nLen > 1 )
+ if ( (nStyle & DrawTextFlags::Mnemonic) && nLen > 1 )
{
aStr = GetNonMnemonicString( aStr, nMnemonicPos );
if ( nMnemonicPos != -1 )
@@ -2222,7 +2222,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
}
}
- if ( nStyle & TEXT_DRAW_DISABLE && ! pVector )
+ if ( nStyle & DrawTextFlags::Disable && ! pVector )
{
Color aOldTextColor;
Color aOldTextFillColor;
@@ -2283,7 +2283,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
long OutputDevice::GetCtrlTextWidth( const OUString& rStr,
sal_Int32 nIndex, sal_Int32 nLen,
- sal_uInt16 nStyle ) const
+ DrawTextFlags nStyle ) const
{
if(nLen == 0x0FFFF)
{
@@ -2296,7 +2296,7 @@ long OutputDevice::GetCtrlTextWidth( const OUString& rStr,
nLen = rStr.getLength() - nIndex;
}
- if ( nStyle & TEXT_DRAW_MNEMONIC )
+ if ( nStyle & DrawTextFlags::Mnemonic )
{
sal_Int32 nMnemonicPos;
OUString aStr = GetNonMnemonicString( rStr, nMnemonicPos );
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index d68c2e1e9aa8..0777ad34587a 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1664,7 +1664,7 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p
if (pOffset)
aInRect.Move(pOffset->X(), pOffset->Y());
- sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP;
+ DrawTextFlags nTextStyle = DrawTextFlags::Left | DrawTextFlags::VCenter | DrawTextFlags::EndEllipsis | DrawTextFlags::Clip;
// must show tooltip ?
TextRectInfo aInfo;
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 7a32856e920c..9cefd27c8f7d 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1745,7 +1745,7 @@ static OUString getShortenedString( const OUString& i_rLong, vcl::RenderContext&
{
sal_Int32 nPos = -1;
OUString aNonMnem(OutputDevice::GetNonMnemonicString(i_rLong, nPos));
- aNonMnem = rRenderContext.GetEllipsisString( aNonMnem, i_nMaxWidth, TEXT_DRAW_CENTERELLIPSIS);
+ aNonMnem = rRenderContext.GetEllipsisString( aNonMnem, i_nMaxWidth, DrawTextFlags::CenterEllipsis);
// re-insert mnemonic
if (nPos != -1)
{
@@ -1861,7 +1861,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
long nTextOffsetY = ((pData->aSz.Height() - nFontHeight) / 2);
if (IsMenuBar())
nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2;
- sal_uInt16 nTextStyle = 0;
+ DrawTextFlags nTextStyle = DrawTextFlags::NONE;
DrawSymbolFlags nSymbolStyle = DrawSymbolFlags::NONE;
sal_uInt16 nImageStyle = 0;
@@ -1871,7 +1871,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
// asynchronous loading
if (!pData->bEnabled)
{
- nTextStyle |= TEXT_DRAW_DISABLE;
+ nTextStyle |= DrawTextFlags::Disable;
nSymbolStyle |= DrawSymbolFlags::Disable;
nImageStyle |= IMAGE_DRAW_DISABLE;
}
@@ -2009,9 +2009,9 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
aTmpPos.X() = aPos.X() + nTextPos;
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
- sal_uInt16 nStyle = nTextStyle | TEXT_DRAW_MNEMONIC;
+ DrawTextFlags nStyle = nTextStyle | DrawTextFlags::Mnemonic;
if (pData->bIsTemporary)
- nStyle |= TEXT_DRAW_DISABLE;
+ nStyle |= DrawTextFlags::Disable;
MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
OUString* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
if (bLayout)
@@ -2022,7 +2022,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
}
// #i47946# with NWF painted menus the background is transparent
// since DrawCtrlText can depend on the background (e.g. for
- // TEXT_DRAW_DISABLE), temporarily set a background which
+ // DrawTextFlags::Disable), temporarily set a background which
// hopefully matches the NWF background since it is read
// from the system style settings
bool bSetTmpBackground = !rRenderContext.IsBackground()
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 0e7e08878184..659c3fe33449 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -194,7 +194,7 @@ void MessBox::ImplPosControls()
long nMaxLineWidth;
long nWidth;
WinBits nWinStyle = WB_LEFT | WB_NOLABEL;
- sal_uInt16 nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT;
+ DrawTextFlags nTextStyle = DrawTextFlags::MultiLine | DrawTextFlags::Top | DrawTextFlags::Left;
mpVCLMultiLineEdit.disposeAndClear();
mpFixedImage.disposeAndClear();
@@ -245,7 +245,7 @@ void MessBox::ImplPosControls()
// Determine maximum line length without wordbreak
aFormatRect = GetTextRect( aRect, aMessText, nTextStyle, &aTextInfo );
nMaxLineWidth = aFormatRect.GetWidth();
- nTextStyle |= TEXT_DRAW_WORDBREAK;
+ nTextStyle |= DrawTextFlags::WordBreak;
// Determine the width for text formatting
if ( nMaxLineWidth > 450 )
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 2b13051b3a37..9901843401ca 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -179,8 +179,8 @@ void PrintDialog::PrintPreviewWindow::Paint(vcl::RenderContext& rRenderContext,
SetZoomedPointFont(rRenderContext, aFont);
Rectangle aTextRect(aOffset + Point(2, 2), Size(maPreviewSize.Width() - 4, maPreviewSize.Height() - 4));
rRenderContext.DrawText(aTextRect, maReplacementString,
- TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER |
- TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE);
+ DrawTextFlags::Center | DrawTextFlags::VCenter |
+ DrawTextFlags::WordBreak | DrawTextFlags::MultiLine);
rRenderContext.Pop();
}
else
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index a997130af601..a3273ece1047 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -396,12 +396,12 @@ void StatusBar::ImplDrawText(vcl::RenderContext& rRenderContext, bool bOffScreen
mpImplData->mpVirDev->SetOutputSizePixel( aVirDevSize );
Rectangle aTempRect = aTextRect;
aTempRect.SetPos(Point(0, 0));
- mpImplData->mpVirDev->DrawText( aTempRect, aStr, TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_CLIP | TEXT_DRAW_ENDELLIPSIS );
+ mpImplData->mpVirDev->DrawText( aTempRect, aStr, DrawTextFlags::Left | DrawTextFlags::Top | DrawTextFlags::Clip | DrawTextFlags::EndEllipsis );
rRenderContext.DrawOutDev(aTextRect.TopLeft(), aVirDevSize, Point(), aVirDevSize, *mpImplData->mpVirDev);
}
else
{
- rRenderContext.DrawText(aTextRect, aStr, TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_CLIP | TEXT_DRAW_ENDELLIPSIS);
+ rRenderContext.DrawText(aTextRect, aStr, DrawTextFlags::Left | DrawTextFlags::Top | DrawTextFlags::Clip | DrawTextFlags::EndEllipsis);
}
}
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index e1a25f484c5c..438a405290cc 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3096,7 +3096,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos,
mpData->m_pLayoutData->m_aLineItemIds.push_back( pItem->mnId );
mpData->m_pLayoutData->m_aLineItemPositions.push_back( nPos );
}
- DrawCtrlText( aPos, pItem->maText, 0, pItem->maText.getLength(), TEXT_DRAW_MNEMONIC, pVector, pDisplayText );
+ DrawCtrlText( aPos, pItem->maText, 0, pItem->maText.getLength(), DrawTextFlags::Mnemonic, pVector, pDisplayText );
if (bClip)
rRenderContext.SetClipRegion();
rRenderContext.SetFont(aOldFont);
@@ -3250,9 +3250,9 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos,
ImplDrawButton(rRenderContext, pItem->maRect, nHighlight, pItem->meState == TRISTATE_TRUE, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow );
}
- sal_uInt16 nTextStyle = 0;
+ DrawTextFlags nTextStyle = DrawTextFlags::NONE;
if ( !pItem->mbEnabled )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ nTextStyle |= DrawTextFlags::Disable;
if( bLayout )
{
mpData->m_pLayoutData->m_aLineIndices.push_back( mpData->m_pLayoutData->m_aDisplayText.getLength() );
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index fc44e8062aa5..2ebea2dc44c3 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -269,7 +269,7 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
rRenderContext.DrawText(Rectangle(Point((aPaperSize.Width() - 4000) / 2, 2000),
Size(aPaperSize.Width() - 2100 - nMaxWidth, aPaperSize.Height() - 4000)),
aPrintText.makeStringAndClear(),
- TEXT_DRAW_MULTILINE);
+ DrawTextFlags::MultiLine);
}
rRenderContext.SetFillColor();
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 3bb2ccf99ac9..bbd135b4842a 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1545,8 +1545,8 @@ class DemoPopup : public FloatingWindow
SetTextColor(COL_BLACK);
SetTextAlign(ALIGN_TOP);
DrawText(aTextRect, "This is a standalone help text test",
- TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
- TEXT_DRAW_LEFT|TEXT_DRAW_TOP);
+ DrawTextFlags::MultiLine|DrawTextFlags::WordBreak|
+ DrawTextFlags::Left|DrawTextFlags::Top);
SetLineColor(COL_BLACK);
SetFillColor();