[Libreoffice-commits] core.git: basctl/source canvas/source cppcanvas/source cui/source desktop/source drawinglayer/source editeng/source emfio/source filter/source include/tools sc/source sfx2/source slideshow/source starmath/source svx/source sw/source vcl/qa vcl/source vcl/workben
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 18 10:54:09 UTC 2021
basctl/source/basicide/baside2.cxx | 4 +-
basctl/source/dlged/dlged.cxx | 4 +-
canvas/source/cairo/cairo_canvasfont.cxx | 2 -
canvas/source/directx/dx_textlayout_drawhelper.cxx | 4 +-
canvas/source/opengl/ogl_canvashelper.cxx | 2 -
canvas/source/vcl/canvasfont.cxx | 2 -
canvas/source/vcl/spritecanvashelper.cxx | 2 -
canvas/source/vcl/spritehelper.cxx | 2 -
cppcanvas/source/inc/outdevstate.hxx | 2 -
cppcanvas/source/mtfrenderer/mtftools.cxx | 26 +++++++++-------
cui/source/dialogs/cuicharmap.cxx | 2 -
desktop/source/splash/splash.cxx | 2 -
drawinglayer/source/primitive2d/textlayoutdevice.cxx | 2 -
drawinglayer/source/tools/wmfemfhelper.cxx | 6 +--
editeng/source/editeng/editdoc.cxx | 2 -
editeng/source/items/bulitem.cxx | 2 -
editeng/source/outliner/outliner.cxx | 4 +-
emfio/source/reader/mtftools.cxx | 6 +--
filter/source/pdf/pdfexport.cxx | 4 +-
filter/source/svg/svgfontexport.cxx | 2 -
filter/source/svg/svgwriter.cxx | 8 ++--
include/tools/fontenum.hxx | 10 ------
sc/source/ui/view/gridwin4.cxx | 2 -
sc/source/ui/view/output2.cxx | 2 -
sfx2/source/control/charwin.cxx | 2 -
slideshow/source/engine/rehearsetimingsactivity.cxx | 2 -
starmath/source/dialog.cxx | 10 +++---
starmath/source/format.cxx | 4 +-
starmath/source/rect.cxx | 2 -
starmath/source/symbol.cxx | 4 +-
starmath/source/unomodel.cxx | 2 -
starmath/source/utility.cxx | 2 -
starmath/source/view.cxx | 4 +-
starmath/source/visitors.cxx | 4 +-
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 4 +-
svx/source/dialog/charmap.cxx | 4 +-
svx/source/dialog/fntctrl.cxx | 4 +-
svx/source/dialog/searchcharmap.cxx | 2 -
svx/source/svdraw/svdfmtf.cxx | 4 +-
svx/source/svdraw/svdpdf.cxx | 4 +-
sw/source/core/text/inftxt.cxx | 2 -
sw/source/core/text/porrst.cxx | 2 -
sw/source/core/txtnode/swfont.cxx | 4 +-
sw/source/uibase/uiview/srcview.cxx | 2 -
vcl/qa/cppunit/font.cxx | 6 +--
vcl/qa/cppunit/svm/svmtest.cxx | 2 -
vcl/source/app/help.cxx | 2 -
vcl/source/edit/texteng.cxx | 2 -
vcl/source/filter/eps/eps.cxx | 8 ++--
vcl/source/filter/idxf/dxf2mtf.cxx | 2 -
vcl/source/filter/imet/ios2met.cxx | 2 -
vcl/source/filter/ipict/ipict.cxx | 2 -
vcl/source/filter/wmf/emfwr.cxx | 12 +------
vcl/source/filter/wmf/wmfwr.cxx | 22 ++++---------
vcl/source/font/font.cxx | 2 -
vcl/source/gdi/metaact.cxx | 2 -
vcl/source/gdi/mtfxmldump.cxx | 7 ++--
vcl/source/gdi/pdfwriter_impl.cxx | 12 +++----
vcl/source/outdev/font.cxx | 10 +++---
vcl/source/outdev/outdevstate.cxx | 2 -
vcl/source/outdev/text.cxx | 8 ++--
vcl/workben/vcldemo.cxx | 2 -
62 files changed, 131 insertions(+), 146 deletions(-)
New commits:
commit 88bf1749f1eb7322106da1254e349f51f5df0df5
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 18 09:25:40 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 18 12:53:31 2021 +0200
undo changes to TextAlign
revert commit 8689bd5490b473a7ffb149bbe5f7f0683f679c72
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jul 29 20:49:29 2021 +0100
convert TextAlign to scoped enum
lets leave this as it always was
Change-Id: Id4d2a5644974cdd2b0ed6d361d5c52629674d057
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120626
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index d5f1e07e6e4f..4e562420ef19 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -121,7 +121,7 @@ void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, sal_uInt16 nCurPage,
vcl::Font aFont( aOldFont );
aFont.SetWeight( WEIGHT_BOLD );
- aFont.SetAlignment( TextAlign::Bottom );
+ aFont.SetAlignment( ALIGN_BOTTOM );
pPrinter->SetFont( aFont );
tools::Long nFontHeight = pPrinter->GetTextHeight();
@@ -829,7 +829,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
vcl::Font aOldFont( pPrinter->GetFont() );
vcl::Font aFont( GetEditEngine()->GetFont() );
- aFont.SetAlignment( TextAlign::Bottom );
+ aFont.SetAlignment( ALIGN_BOTTOM );
aFont.SetTransparent( true );
aFont.SetFontSize( Size( 0, 360 ) );
pPrinter->SetFont( aFont );
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index e54ab203411c..34467260c140 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -1106,7 +1106,7 @@ static void lcl_PrintHeader( Printer* pPrinter, const OUString& rTitle ) // not
vcl::Font aFont( pPrinter->GetFont() );
aFont.SetWeight( WEIGHT_BOLD );
- aFont.SetAlignment( TextAlign::Bottom );
+ aFont.SetAlignment( ALIGN_BOTTOM );
pPrinter->SetFont( aFont );
tools::Long const nFontHeight = pPrinter->GetTextHeight();
@@ -1148,7 +1148,7 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor
MapMode aMap( MapUnit::Map100thMM );
pPrinter->SetMapMode( aMap );
vcl::Font aFont;
- aFont.SetAlignment( TextAlign::Bottom );
+ aFont.SetAlignment( ALIGN_BOTTOM );
aFont.SetFontSize( Size( 0, 360 ));
pPrinter->SetFont( aFont );
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx
index 3270432b7a31..cca052d167e0 100644
--- a/canvas/source/cairo/cairo_canvasfont.cxx
+++ b/canvas/source/cairo/cairo_canvasfont.cxx
@@ -45,7 +45,7 @@ namespace cairocanvas
maFontRequest( rFontRequest ),
mpRefDevice( rDevice )
{
- maFont->SetAlignment( TextAlign::Baseline );
+ maFont->SetAlignment( ALIGN_BASELINE );
maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==css::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
maFont->SetVertical( rFontRequest.FontDescription.IsVertical==css::util::TriState_YES );
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx
index c6d8d76ea9f5..1ffeb612de3d 100644
--- a/canvas/source/directx/dx_textlayout_drawhelper.cxx
+++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx
@@ -111,7 +111,7 @@ namespace dxcanvas
rFontRequest.FontDescription.StyleName,
Size( 0, ::basegfx::fround(rFontRequest.CellSize)));
- aFont.SetAlignment( TextAlign::Baseline );
+ aFont.SetAlignment( ALIGN_BASELINE );
aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==css::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
aFont.SetVertical( rFontRequest.FontDescription.IsVertical==css::util::TriState_YES );
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
@@ -251,7 +251,7 @@ namespace dxcanvas
rFontRequest.FontDescription.StyleName,
Size( 0, ::basegfx::fround(rFontRequest.CellSize)));
- aFont.SetAlignment( TextAlign::Baseline );
+ aFont.SetAlignment( ALIGN_BASELINE );
aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==css::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
aFont.SetVertical( rFontRequest.FontDescription.IsVertical==css::util::TriState_YES );
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index a7e15a6cf45d..0484f710ae53 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -692,7 +692,7 @@ namespace oglcanvas
rFontRequest.FontDescription.StyleName,
Size( 0, ::basegfx::fround(rFontRequest.CellSize)));
- aFont.SetAlignment( TextAlign::Baseline );
+ aFont.SetAlignment( ALIGN_BASELINE );
aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
aFont.SetVertical( rFontRequest.FontDescription.IsVertical==util::TriState_YES );
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 0a5c29506134..e7fab0492549 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -49,7 +49,7 @@ namespace vclcanvas
mpRefDevice( &rDevice ),
mpOutDevProvider( rOutDevProvider )
{
- maFont->SetAlignment( TextAlign::Baseline );
+ maFont->SetAlignment( ALIGN_BASELINE );
maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==css::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
maFont->SetVertical( rFontRequest.FontDescription.IsVertical==css::util::TriState_YES );
diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx
index 0b7479aa19a9..1796c8ac7ffe 100644
--- a/canvas/source/vcl/spritecanvashelper.cxx
+++ b/canvas/source/vcl/spritecanvashelper.cxx
@@ -107,7 +107,7 @@ namespace vclcanvas
aVCLFont.SetFontHeight( 20 );
aVCLFont.SetColor( INFO_COLOR );
- rOutDev.SetTextAlign(TextAlign::Top);
+ rOutDev.SetTextAlign(ALIGN_TOP);
rOutDev.SetTextColor( INFO_COLOR );
rOutDev.SetFont( aVCLFont );
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index feba1b7c10b4..57b38a9a2815 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -215,7 +215,7 @@ namespace vclcanvas
aVCLFont.SetFontHeight( std::min(::tools::Long(20),aOutputSize.Height()) );
aVCLFont.SetColor( COL_RED );
- rTargetSurface.SetTextAlign(TextAlign::Top);
+ rTargetSurface.SetTextAlign(ALIGN_TOP);
rTargetSurface.SetTextColor( COL_RED );
rTargetSurface.SetFont( aVCLFont );
diff --git a/cppcanvas/source/inc/outdevstate.hxx b/cppcanvas/source/inc/outdevstate.hxx
index 09b70b6cdcd5..16cc3c4ff25a 100644
--- a/cppcanvas/source/inc/outdevstate.hxx
+++ b/cppcanvas/source/inc/outdevstate.hxx
@@ -63,7 +63,7 @@ namespace cppcanvas::internal
textOverlineStyle(LINESTYLE_NONE),
textUnderlineStyle(LINESTYLE_NONE),
textStrikeoutStyle(STRIKEOUT_NONE),
- textReferencePoint(TextAlign::Baseline),
+ textReferencePoint(ALIGN_BASELINE),
isTextOutlineModeSet( false ),
isTextEffectShadowSet( false ),
diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx
index 52e35b73dc0c..c5d36eb00652 100644
--- a/cppcanvas/source/mtfrenderer/mtftools.cxx
+++ b/cppcanvas/source/mtfrenderer/mtftools.cxx
@@ -51,24 +51,28 @@ namespace cppcanvas::tools
::Size getBaselineOffset( const ::cppcanvas::internal::OutDevState& outdevState,
const VirtualDevice& rVDev )
{
- ::Size aRet(0, 0);
const ::FontMetric& aMetric = rVDev.GetFontMetric();
// calc offset for text output, the XCanvas always renders
// baseline offset.
switch( outdevState.textReferencePoint )
{
- case TextAlign::Baseline:
- break;
- case TextAlign::Top:
- aRet = ::Size(0, aMetric.GetInternalLeading() + aMetric.GetAscent());
- break;
- case TextAlign::Bottom:
- aRet = ::Size(0, -aMetric.GetDescent());
- break;
- }
+ case ALIGN_TOP:
+ return ::Size( 0,
+ aMetric.GetInternalLeading() + aMetric.GetAscent() );
- return aRet;
+ default:
+ ENSURE_OR_THROW( false,
+ "tools::getBaselineOffset(): Unexpected TextAlign value" );
+ // FALLTHROUGH intended (to calm compiler warning - case won't happen)
+ case ALIGN_BASELINE:
+ return ::Size( 0, 0 );
+
+ case ALIGN_BOTTOM:
+ return ::Size( 0,
+ -aMetric.GetDescent() );
+
+ }
}
::basegfx::B2DHomMatrix& calcLogic2PixelLinearTransform( ::basegfx::B2DHomMatrix& o_rMatrix,
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 9036009c1bb9..c8bf07cc5794 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -1242,7 +1242,7 @@ void SvxShowText::SetFont( const vcl::Font& rFont )
m_aFont = rFont;
m_aFont.SetWeight(WEIGHT_NORMAL);
- m_aFont.SetAlignment(TextAlign::Top);
+ m_aFont.SetAlignment(ALIGN_TOP);
m_aFont.SetFontSize(m_xVirDev->PixelToLogic(Size(0, nWinHeight / 2)));
m_aFont.SetTransparent(true);
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index f59e179de5f3..e61f87041207 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -609,7 +609,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const tools::
_vdev->DrawRect(tools::Rectangle(pSpl->_tlx+pSpl->_barspace, pSpl->_tly+pSpl->_barspace, pSpl->_tlx+pSpl->_barspace+length, pSpl->_tly+pSpl->_barheight-pSpl->_barspace));
vcl::Font aFont;
aFont.SetFontSize(Size(0, 12));
- aFont.SetAlignment(TextAlign::Baseline);
+ aFont.SetAlignment(ALIGN_BASELINE);
_vdev->SetFont(aFont);
_vdev->SetTextColor(pSpl->_cProgressTextColor);
_vdev->DrawText(Point(pSpl->_tlx, pSpl->_textBaseline), pSpl->_sProgressText);
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index dff9d3558d89..933476b2045a 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -367,7 +367,7 @@ vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& rFontAttri
Size(bFontIsScaled ? std::max<sal_uInt32>(nWidth, 1) : 0, nHeight));
#endif
// define various other FontAttribute
- aRetval.SetAlignment(TextAlign::Baseline);
+ aRetval.SetAlignment(ALIGN_BASELINE);
aRetval.SetCharSet(rFontAttribute.getSymbol() ? RTL_TEXTENCODING_SYMBOL
: RTL_TEXTENCODING_UNICODE);
aRetval.SetVertical(rFontAttribute.getVertical());
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index 98a807fa5c47..a54893025984 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -1077,16 +1077,16 @@ namespace wmfemfhelper
rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY());
// take text align into account
- if (TextAlign::Baseline != rFont.GetAlignment())
+ if(ALIGN_BASELINE != rFont.GetAlignment())
{
drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rFont);
- if (TextAlign::Top == rFont.GetAlignment())
+ if(ALIGN_TOP == rFont.GetAlignment())
{
rAlignmentOffset.setY(aTextLayouterDevice.getFontAscent());
}
- else // TextAlign::Bottom
+ else // ALIGN_BOTTOM
{
rAlignmentOffset.setY(-aTextLayouterDevice.getFontDescent());
}
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 902dc3369d68..27aa19ed2992 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1939,7 +1939,7 @@ void EditDoc::RemoveItemsFromPool(const ContentNode& rNode)
void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, SvtScriptType nScriptType )
{
vcl::Font aPrevFont( rFont );
- rFont.SetAlignment( TextAlign::Baseline );
+ rFont.SetAlignment( ALIGN_BASELINE );
rFont.SetTransparent( true );
sal_uInt16 nWhich_FontInfo = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType );
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index aee2cd203a51..769179748b40 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -30,7 +30,7 @@ SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich )
, nScale(75)
, cSymbol(' ')
{
- aFont.SetAlignment(TextAlign::Bottom);
+ aFont.SetAlignment(ALIGN_BOTTOM);
aFont.SetTransparent( true );
}
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 7370c5666313..0459ac1f2873 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -858,7 +858,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
nScaledLineHeight *= nScale*10;
nScaledLineHeight /= 1000;
- aBulletFont.SetAlignment( TextAlign::Bottom );
+ aBulletFont.SetAlignment( ALIGN_BOTTOM );
aBulletFont.SetFontSize( Size( 0, nScaledLineHeight ) );
bool bVertical = IsVertical();
aBulletFont.SetVertical( bVertical );
@@ -921,7 +921,7 @@ void Outliner::PaintBullet(sal_Int32 nPara, const Point& rStartPos, const Point&
vcl::Font aBulletFont( ImpCalcBulletFont( nPara ) );
// Use baseline
bool bSymbol = pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL;
- aBulletFont.SetAlignment( bSymbol ? TextAlign::Bottom : TextAlign::Baseline );
+ aBulletFont.SetAlignment( bSymbol ? ALIGN_BOTTOM : ALIGN_BASELINE );
vcl::Font aOldFont = rOutDev.GetFont();
rOutDev.SetFont( aBulletFont );
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 988e0aa7d1ec..e4d2ed462bdb 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -1742,11 +1742,11 @@ namespace emfio
SetGfxMode( nGfxMode );
TextAlign eTextAlign;
if ( ( mnTextAlign & TA_BASELINE) == TA_BASELINE )
- eTextAlign = TextAlign::Baseline;
+ eTextAlign = ALIGN_BASELINE;
else if( ( mnTextAlign & TA_BOTTOM) == TA_BOTTOM )
- eTextAlign = TextAlign::Bottom;
+ eTextAlign = ALIGN_BOTTOM;
else
- eTextAlign = TextAlign::Top;
+ eTextAlign = ALIGN_TOP;
bool bChangeFont = false;
if ( mnLatestTextAlign != mnTextAlign )
{
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 24fda92699ec..2932d2e52ac9 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1118,7 +1118,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi
aFont.SetItalic( ITALIC_NONE );
aFont.SetWidthType( WIDTH_NORMAL );
aFont.SetWeight( WEIGHT_NORMAL );
- aFont.SetAlignment( TextAlign::Bottom );
+ aFont.SetAlignment( ALIGN_BOTTOM );
tools::Long nTextWidth = rPageSize.Width();
if( rPageSize.Width() < rPageSize.Height() )
{
@@ -1189,7 +1189,7 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rP
aFont.SetItalic( ITALIC_NONE );
aFont.SetWidthType( WIDTH_NORMAL );
aFont.SetWeight( WEIGHT_NORMAL );
- aFont.SetAlignment( TextAlign::Bottom );
+ aFont.SetAlignment( ALIGN_BOTTOM );
aFont.SetFontHeight(40);
aFont.SetOrientation(450_deg10);
diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx
index 249e222a0762..ab730d3d2774 100644
--- a/filter/source/svg/svgfontexport.cxx
+++ b/filter/source/svg/svgfontexport.cxx
@@ -189,7 +189,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
vcl::Font aFont( rFont );
aFont.SetFontSize( Size( 0, nFontEM ) );
- aFont.SetAlignment( TextAlign::Baseline );
+ aFont.SetAlignment( ALIGN_BASELINE );
pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
pVDev->SetFont( aFont );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index d7bcf77d95be..05d18bc3675c 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1650,9 +1650,9 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos,
const FontMetric aMetric( mpVDev->GetFontMetric() );
const vcl::Font& rFont = mpVDev->GetFont();
- if( rFont.GetAlignment() == TextAlign::Top )
+ if( rFont.GetAlignment() == ALIGN_TOP )
aBaseLinePos.AdjustY(aMetric.GetAscent() );
- else if( rFont.GetAlignment() == TextAlign::Bottom )
+ else if( rFont.GetAlignment() == ALIGN_BOTTOM )
aBaseLinePos.AdjustY( -(aMetric.GetDescent()) );
implMap( rPos, aPos );
@@ -2648,9 +2648,9 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText,
const FontMetric aMetric( mpVDev->GetFontMetric() );
const vcl::Font& rFont = mpVDev->GetFont();
- if( rFont.GetAlignment() == TextAlign::Top )
+ if( rFont.GetAlignment() == ALIGN_TOP )
aBaseLinePos.AdjustY(aMetric.GetAscent() );
- else if( rFont.GetAlignment() == TextAlign::Bottom )
+ else if( rFont.GetAlignment() == ALIGN_BOTTOM )
aBaseLinePos.AdjustY( -(aMetric.GetDescent()) );
ImplMap( rPos, aPos );
diff --git a/include/tools/fontenum.hxx b/include/tools/fontenum.hxx
index 419a6baaeb62..eeb35be1985c 100644
--- a/include/tools/fontenum.hxx
+++ b/include/tools/fontenum.hxx
@@ -27,15 +27,7 @@ enum FontFamily { FAMILY_DONTKNOW, FAMILY_DECORATIVE, FAMILY_MODERN,
enum FontPitch { PITCH_DONTKNOW, PITCH_FIXED, PITCH_VARIABLE, FontPitch_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
-enum class TextAlign : sal_Int16 {
- Top = 0x0000,
- Baseline = 0x0001,
- Bottom = 0x0002,
-};
-namespace o3tl
-{
- template<> struct typed_flags<TextAlign> : is_typed_flags<TextAlign, 0x3> {};
-}
+enum TextAlign { ALIGN_TOP, ALIGN_BASELINE, ALIGN_BOTTOM, TextAlign_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
enum FontWeight { WEIGHT_DONTKNOW, WEIGHT_THIN, WEIGHT_ULTRALIGHT,
WEIGHT_LIGHT, WEIGHT_SEMILIGHT, WEIGHT_NORMAL,
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e95b4740bbf9..885ccfd104d3 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -124,7 +124,7 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const tools::Rectangle&
vcl::Font aAppFont = pDev->GetSettings().GetStyleSettings().GetAppFont();
aAppFont.SetFontSize( aAttrFont.GetFontSize() );
- aAppFont.SetAlignment( TextAlign::Top );
+ aAppFont.SetAlignment( ALIGN_TOP );
pDev->SetFont( aAppFont );
Size aTextSize( pDev->GetTextWidth( rTitle ), pDev->GetTextHeight() );
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 8dcd9b3b5f60..b663c90d6424 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -332,7 +332,7 @@ void ScDrawStringsVars::SetPattern(
else
pPattern->GetFont( aFont, eColorMode, pFmtDevice, &pOutput->aZoomY, pCondSet, nScript,
&aBackConfigColor, &aTextConfigColor );
- aFont.SetAlignment(TextAlign::Baseline);
+ aFont.SetAlignment(ALIGN_BASELINE);
// orientation
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index 670ae38e9c7b..99f5c5796d08 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -234,7 +234,7 @@ void SvxCharView::SetFont(const vcl::Font& rFont)
tools::Long nWinHeight = GetOutputSizePixel().Height();
maFont = rFont;
maFont.SetWeight(WEIGHT_NORMAL);
- maFont.SetAlignment(TextAlign::Top);
+ maFont.SetAlignment(ALIGN_TOP);
maFont.SetFontSize(mxVirDev->PixelToLogic(Size(0, nWinHeight / 2)));
maFont.SetTransparent(true);
diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx
index b655a34a1981..dd4e5beac67f 100644
--- a/slideshow/source/engine/rehearsetimingsactivity.cxx
+++ b/slideshow/source/engine/rehearsetimingsactivity.cxx
@@ -152,7 +152,7 @@ RehearseTimingsActivity::RehearseTimingsActivity( const SlideShowContext& rConte
{
maFont.SetFontHeight( maFont.GetFontHeight() * 2 );
maFont.SetAverageFontWidth( maFont.GetAverageFontWidth() * 2 );
- maFont.SetAlignment( TextAlign::Baseline );
+ maFont.SetAlignment( ALIGN_BASELINE );
maFont.SetColor( COL_BLACK );
// determine sprite size (in pixel):
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 39ecda8db1df..ff1d001578de 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -244,7 +244,7 @@ void SmShowFont::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangl
vcl::Font aFont(maFont);
aFont.SetFontSize(Size(0, 24 * rRenderContext.GetDPIScaleFactor()));
- aFont.SetAlignment(TextAlign::Top);
+ aFont.SetAlignment(ALIGN_TOP);
rRenderContext.SetFont(aFont);
rRenderContext.SetTextColor(aTextColor);
@@ -987,7 +987,7 @@ void SmShowSymbolSet::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
{
SmSym aSymbol(*aSymbolSet[i]);
vcl::Font aFont(aSymbol.GetFace());
- aFont.SetAlignment(TextAlign::Top);
+ aFont.SetAlignment(ALIGN_TOP);
// taking a FontSize which is a bit smaller (compared to nLen) in order to have a buffer
// (hopefully enough for left and right, too)
@@ -1192,7 +1192,7 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol)
if (pSymbol)
{
vcl::Font aFont(pSymbol->GetFace());
- aFont.SetAlignment(TextAlign::Baseline);
+ aFont.SetAlignment(ALIGN_BASELINE);
SetFont(aFont);
sal_UCS4 cChar = pSymbol->GetCharacter();
@@ -1406,7 +1406,7 @@ void SmShowChar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangl
if (!aText.isEmpty())
{
vcl::Font aFont(m_aFont);
- aFont.SetAlignment(TextAlign::Top);
+ aFont.SetAlignment(ALIGN_TOP);
rRenderContext.SetFont(aFont);
Size aTextSize(rRenderContext.GetTextWidth(aText), rRenderContext.GetTextHeight());
@@ -1431,7 +1431,7 @@ void SmShowChar::SetSymbol( sal_UCS4 cChar, const vcl::Font &rFont )
vcl::Font aFont( rFont );
Size aSize(GetOutputSizePixel());
aFont.SetFontSize(Size(0, aSize.Height() - aSize.Height() / 3));
- aFont.SetAlignment(TextAlign::Baseline);
+ aFont.SetAlignment(ALIGN_BASELINE);
SetFont(aFont);
OUString aText(&cChar, 1);
diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx
index 6dfd888bf038..a4bf960fd583 100644
--- a/starmath/source/format.cxx
+++ b/starmath/source/format.cxx
@@ -81,7 +81,7 @@ SmFormat::SmFormat()
{
SmFace &rFace = vFont[i];
rFace.SetTransparent( true );
- rFace.SetAlignment( TextAlign::Baseline );
+ rFace.SetAlignment( ALIGN_BASELINE );
rFace.SetColor( COL_AUTO );
bDefaultFont[i] = false;
}
@@ -92,7 +92,7 @@ void SmFormat::SetFont(sal_uInt16 nIdent, const SmFace &rFont, bool bDefault )
{
vFont[nIdent] = rFont;
vFont[nIdent].SetTransparent( true );
- vFont[nIdent].SetAlignment( TextAlign::Baseline );
+ vFont[nIdent].SetAlignment( ALIGN_BASELINE );
bDefaultFont[nIdent] = bDefault;
}
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index 4857e25693bd..8d7ea52d9717 100644
--- a/starmath/source/rect.cxx
+++ b/starmath/source/rect.cxx
@@ -58,7 +58,7 @@ bool SmGetGlyphBoundRect(const vcl::RenderContext &rDev,
pGlyphDev->Push(PushFlags::FONT | PushFlags::MAPMODE);
vcl::Font aFnt(rDev.GetFont());
- aFnt.SetAlignment(TextAlign::Top);
+ aFnt.SetAlignment(ALIGN_TOP);
// use scale factor when calling GetTextBoundRect to counter
// negative effects from antialiasing which may otherwise result
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index cf45fecf1745..4dfd8374872c 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -33,7 +33,7 @@ SmSym::SmSym() :
{
m_aExportName = m_aName;
m_aFace.SetTransparent(true);
- m_aFace.SetAlignment(TextAlign::Baseline);
+ m_aFace.SetAlignment(ALIGN_BASELINE);
}
@@ -50,7 +50,7 @@ SmSym::SmSym(const OUString& rName, const vcl::Font& rFont, sal_UCS4 cChar,
m_aFace = rFont;
m_aFace.SetTransparent(true);
- m_aFace.SetAlignment(TextAlign::Baseline);
+ m_aFace.SetAlignment(ALIGN_BASELINE);
m_cChar = cChar;
m_aSetName = rSet;
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 5c49c8b52a64..0009253fbcfe 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -443,7 +443,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
SmFace aSet( sFontName, rOld.GetFontSize() );
aSet.SetBorderWidth( rOld.GetBorderWidth() );
- aSet.SetAlignment( TextAlign::Baseline );
+ aSet.SetAlignment( ALIGN_BASELINE );
aFormat.SetFont( (*ppEntries)->mnMemberId, aSet );
}
}
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 8d97777c14f2..7012004bea94 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -185,7 +185,7 @@ void SmFace::Impl_Init()
{
SetSize( GetFontSize() );
SetTransparent( true );
- SetAlignment( TextAlign::Baseline );
+ SetAlignment( ALIGN_BASELINE );
SetColor( COL_AUTO );
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 7a93e8a280b2..ef05e243f798 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1235,7 +1235,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
Size aSize650 (0, 650);
vcl::Font aFont(FAMILY_DONTKNOW, aSize600);
- aFont.SetAlignment(TextAlign::Top);
+ aFont.SetAlignment(ALIGN_TOP);
aFont.SetWeight(WEIGHT_BOLD);
aFont.SetFontSize(aSize650);
aFont.SetColor( COL_BLACK );
@@ -1279,7 +1279,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri
if (bIsPrintFormulaText)
{
vcl::Font aFont(FAMILY_DONTKNOW, Size(0, 600));
- aFont.SetAlignment(TextAlign::Top);
+ aFont.SetAlignment(ALIGN_TOP);
aFont.SetColor( COL_BLACK );
// get size
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 6a341084f06b..7e02d4739c62 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -495,8 +495,8 @@ void SmDrawingVisitor::DrawTextNode( SmTextNode* pNode )
void SmDrawingVisitor::DrawSpecialNode( SmSpecialNode* pNode )
{
//! since this chars might come from any font, that we may not have
- //! set to TextAlign::Baseline yet, we do it now.
- pNode->GetFont( ).SetAlignment( TextAlign::Baseline );
+ //! set to ALIGN_BASELINE yet, we do it now.
+ pNode->GetFont( ).SetAlignment( ALIGN_BASELINE );
DrawTextNode( pNode );
}
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 4135dacdcc27..5863c61aee04 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -180,7 +180,7 @@ static void CalculateHorizontalScalingFactor(
else
aFont.SetFontHeight( rSdrObjCustomShape.GetLogicRect().GetHeight() / rFWData.nMaxParagraphsPerTextArea );
- aFont.SetAlignment( TextAlign::Top );
+ aFont.SetAlignment( ALIGN_TOP );
aFont.SetFamilyName( rFontItem.GetFamilyName() );
aFont.SetFamily( rFontItem.GetFamily() );
aFont.SetStyleName( rFontItem.GetStyleName() );
@@ -289,7 +289,7 @@ static void GetTextAreaOutline(
aFont.SetFontHeight( rFWData.nSingleLineHeight );
- aFont.SetAlignment( TextAlign::Top );
+ aFont.SetAlignment( ALIGN_TOP );
aFont.SetFamilyName( rFontItem.GetFamilyName() );
aFont.SetFamily( rFontItem.GetFamily() );
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 16982c63487f..501c85d6b55d 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -624,7 +624,7 @@ void SvxShowCharSet::InitSettings(vcl::RenderContext& rRenderContext)
vcl::Font aFont(maFont);
aFont.SetWeight(WEIGHT_LIGHT);
- aFont.SetAlignment(TextAlign::Top);
+ aFont.SetAlignment(ALIGN_TOP);
aFont.SetFontSize(maFontSize);
aFont.SetTransparent(true);
rRenderContext.SetFont(aFont);
@@ -651,7 +651,7 @@ void SvxShowCharSet::RecalculateFont(vcl::RenderContext& rRenderContext)
vcl::Font aFont = maFont;
aFont.SetWeight(WEIGHT_LIGHT);
- aFont.SetAlignment(TextAlign::Top);
+ aFont.SetAlignment(ALIGN_TOP);
int nFontHeight = (aSize.Height() - 5) * 2 / (3 * ROW_COUNT);
maFontSize = rRenderContext.PixelToLogic(Size(0, nFontHeight));
aFont.SetFontSize(maFontSize);
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 28fff033abb6..33d54bee40e5 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -90,7 +90,7 @@ void scaleFontWidth(vcl::Font& rFont, vcl::RenderContext const & rRenderContext,
void initFont(vcl::Font& rFont)
{
rFont.SetTransparent(true);
- rFont.SetAlignment(TextAlign::Baseline);
+ rFont.SetAlignment(ALIGN_BASELINE);
}
void setFontSize(vcl::Font& rFont)
@@ -116,7 +116,7 @@ void setFont(const SvxFont& rNewFont, SvxFont& rImplFont)
{
rImplFont = rNewFont;
rImplFont.SetTransparent(true);
- rImplFont.SetAlignment(TextAlign::Baseline);
+ rImplFont.SetAlignment(ALIGN_BASELINE);
}
/*
diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx
index bd88ec497089..1cdb3cfc082a 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -291,7 +291,7 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& rRenderContext)
vcl::Font aFont = rRenderContext.GetFont();
aFont.SetWeight(WEIGHT_LIGHT);
- aFont.SetAlignment(TextAlign::Top);
+ aFont.SetAlignment(ALIGN_TOP);
int nFontHeight = (aSize.Height() - 5) * 2 / (3 * ROW_COUNT);
maFontSize = rRenderContext.PixelToLogic(Size(0, nFontHeight));
aFont.SetFontSize(maFontSize);
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 80f03d393215..de91990ccde8 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1014,9 +1014,9 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt
Point aPos( FRound(rPos.X() * mfScaleX + maOfs.X()), FRound(rPos.Y() * mfScaleY + maOfs.Y()) );
Size aSize( nTextWidth, nTextHeight );
- if ( eAlg == TextAlign::Baseline )
+ if ( eAlg == ALIGN_BASELINE )
aPos.AdjustY( -(FRound(aFontMetric.GetAscent() * mfScaleY)) );
- else if ( eAlg == TextAlign::Bottom )
+ else if ( eAlg == ALIGN_BOTTOM )
aPos.AdjustY( -nTextHeight );
tools::Rectangle aTextRect( aPos, aSize );
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 50cef2800dc8..471aa47375c3 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -799,9 +799,9 @@ void ImpSdrPdfImport::InsertTextObject(const Point& rPos, const Size& rSize, con
FRound(rPos.Y() * mfScaleY + maOfs.Y()));
Size aSize(FRound(rSize.Width() * mfScaleX), FRound(rSize.Height() * mfScaleY));
- if (eAlignment == TextAlign::Baseline)
+ if (eAlignment == ALIGN_BASELINE)
aPosition.AdjustY(-FRound(aFontMetric.GetAscent() * mfScaleY));
- else if (eAlignment == TextAlign::Bottom)
+ else if (eAlignment == ALIGN_BOTTOM)
aPosition.AdjustY(-nTextHeight);
tools::Rectangle aTextRect(aPosition, aSize);
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 38e4b10195ed..ddfc54bc6fc3 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1942,7 +1942,7 @@ SwFontSave::SwFontSave(const SwTextSizeInfo &rInf, SwFont *pNew,
( *pNew->GetBackColor() != *pFnt->GetBackColor() ) ) )
{
pNew->SetTransparent( true );
- pNew->SetAlign( TextAlign::Baseline );
+ pNew->SetAlign( ALIGN_BASELINE );
pInf->SetFont( pNew );
}
else
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index ed81b325bcdc..23f837d63051 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -599,7 +599,7 @@ bool SwBookmarkPortion::DoPaint(SwTextPaintInfo const& rTextPaintInfo,
rFont.SetWeight(WEIGHT_THIN, rFont.GetActual());
rFont.SetColor(NON_PRINTING_CHARACTER_COLOR);
// reset these to default...
- rFont.SetAlign(TextAlign::Baseline);
+ rFont.SetAlign(ALIGN_BASELINE);
rFont.SetUnderline(LINESTYLE_NONE);
rFont.SetOverline(LINESTYLE_NONE);
rFont.SetStrikeout(STRIKEOUT_NONE);
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 5a6db8fce090..620c0d67682a 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -597,7 +597,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
SetEmphasisMark( static_cast<const SvxEmphasisMarkItem*>(pItem)->GetEmphasisMark() );
SetTransparent( true );
- SetAlign( TextAlign::Baseline );
+ SetAlign( ALIGN_BASELINE );
if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_CONTOUR,
true, &pItem ))
SetOutline( static_cast<const SvxContourItem*>(pItem)->GetValue() );
@@ -788,7 +788,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() );
SetColor( pAttrSet->GetColor().GetValue() );
SetTransparent( true );
- SetAlign( TextAlign::Baseline );
+ SetAlign( ALIGN_BASELINE );
SetOutline( pAttrSet->GetContour().GetValue() );
SetShadow( pAttrSet->GetShadowed().GetValue() );
SetPropWidth( pAttrSet->GetCharScaleW().GetValue() );
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index a30aa3a632d6..e7b2059a1ec0 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -119,7 +119,7 @@ static void lcl_PrintHeader( vcl::RenderContext &rOutDev, sal_Int32 nPages, sal_
vcl::Font aFont( aOldFont );
aFont.SetWeight( WEIGHT_BOLD );
- aFont.SetAlignment( TextAlign::Bottom );
+ aFont.SetAlignment( ALIGN_BOTTOM );
rOutDev.SetFont( aFont );
tools::Long nFontHeight = rOutDev.GetTextHeight();
diff --git a/vcl/qa/cppunit/font.cxx b/vcl/qa/cppunit/font.cxx
index 7eca6f1c0c5d..e99bf12a5124 100644
--- a/vcl/qa/cppunit/font.cxx
+++ b/vcl/qa/cppunit/font.cxx
@@ -86,10 +86,10 @@ void VclFontTest::testAlignment()
{
vcl::Font aFont;
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Text alignment should be TextAlign::Top", TextAlign::Top, aFont.GetAlignment());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Text alignment should be ALIGN_TOP", TextAlign::ALIGN_TOP, aFont.GetAlignment());
- aFont.SetAlignment(TextAlign::Baseline);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Text alignment should be TextAlign::Baseline", TextAlign::Baseline, aFont.GetAlignment());
+ aFont.SetAlignment(TextAlign::ALIGN_BASELINE);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Text alignment should be ALIGN_BASELINE", TextAlign::ALIGN_BASELINE, aFont.GetAlignment());
}
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 05a3a8ce78a3..cdee28bdab57 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -1840,7 +1840,7 @@ void SvmTest::testTextAlign()
ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
- pVirtualDev->SetTextAlign(TextAlign::Bottom);
+ pVirtualDev->SetTextAlign(TextAlign::ALIGN_BOTTOM);
checkTextAlign(writeAndReadStream(aGDIMetaFile));
checkTextAlign(readFile(u"textalign.svm"));
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 45935937a9c4..c77bf57e1bd4 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -289,7 +289,7 @@ void HelpTextWindow::ApplySettings(vcl::RenderContext& rRenderContext)
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
SetPointFont(rRenderContext, rStyleSettings.GetHelpFont());
rRenderContext.SetTextColor(rStyleSettings.GetHelpTextColor());
- rRenderContext.SetTextAlign(TextAlign::Top);
+ rRenderContext.SetTextAlign(ALIGN_TOP);
if (rRenderContext.IsNativeControlSupported(ControlType::Tooltip, ControlPart::Entire))
{
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 95ef0dbcaf91..96ad2c63bc80 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -188,7 +188,7 @@ void TextEngine::SetFont( const vcl::Font& rFont )
aFillColor.SetAlpha( 255 );
maFont.SetFillColor( aFillColor );
- maFont.SetAlignment(TextAlign::Top);
+ maFont.SetAlignment( ALIGN_TOP );
mpRefDev->SetFont( maFont );
mnDefTab = mpRefDev->GetTextWidth(" ");
if ( !mnDefTab )
diff --git a/vcl/source/filter/eps/eps.cxx b/vcl/source/filter/eps/eps.cxx
index 61ea92e0269b..2da28338c97c 100644
--- a/vcl/source/filter/eps/eps.cxx
+++ b/vcl/source/filter/eps/eps.cxx
@@ -408,7 +408,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
eLineCap = SvtGraphicStroke::capButt;
eJoinType = SvtGraphicStroke::joinMiter;
aBackgroundColor = COL_WHITE;
- eTextAlign = TextAlign::Baseline;
+ eTextAlign = ALIGN_BASELINE;
if( pMTF->GetActionSize() )
{
@@ -2075,11 +2075,11 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint )
ImplWriteDouble( aSize.Height() );
mpPS->WriteCharPtr( "sf " );
}
- if ( eTextAlign != TextAlign::Baseline )
+ if ( eTextAlign != ALIGN_BASELINE )
{ // PostScript does not know about FontAlignment
- if ( eTextAlign == TextAlign::Top ) // -> so I assume that
+ if ( eTextAlign == ALIGN_TOP ) // -> so I assume that
aPoint.AdjustY( aSize.Height() * 4 / 5 ); // the area under the baseline
- else if ( eTextAlign == TextAlign::Bottom ) // is about 20% of the font size
+ else if ( eTextAlign == ALIGN_BOTTOM ) // is about 20% of the font size
aPoint.AdjustY( -( aSize.Height() / 5 ) );
}
ImplMoveTo( aPoint );
diff --git a/vcl/source/filter/idxf/dxf2mtf.cxx b/vcl/source/filter/idxf/dxf2mtf.cxx
index 1b470c63cc7f..06aebc3da16b 100644
--- a/vcl/source/filter/idxf/dxf2mtf.cxx
+++ b/vcl/source/filter/idxf/dxf2mtf.cxx
@@ -205,7 +205,7 @@ bool DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle,
aFont.SetTransparent(true);
aFont.SetFamily(FAMILY_SWISS);
aFont.SetFontSize(Size(0,nHeight));
- aFont.SetAlignment(TextAlign::Baseline);
+ aFont.SetAlignment(ALIGN_BASELINE);
aFont.SetOrientation(Degree10(nAngle));
if (aActFont!=aFont) {
aActFont=aFont;
diff --git a/vcl/source/filter/imet/ios2met.cxx b/vcl/source/filter/imet/ios2met.cxx
index f1a6057bc8bc..1d0b83ba1fb3 100644
--- a/vcl/source/filter/imet/ios2met.cxx
+++ b/vcl/source/filter/imet/ios2met.cxx
@@ -2348,7 +2348,7 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize)
pF->pSucc=pFontList; pFontList=pF;
pF->nID=0;
pF->aFont.SetTransparent(true);
- pF->aFont.SetAlignment(TextAlign::Baseline);
+ pF->aFont.SetAlignment(ALIGN_BASELINE);
auto nPos=pOS2MET->Tell();
auto nMaxPos = nPos + nFieldSize;
diff --git a/vcl/source/filter/ipict/ipict.cxx b/vcl/source/filter/ipict/ipict.cxx
index 0c5adf8cfcb7..1d22137d0fcf 100644
--- a/vcl/source/filter/ipict/ipict.cxx
+++ b/vcl/source/filter/ipict/ipict.cxx
@@ -1914,7 +1914,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
aActFont.SetCharSet( GetTextEncoding());
aActFont.SetFamily(FAMILY_SWISS);
aActFont.SetFontSize(Size(0,12));
- aActFont.SetAlignment(TextAlign::Baseline);
+ aActFont.SetAlignment(ALIGN_BASELINE);
aHRes = aVRes = Fraction( 1, 1 );
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 8c7f90654a14..430048a060a4 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -562,15 +562,9 @@ void EMFWriter::ImplCheckTextAttr()
switch( rFont.GetAlignment() )
{
- case TextAlign::Top:
- nTextAlign = TA_TOP;
- break;
- case TextAlign::Bottom:
- nTextAlign = TA_BOTTOM;
- break;
- case TextAlign::Baseline:
- nTextAlign = TA_BASELINE;
- break;
+ case ALIGN_TOP: nTextAlign = TA_TOP; break;
+ case ALIGN_BOTTOM: nTextAlign = TA_BOTTOM; break;
+ default: nTextAlign = TA_BASELINE; break;
}
nTextAlign |= mnHorTextAlign;
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index ae62d54866d3..09c24110cbdb 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -144,11 +144,11 @@ WMFWriter::WMFWriter()
, nMaxRecordSize(0)
, nActRecordPos(0)
, eSrcRasterOp(RasterOp::OverPaint)
- , eSrcTextAlign(TextAlign::Baseline)
+ , eSrcTextAlign(ALIGN_BASELINE)
, pAttrStack(nullptr)
, eSrcHorTextAlign(W_TA_LEFT)
, eDstROP2(RasterOp::OverPaint)
- , eDstTextAlign(TextAlign::Baseline)
+ , eDstTextAlign(ALIGN_BASELINE)
, eDstHorTextAlign(W_TA_LEFT)
, bHandleAllocated{}
, nDstPenHandle(0)
@@ -740,15 +740,9 @@ void WMFWriter::WMFRecord_SetTextAlign(TextAlign eFontAlign, sal_uInt16 eHorText
sal_uInt16 nAlign;
switch (eFontAlign) {
- case TextAlign::Top:
- nAlign=W_TA_TOP;
- break;
- case TextAlign::Bottom:
- nAlign=W_TA_BOTTOM;
- break;
- case TextAlign::Baseline:
- nAlign=W_TA_BASELINE;
- break;
+ case ALIGN_TOP: nAlign=W_TA_TOP; break;
+ case ALIGN_BOTTOM: nAlign=W_TA_BOTTOM; break;
+ default: nAlign=W_TA_BASELINE;
}
nAlign|=eHorTextAlign;
nAlign|=W_TA_NOUPDATECP;
@@ -1459,7 +1453,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
}
eSrcTextAlign = aSrcFont.GetAlignment();
aSrcTextColor = aSrcFont.GetColor();
- aSrcFont.SetAlignment( TextAlign::Baseline );
+ aSrcFont.SetAlignment( ALIGN_BASELINE );
aSrcFont.SetColor( COL_WHITE );
}
break;
@@ -1776,11 +1770,11 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
vcl::Font aFont;
aFont.SetCharSet( GetExtendedTextEncoding( RTL_TEXTENCODING_MS_1252 ) );
aFont.SetColor( COL_WHITE );
- aFont.SetAlignment( TextAlign::Baseline );
+ aFont.SetAlignment( ALIGN_BASELINE );
aDstFont = aSrcFont = aFont;
CreateSelectDeleteFont(aDstFont);
- eDstTextAlign = eSrcTextAlign = TextAlign::Baseline;
+ eDstTextAlign = eSrcTextAlign = ALIGN_BASELINE;
eDstHorTextAlign = eSrcHorTextAlign = W_TA_LEFT;
WMFRecord_SetTextAlign( eDstTextAlign, eDstHorTextAlign );
diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx
index c2edc3dca403..cc5042fc9506 100644
--- a/vcl/source/font/font.cxx
+++ b/vcl/source/font/font.cxx
@@ -880,7 +880,7 @@ ImplFont::ImplFont() :
mePitch( PITCH_DONTKNOW ),
meWidthType( WIDTH_DONTKNOW ),
meItalic( ITALIC_NONE ),
- meAlign( TextAlign::Top ),
+ meAlign( ALIGN_TOP ),
meUnderline( LINESTYLE_NONE ),
meOverline( LINESTYLE_NONE ),
meStrikeout( STRIKEOUT_NONE ),
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 7c0c755c4ac5..74f343ed9e9f 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1569,7 +1569,7 @@ rtl::Reference<MetaAction> MetaOverlineColorAction::Clone() const
MetaTextAlignAction::MetaTextAlignAction() :
MetaAction ( MetaActionType::TEXTALIGN ),
- maAlign ( TextAlign::Top )
+ maAlign ( ALIGN_TOP )
{}
MetaTextAlignAction::~MetaTextAlignAction()
diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx
index 9732b7cd1e9a..cccc64df808a 100644
--- a/vcl/source/gdi/mtfxmldump.cxx
+++ b/vcl/source/gdi/mtfxmldump.cxx
@@ -144,9 +144,10 @@ OUString convertTextAlignToString(TextAlign eAlign)
{
switch (eAlign)
{
- case TextAlign::Baseline: return "baseline";
- case TextAlign::Bottom: return "bottom";
- case TextAlign::Top: return "top";
+ case ALIGN_BASELINE: return "baseline";
+ case ALIGN_BOTTOM: return "bottom";
+ case ALIGN_TOP: return "top";
+ case TextAlign_FORCE_EQUAL_SIZE: return "equalsize";
}
return OUString();
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 9dfdd3e08acb..f8e17a33e8e5 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6234,9 +6234,9 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
}
Point aAlignOffset;
- if ( eAlign == TextAlign::Bottom )
+ if ( eAlign == ALIGN_BOTTOM )
aAlignOffset.AdjustY( -(aRefDevFontMetric.GetDescent()) );
- else if ( eAlign == TextAlign::Top )
+ else if ( eAlign == ALIGN_TOP )
aAlignOffset.AdjustY(aRefDevFontMetric.GetAscent() );
if( aAlignOffset.X() || aAlignOffset.Y() )
aAlignOffset = aRotScale.transform( aAlignOffset );
@@ -6405,9 +6405,9 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
tools::Long nEmphHeight2 = nEmphHeight / 2;
aOffset += Point( nEmphWidth2, nEmphHeight2 );
- if ( eAlign == TextAlign::Bottom )
+ if ( eAlign == ALIGN_BOTTOM )
aOffset.AdjustY( -(GetFontInstance()->mxFontMetric->GetDescent()) );
- else if ( eAlign == TextAlign::Top )
+ else if ( eAlign == ALIGN_TOP )
aOffset.AdjustY(GetFontInstance()->mxFontMetric->GetAscent() );
nIndex = 0;
@@ -7116,9 +7116,9 @@ void PDFWriterImpl::drawTextLine( const Point& rPos, tools::Long nWidth, FontStr
Point aPos( rPos );
TextAlign eAlign = m_aCurrentPDFState.m_aFont.GetAlignment();
- if( eAlign == TextAlign::Top )
+ if( eAlign == ALIGN_TOP )
aPos.AdjustY(HCONV( pFontInstance->mxFontMetric->GetAscent() ));
- else if( eAlign == TextAlign::Bottom )
+ else if( eAlign == ALIGN_BOTTOM )
aPos.AdjustY( -HCONV( pFontInstance->mxFontMetric->GetDescent() ) );
OStringBuffer aLine( 512 );
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 220b5ddaa976..6c761ec4bf07 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -61,7 +61,7 @@ FontMetric OutputDevice::GetDevFont( int nDevFontIndex ) const
aFontMetric.SetPitch( rData.GetPitch() );
aFontMetric.SetWeight( rData.GetWeight() );
aFontMetric.SetItalic( rData.GetItalic() );
- aFontMetric.SetAlignment( TextAlign::Top );
+ aFontMetric.SetAlignment( TextAlign::ALIGN_TOP );
aFontMetric.SetWidthType( rData.GetWidthType() );
aFontMetric.SetQuality( rData.GetQuality() );
}
@@ -199,7 +199,7 @@ FontMetric OutputDevice::GetFontMetric() const
aMetric.SetPitch( xFontMetric->GetPitch() );
aMetric.SetWeight( xFontMetric->GetWeight() );
aMetric.SetItalic( xFontMetric->GetItalic() );
- aMetric.SetAlignment( TextAlign::Top );
+ aMetric.SetAlignment( TextAlign::ALIGN_TOP );
aMetric.SetWidthType( xFontMetric->GetWidthType() );
if ( pFontInstance->mnOwnOrientation )
aMetric.SetOrientation( pFontInstance->mnOwnOrientation );
@@ -1017,12 +1017,12 @@ bool OutputDevice::ImplNewFont() const
// calculate text offset depending on TextAlignment
TextAlign eAlign = maFont.GetAlignment();
- if ( eAlign == TextAlign::Baseline )
+ if ( eAlign == ALIGN_BASELINE )
{
mnTextOffX = 0;
mnTextOffY = 0;
}
- else if ( eAlign == TextAlign::Top )
+ else if ( eAlign == ALIGN_TOP )
{
mnTextOffX = 0;
mnTextOffY = +pFontInstance->mxFontMetric->GetAscent() + mnEmphasisAscent;
@@ -1032,7 +1032,7 @@ bool OutputDevice::ImplNewFont() const
aOriginPt.RotateAround( mnTextOffX, mnTextOffY, pFontInstance->mnOrientation );
}
}
- else // eAlign == TextAlign::Bottom
+ else // eAlign == ALIGN_BOTTOM
{
mnTextOffX = 0;
mnTextOffY = -pFontInstance->mxFontMetric->GetDescent() + mnEmphasisDescent;
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx
index ec16953d40f2..7fa966606744 100644
--- a/vcl/source/outdev/outdevstate.cxx
+++ b/vcl/source/outdev/outdevstate.cxx
@@ -32,7 +32,7 @@
OutDevState::OutDevState()
: mbMapActive(false)
- , meTextAlign(TextAlign::Top)
+ , meTextAlign(ALIGN_TOP)
, meRasterOp(RasterOp::OverPaint)
, mnTextLayoutMode(ComplexTextLayoutFlags::Default)
, meTextLanguage(0)
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 3c3f651b8cba..cf73436df2cf 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1586,9 +1586,9 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta
aPos.AdjustY((nHeight-(nFormatLines*nTextHeight))/2 );
// Font alignment
- if ( eAlign == TextAlign::Bottom )
+ if ( eAlign == ALIGN_BOTTOM )
aPos.AdjustY(nTextHeight );
- else if ( eAlign == TextAlign::Baseline )
+ else if ( eAlign == ALIGN_BASELINE )
aPos.AdjustY(rTargetDevice.GetFontMetric().GetAscent() );
// Output all lines except for the last one
@@ -1664,9 +1664,9 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta
aPos.AdjustX((nWidth-nTextWidth)/2 );
// vertical font alignment
- if ( eAlign == TextAlign::Bottom )
+ if ( eAlign == ALIGN_BOTTOM )
aPos.AdjustY(nTextHeight );
- else if ( eAlign == TextAlign::Baseline )
+ else if ( eAlign == ALIGN_BASELINE )
aPos.AdjustY(rTargetDevice.GetFontMetric().GetAscent() );
if ( nStyle & DrawTextFlags::Bottom )
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index b909910099c1..1d9b3cf742b3 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -2034,7 +2034,7 @@ class DemoPopup : public FloatingWindow
tools::Rectangle aTextRect(Point(6, 6), aSize);
SetTextColor(COL_BLACK);
- SetTextAlign(TextAlign::Top);
+ SetTextAlign(ALIGN_TOP);
rRenderContext.DrawText(aTextRect, "This is a standalone help text test",
DrawTextFlags::MultiLine|DrawTextFlags::WordBreak|
DrawTextFlags::Left|DrawTextFlags::Top);
More information about the Libreoffice-commits
mailing list