undo changes to TextAlign
revert commit 8689bd5490
Author: Caolán McNamara <caolanm@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@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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) );
|
||||
|
||||
@@ -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) );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -30,7 +30,7 @@ SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich )
|
||||
, nScale(75)
|
||||
, cSymbol(' ')
|
||||
{
|
||||
aFont.SetAlignment(TextAlign::Bottom);
|
||||
aFont.SetAlignment(ALIGN_BOTTOM);
|
||||
aFont.SetTransparent( true );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ void SmFace::Impl_Init()
|
||||
{
|
||||
SetSize( GetFontSize() );
|
||||
SetTransparent( true );
|
||||
SetAlignment( TextAlign::Baseline );
|
||||
SetAlignment( ALIGN_BASELINE );
|
||||
SetColor( COL_AUTO );
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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() );
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
@@ -1569,7 +1569,7 @@ rtl::Reference<MetaAction> MetaOverlineColorAction::Clone() const
|
||||
|
||||
MetaTextAlignAction::MetaTextAlignAction() :
|
||||
MetaAction ( MetaActionType::TEXTALIGN ),
|
||||
maAlign ( TextAlign::Top )
|
||||
maAlign ( ALIGN_TOP )
|
||||
{}
|
||||
|
||||
MetaTextAlignAction::~MetaTextAlignAction()
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
OutDevState::OutDevState()
|
||||
: mbMapActive(false)
|
||||
, meTextAlign(TextAlign::Top)
|
||||
, meTextAlign(ALIGN_TOP)
|
||||
, meRasterOp(RasterOp::OverPaint)
|
||||
, mnTextLayoutMode(ComplexTextLayoutFlags::Default)
|
||||
, meTextLanguage(0)
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user