diff options
57 files changed, 115 insertions, 93 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 09a3bac220a1..fa22d43905b1 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -103,7 +103,7 @@ void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, sal_uInt16 nCurPage, vcl::Font aFont( aOldFont ); aFont.SetWeight( WEIGHT_BOLD ); - aFont.SetAlign( ALIGN_BOTTOM ); + aFont.SetAlignment( ALIGN_BOTTOM ); pPrinter->SetFont( aFont ); long nFontHeight = pPrinter->GetTextHeight(); @@ -802,7 +802,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) vcl::Font aOldFont( pPrinter->GetFont() ); vcl::Font aFont( GetEditEngine()->GetFont() ); - aFont.SetAlign( ALIGN_BOTTOM ); + aFont.SetAlignment( ALIGN_BOTTOM ); aFont.SetTransparent( true ); aFont.SetSize( Size( 0, 360 ) ); pPrinter->SetFont( aFont ); diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index c1217366dcb6..52a4875275fd 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -1117,7 +1117,7 @@ void lcl_PrintHeader( Printer* pPrinter, const OUString& rTitle ) // not working vcl::Font aFont( pPrinter->GetFont() ); aFont.SetWeight( WEIGHT_BOLD ); - aFont.SetAlign( ALIGN_BOTTOM ); + aFont.SetAlignment( ALIGN_BOTTOM ); pPrinter->SetFont( aFont ); long const nFontHeight = pPrinter->GetTextHeight(); @@ -1160,7 +1160,7 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor MapMode aMap( MAP_100TH_MM ); pPrinter->SetMapMode( aMap ); vcl::Font aFont; - aFont.SetAlign( ALIGN_BOTTOM ); + aFont.SetAlignment( ALIGN_BOTTOM ); aFont.SetSize( Size( 0, 360 )); pPrinter->SetFont( aFont ); diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index 875feae4283c..505ebd2acf01 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->SetAlign( ALIGN_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 f96066787c6c..cd5f5e903668 100644 --- a/canvas/source/directx/dx_textlayout_drawhelper.cxx +++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx @@ -112,7 +112,7 @@ namespace dxcanvas rFontRequest.FontDescription.StyleName, Size( 0, ::basegfx::fround(rFontRequest.CellSize))); - aFont.SetAlign( ALIGN_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) ? sal_True : sal_False ); aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) ); @@ -247,7 +247,7 @@ namespace dxcanvas rFontRequest.FontDescription.StyleName, Size( 0, ::basegfx::fround(rFontRequest.CellSize))); - aFont.SetAlign( ALIGN_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) ? sal_True : sal_False ); 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 ae37f1e6e08d..b14cc87e5f8a 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -729,7 +729,7 @@ namespace oglcanvas rFontRequest.FontDescription.StyleName, Size( 0, ::basegfx::fround(rFontRequest.CellSize))); - aFont.SetAlign( ALIGN_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 7a196b751468..f65fdf2273ee 100644 --- a/canvas/source/vcl/canvasfont.cxx +++ b/canvas/source/vcl/canvasfont.cxx @@ -47,7 +47,7 @@ namespace vclcanvas mpRefDevice( &rDevice ), mpOutDevProvider( rOutDevProvider ) { - maFont->SetAlign( ALIGN_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/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 467fe8a769dd..b8d28a871a27 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -275,7 +275,7 @@ void SvxShowText::SetFont( const vcl::Font& rFont ) long nWinHeight = GetOutputSizePixel().Height(); maFont = vcl::Font(rFont); maFont.SetWeight(WEIGHT_NORMAL); - maFont.SetAlign(ALIGN_TOP); + maFont.SetAlignment(ALIGN_TOP); maFont.SetSize(PixelToLogic(Size(0, nWinHeight / 2))); maFont.SetTransparent(true); Control::SetFont(maFont); diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 416d5cf09f7e..07f9aaebb57d 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -663,7 +663,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const Rectang _vdev->DrawRect(Rectangle(pSpl->_tlx+pSpl->_barspace, pSpl->_tly+pSpl->_barspace, pSpl->_tlx+pSpl->_barspace+length, pSpl->_tly+pSpl->_barheight-pSpl->_barspace)); vcl::Font aFont; aFont.SetSize(Size(0, 12)); - aFont.SetAlign(ALIGN_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/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index 480ed3e36a02..94d04c0d15a1 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -301,10 +301,10 @@ namespace } if(!(nPushFlags & PushFlags::TEXTALIGN )) { - if(pLast->getFont().GetAlign() != pTip->getFont().GetAlign()) + if(pLast->getFont().GetAlignment() != pTip->getFont().GetAlignment()) { vcl::Font aFont(pLast->getFont()); - aFont.SetAlign(pTip->getFont().GetAlign()); + aFont.SetAlignment(pTip->getFont().GetAlignment()); pLast->setFont(aFont); } } @@ -1237,12 +1237,12 @@ namespace rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY()); // take text align into account - if(ALIGN_BASELINE != rFont.GetAlign()) + if(ALIGN_BASELINE != rFont.GetAlignment()) { drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice; aTextLayouterDevice.setFont(rFont); - if(ALIGN_TOP == rFont.GetAlign()) + if(ALIGN_TOP == rFont.GetAlignment()) { rAlignmentOffset.setY(aTextLayouterDevice.getFontAscent()); } @@ -2659,10 +2659,10 @@ namespace // TextAlign is applied to the current font (as in // OutputDevice::SetTextAlign which would be used when // playing the Metafile) - if(rPropertyHolders.Current().getFont().GetAlign() != aNewTextAlign) + if(rPropertyHolders.Current().getFont().GetAlignment() != aNewTextAlign) { vcl::Font aNewFont(rPropertyHolders.Current().getFont()); - aNewFont.SetAlign(aNewTextAlign); + aNewFont.SetAlignment(aNewTextAlign); rPropertyHolders.Current().setFont(aNewFont); } diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 092e71cff25c..eac624c8804c 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -400,7 +400,7 @@ namespace drawinglayer Size(bFontIsScaled ? std::max<sal_uInt32>(nWidth, 1) : 0, nHeight)); #endif // define various other FontAttribute - aRetval.SetAlign(ALIGN_BASELINE); + aRetval.SetAlignment(ALIGN_BASELINE); aRetval.SetCharSet(rFontAttribute.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE); aRetval.SetVertical(rFontAttribute.getVertical()); aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight())); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 4fb88ee02867..8ab16b79da7d 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -2023,7 +2023,7 @@ void EditDoc::RemoveItemsFromPool(const ContentNode& rNode) void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, SvtScriptType nScriptType ) { vcl::Font aPrevFont( rFont ); - rFont.SetAlign( ALIGN_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 09f37e929d1b..2f258620279c 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -44,7 +44,7 @@ void SvxBulletItem::StoreFont( SvStream& rStream, const vcl::Font& rFont ) rStream.WriteUInt16( nTemp ); nTemp = (sal_uInt16)rFont.GetPitch(); rStream.WriteUInt16( nTemp ); - nTemp = (sal_uInt16)rFont.GetAlign(); rStream.WriteUInt16( nTemp ); + nTemp = (sal_uInt16)rFont.GetAlignment(); rStream.WriteUInt16( nTemp ); nTemp = (sal_uInt16)rFont.GetWeight(); rStream.WriteUInt16( nTemp ); nTemp = (sal_uInt16)rFont.GetUnderline(); rStream.WriteUInt16( nTemp ); nTemp = (sal_uInt16)rFont.GetStrikeout(); rStream.WriteUInt16( nTemp ); @@ -73,7 +73,7 @@ vcl::Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer ) aFont.SetCharSet((rtl_TextEncoding)nTemp); rStream.ReadUInt16( nTemp ); aFont.SetPitch((FontPitch)nTemp); - rStream.ReadUInt16( nTemp ); aFont.SetAlign((FontAlign)nTemp); + rStream.ReadUInt16( nTemp ); aFont.SetAlignment((FontAlign)nTemp); rStream.ReadUInt16( nTemp ); aFont.SetWeight((FontWeight)nTemp); rStream.ReadUInt16( nTemp ); aFont.SetUnderline((FontUnderline)nTemp); rStream.ReadUInt16( nTemp ); aFont.SetStrikeout((FontStrikeout)nTemp); @@ -202,7 +202,7 @@ SfxPoolItem* SvxBulletItem::Create( SvStream& rStrm, sal_uInt16 /*nVersion*/ ) c void SvxBulletItem::SetDefaultFont_Impl() { aFont = OutputDevice::GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_SYSTEM, GetDefaultFontFlags::NONE ); - aFont.SetAlign( ALIGN_BOTTOM); + aFont.SetAlignment( ALIGN_BOTTOM); aFont.SetTransparent( true ); } diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index fac21c1a78e2..d19e62ba11ea 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -893,7 +893,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const nScaledLineHeight *= nScale*10; nScaledLineHeight /= 1000; - aBulletFont.SetAlign( ALIGN_BOTTOM ); + aBulletFont.SetAlignment( ALIGN_BOTTOM ); aBulletFont.SetSize( Size( 0, nScaledLineHeight ) ); bool bVertical = IsVertical(); aBulletFont.SetVertical( bVertical ); @@ -946,7 +946,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos, vcl::Font aBulletFont( ImpCalcBulletFont( nPara ) ); // Use baseline bool bSymbol = pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL; - aBulletFont.SetAlign( bSymbol ? ALIGN_BOTTOM : ALIGN_BASELINE ); + aBulletFont.SetAlignment( bSymbol ? ALIGN_BOTTOM : ALIGN_BASELINE ); vcl::Font aOldFont = pOutDev->GetFont(); pOutDev->SetFont( aBulletFont ); diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 260b29b857a0..44b1c495884d 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -567,7 +567,7 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon FlashFont& rFlashFont = Impl_getFont( aFont ); // always adjust text position to match baseline alignment - switch( aOldFont.GetAlign() ) + switch( aOldFont.GetAlignment() ) { case( ALIGN_TOP ): aBaseLinePos.Y() += aMetric.GetAscent(); diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx index 3649cceba7d7..6f668025db51 100644 --- a/filter/source/flash/swfwriter2.cxx +++ b/filter/source/flash/swfwriter2.cxx @@ -454,7 +454,7 @@ sal_uInt16 FlashFont::getGlyph( sal_uInt16 nChar, VirtualDevice* pVDev ) vcl::Font aOldFont( pVDev->GetFont() ); vcl::Font aNewFont( aOldFont ); - aNewFont.SetAlign( ALIGN_BASELINE ); + aNewFont.SetAlignment( ALIGN_BASELINE ); pVDev->SetFont( aNewFont ); aOldFont.SetOrientation(0); diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index d8fbfdb83371..521c85a619fa 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -203,7 +203,7 @@ bool DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle, aFont.SetTransparent(true); aFont.SetFamily(FAMILY_SWISS); aFont.SetSize(Size(0,nHeight)); - aFont.SetAlign(ALIGN_BASELINE); + aFont.SetAlignment(ALIGN_BASELINE); aFont.SetOrientation(nAngle); if (aActFont!=aFont) { aActFont=aFont; diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 984f234991c7..dd17524bb1b5 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -2264,7 +2264,7 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize) pF->pSucc=pFontList; pFontList=pF; pF->nID=0; pF->aFont.SetTransparent(true); - pF->aFont.SetAlign(ALIGN_BASELINE); + pF->aFont.SetAlignment(ALIGN_BASELINE); nPos=pOS2MET->Tell(); nMaxPos=nPos+(sal_uLong)nFieldSize; diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index e7bbf7125b71..c76c989fb37b 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -1874,7 +1874,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) aActFont.SetCharSet( GetTextEncoding()); aActFont.SetFamily(FAMILY_SWISS); aActFont.SetSize(Size(0,12)); - aActFont.SetAlign(ALIGN_BASELINE); + aActFont.SetAlignment(ALIGN_BASELINE); aHRes = aVRes = Fraction( 1, 1 ); diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index da1f2d9d00f2..889d09dee65d 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -1056,7 +1056,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi aFont.SetItalic( ITALIC_NONE ); aFont.SetWidthType( WIDTH_NORMAL ); aFont.SetWeight( WEIGHT_NORMAL ); - aFont.SetAlign( ALIGN_BOTTOM ); + aFont.SetAlignment( ALIGN_BOTTOM ); long nTextWidth = rPageSize.Width(); if( rPageSize.Width() < rPageSize.Height() ) { diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx index 16aa15751712..6251db00a54a 100644 --- a/filter/source/svg/svgfontexport.cxx +++ b/filter/source/svg/svgfontexport.cxx @@ -196,7 +196,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont ) vcl::Font aFont( rFont ); aFont.SetSize( Size( 0, nFontEM ) ); - aFont.SetAlign( ALIGN_BASELINE ); + aFont.SetAlignment( ALIGN_BASELINE ); pVDev->SetMapMode( MAP_100TH_MM ); pVDev->SetFont( aFont ); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 9f92c998af11..ee07784fab6d 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1555,9 +1555,9 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos, const FontMetric aMetric( mpVDev->GetFontMetric() ); const vcl::Font& rFont = mpVDev->GetFont(); - if( rFont.GetAlign() == ALIGN_TOP ) + if( rFont.GetAlignment() == ALIGN_TOP ) aBaseLinePos.Y() += aMetric.GetAscent(); - else if( rFont.GetAlign() == ALIGN_BOTTOM ) + else if( rFont.GetAlignment() == ALIGN_BOTTOM ) aBaseLinePos.Y() -= aMetric.GetDescent(); if( bApplyMapping ) @@ -2435,9 +2435,9 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, const FontMetric aMetric( mpVDev->GetFontMetric() ); const vcl::Font& rFont = mpVDev->GetFont(); - if( rFont.GetAlign() == ALIGN_TOP ) + if( rFont.GetAlignment() == ALIGN_TOP ) aBaseLinePos.Y() += aMetric.GetAscent(); - else if( rFont.GetAlign() == ALIGN_BOTTOM ) + else if( rFont.GetAlignment() == ALIGN_BOTTOM ) aBaseLinePos.Y() -= aMetric.GetDescent(); if( bApplyMapping ) diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx index 87a9d8744f68..7f9d2722005f 100644 --- a/include/vcl/font.hxx +++ b/include/vcl/font.hxx @@ -64,8 +64,8 @@ public: FontPitch GetPitch() const; FontWidth GetWidthType(); FontWidth GetWidthType() const; + FontAlign GetAlignment() const; rtl_TextEncoding GetCharSet() const; - FontAlign GetAlign() const; bool IsSymbolFont() const; @@ -77,8 +77,8 @@ public: void SetItalic( FontItalic ); void SetWeight( FontWeight ); void SetWidthType( FontWidth ); + void SetAlignment( FontAlign ); void SetCharSet( rtl_TextEncoding ); - void SetAlign( FontAlign ); void SetSymbolFlag( bool ); diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index ea706eb6beb1..6b28dec2e7e5 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1171,7 +1171,7 @@ public: bool IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); } void SetTextAlign( TextAlign eAlign ); - TextAlign GetTextAlign() const { return maFont.GetAlign(); } + TextAlign GetTextAlign() const { return maFont.GetAlignment(); } /** Width of the text. diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 4a4e75670cd5..b1f6d5f4ad86 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -111,7 +111,7 @@ static void lcl_DrawOneFrame( vcl::RenderContext* pDev, const Rectangle& rInnerP vcl::Font aAppFont = pDev->GetSettings().GetStyleSettings().GetAppFont(); aAppFont.SetSize( aAttrFont.GetSize() ); - aAppFont.SetAlign( ALIGN_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 3331a62c690d..6cd5ed5be3c3 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -323,7 +323,7 @@ void ScDrawStringsVars::SetPattern( else pPattern->GetFont( aFont, eColorMode, pFmtDevice, &pOutput->aZoomY, pCondSet, nScript, &aBackConfigColor, &aTextConfigColor ); - aFont.SetAlign(ALIGN_BASELINE); + aFont.SetAlignment(ALIGN_BASELINE); // orientation diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx index 308d381d1591..18ff749ef7d7 100644 --- a/slideshow/source/engine/rehearsetimingsactivity.cxx +++ b/slideshow/source/engine/rehearsetimingsactivity.cxx @@ -155,7 +155,7 @@ RehearseTimingsActivity::RehearseTimingsActivity( const SlideShowContext& rConte { maFont.SetHeight( maFont.GetHeight() * 2 ); maFont.SetWidth( maFont.GetWidth() * 2 ); - maFont.SetAlign( ALIGN_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 b6e95594c612..5dcbf81e1d49 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -267,7 +267,7 @@ void SmShowFont::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRec vcl::Font aFont(maFont); aFont.SetSize(Size(0, 24 * rRenderContext.GetDPIScaleFactor())); - aFont.SetAlign(ALIGN_TOP); + aFont.SetAlignment(ALIGN_TOP); rRenderContext.SetFont(aFont); rRenderContext.SetTextColor(aTextColor); @@ -1148,7 +1148,7 @@ void SmShowSymbolSetWindow::Paint(vcl::RenderContext& rRenderContext, const Rect { SmSym aSymbol(*aSymbolSet[i]); vcl::Font aFont(aSymbol.GetFace()); - aFont.SetAlign(ALIGN_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) @@ -1423,7 +1423,7 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) { vcl::Font aFont (pSymbol->GetFace()); setFontSize(aFont); - aFont.SetAlign(ALIGN_BASELINE); + aFont.SetAlignment(ALIGN_BASELINE); SetFont(aFont); sal_UCS4 cChar = pSymbol->GetCharacter(); @@ -1688,7 +1688,7 @@ void SmShowChar::SetSymbol( sal_UCS4 cChar, const vcl::Font &rFont ) { vcl::Font aFont( rFont ); aFont.SetSize( Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3) ); - aFont.SetAlign(ALIGN_BASELINE); + aFont.SetAlignment(ALIGN_BASELINE); SetFont(aFont); aFont.SetTransparent(true); diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx index c1917dabb61f..fe3fde2d49e3 100644 --- a/starmath/source/format.cxx +++ b/starmath/source/format.cxx @@ -158,7 +158,7 @@ SmFormat::SmFormat() { SmFace &rFace = vFont[i]; rFace.SetTransparent( true ); - rFace.SetAlign( ALIGN_BASELINE ); + rFace.SetAlignment( ALIGN_BASELINE ); rFace.SetColor( COL_AUTO ); bDefaultFont[i] = false; } @@ -169,7 +169,7 @@ void SmFormat::SetFont(sal_uInt16 nIdent, const SmFace &rFont, bool bDefault ) { vFont[nIdent] = rFont; vFont[nIdent].SetTransparent( true ); - vFont[nIdent].SetAlign( ALIGN_BASELINE ); + vFont[nIdent].SetAlignment( ALIGN_BASELINE ); bDefaultFont[nIdent] = bDefault; } diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index e341a2b626d3..4ca941ae396e 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -615,7 +615,7 @@ bool SmGetGlyphBoundRect(const vcl::RenderContext &rDev, pGlyphDev->Push(PushFlags::FONT | PushFlags::MAPMODE); vcl::Font aFnt(rDev.GetFont()); - aFnt.SetAlign(ALIGN_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 1834c69b81d1..46e71a2eb838 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -52,7 +52,7 @@ SmSym::SmSym() : { m_aExportName = m_aName; m_aFace.SetTransparent(true); - m_aFace.SetAlign(ALIGN_BASELINE); + m_aFace.SetAlignment(ALIGN_BASELINE); } @@ -69,7 +69,7 @@ SmSym::SmSym(const OUString& rName, const vcl::Font& rFont, sal_UCS4 cChar, m_aFace = rFont; m_aFace.SetTransparent(true); - m_aFace.SetAlign(ALIGN_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 b976d9f305ee..c2b6eaf4eaf6 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -460,7 +460,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* SmFace aSet( sFontName, rOld.GetSize() ); aSet.SetBorderWidth( rOld.GetBorderWidth() ); - aSet.SetAlign( ALIGN_BASELINE ); + aSet.SetAlignment( ALIGN_BASELINE ); aFormat.SetFont( (*ppEntries)->mnMemberId, aSet ); } } diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx index 3e79a86bcadc..1e20743bdf24 100644 --- a/starmath/source/utility.cxx +++ b/starmath/source/utility.cxx @@ -235,7 +235,7 @@ void SmFace::Impl_Init() { SetSize( GetSize() ); SetTransparent( true ); - SetAlign( ALIGN_BASELINE ); + SetAlignment( ALIGN_BASELINE ); SetColor( COL_AUTO ); } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index fc7c04ca5173..8708c03704a2 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1148,7 +1148,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri Size aSize650 (0, 650); vcl::Font aFont(FAMILY_DONTKNOW, aSize600); - aFont.SetAlign(ALIGN_TOP); + aFont.SetAlignment(ALIGN_TOP); aFont.SetWeight(WEIGHT_BOLD); aFont.SetSize(aSize650); aFont.SetColor( Color(COL_BLACK) ); @@ -1192,7 +1192,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri if (bIsPrintFormulaText) { vcl::Font aFont(FAMILY_DONTKNOW, Size(0, 600)); - aFont.SetAlign(ALIGN_TOP); + aFont.SetAlignment(ALIGN_TOP); aFont.SetColor( Color(COL_BLACK) ); // get size diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 8612dc5afc88..7a444881bac0 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -527,7 +527,7 @@ void SmDrawingVisitor::DrawSpecialNode( SmSpecialNode* pNode ) { //! since this chars might come from any font, that we may not have //! set to ALIGN_BASELINE yet, we do it now. - pNode->GetFont( ).SetAlign( ALIGN_BASELINE ); + pNode->GetFont( ).SetAlignment( ALIGN_BASELINE ); DrawTextNode( pNode ); } diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 0e33369408e3..d049d7318c21 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -159,7 +159,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape, vcl::Font aFont; const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pCustomShape->GetMergedItem( EE_CHAR_FONTINFO )); aFont.SetHeight( pCustomShape->GetLogicRect().GetHeight() / rFWData.nMaxParagraphsPerTextArea ); - aFont.SetAlign( ALIGN_TOP ); + aFont.SetAlignment( ALIGN_TOP ); aFont.SetFamilyName( rFontItem.GetFamilyName() ); aFont.SetFamily( rFontItem.GetFamily() ); aFont.SetStyleName( rFontItem.GetStyleName() ); @@ -246,7 +246,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pCustomShape->GetMergedItem( nFntItm )); vcl::Font aFont; aFont.SetHeight( rFWData.nSingleLineHeight ); - aFont.SetAlign( ALIGN_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 1c6f0bb93c33..bd3c81bf8600 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -523,7 +523,7 @@ void SvxShowCharSet::InitSettings(vcl::RenderContext& rRenderContext) vcl::Font aFont(rRenderContext.GetFont()); aFont.SetWeight(WEIGHT_LIGHT); - aFont.SetAlign(ALIGN_TOP); + aFont.SetAlignment(ALIGN_TOP); aFont.SetSize(maFontSize); aFont.SetTransparent(true); rRenderContext.SetFont(aFont); @@ -556,7 +556,7 @@ void SvxShowCharSet::RecalculateFont(vcl::RenderContext& rRenderContext) vcl::Font aFont = rRenderContext.GetFont(); aFont.SetWeight(WEIGHT_LIGHT); - aFont.SetAlign(ALIGN_TOP); + aFont.SetAlignment(ALIGN_TOP); int nFontHeight = (aSize.Height() - 5) * 2 / (3 * ROW_COUNT); maFontSize = rRenderContext.PixelToLogic(Size(0, nFontHeight)); aFont.SetSize(maFontSize); diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 682035c8f6f4..34bde58e7d54 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -92,7 +92,7 @@ void scaleFontWidth(vcl::Font& rFont, vcl::RenderContext& rRenderContext,long& n void initFont(vcl::Font& rFont) { rFont.SetTransparent(true); - rFont.SetAlign(ALIGN_BASELINE); + rFont.SetAlignment(ALIGN_BASELINE); } void setFontSize(vcl::Font& rFont) @@ -118,7 +118,7 @@ void setFont(const SvxFont& rNewFont, SvxFont& rImplFont) { rImplFont = rNewFont; rImplFont.SetTransparent(true); - rImplFont.SetAlign(ALIGN_BASELINE); + rImplFont.SetAlignment(ALIGN_BASELINE); } } // end anonymous namespace diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index dbd14d786715..cfea596f881a 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -987,7 +987,7 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt FontMetric aFontMetric( mpVD->GetFontMetric() ); vcl::Font aFnt( mpVD->GetFont() ); - FontAlign eAlg( aFnt.GetAlign() ); + FontAlign eAlg( aFnt.GetAlignment() ); sal_Int32 nTextWidth = (sal_Int32)( mpVD->GetTextWidth( rStr ) * mfScaleX ); sal_Int32 nTextHeight = (sal_Int32)( mpVD->GetTextHeight() * mfScaleY ); diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index e732c684ecb2..06f90312ee24 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -502,7 +502,7 @@ inline void SwFont::SetPitch( const FontPitch ePitch, const sal_uInt8 nWhich ) inline void SwSubFont::SetAlign( const FontAlign eAlign ) { m_pMagic = nullptr; - Font::SetAlign( eAlign ); + Font::SetAlignment( eAlign ); } inline void SwFont::SetAlign( const FontAlign eAlign ) diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 9be761701f95..c70efd054b71 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -140,7 +140,7 @@ static void lcl_PrintHeader( vcl::RenderContext &rOutDev, sal_Int32 nPages, sal_ vcl::Font aFont( aOldFont ); aFont.SetWeight( WEIGHT_BOLD ); - aFont.SetAlign( ALIGN_BOTTOM ); + aFont.SetAlignment( ALIGN_BOTTOM ); rOutDev.SetFont( aFont ); long nFontHeight = rOutDev.GetTextHeight(); diff --git a/vcl/inc/fontattributes.hxx b/vcl/inc/fontattributes.hxx index 870afd34343e..5b8135f33db7 100644 --- a/vcl/inc/fontattributes.hxx +++ b/vcl/inc/fontattributes.hxx @@ -39,7 +39,8 @@ public: FontItalic GetItalic() const { return meItalic; } FontPitch GetPitch() const { return mePitch; } FontWidth GetWidthType() const { return meWidthType; } - rtl_TextEncoding GetCharSet() const { return meCharSet; } + TextAlign GetAlignment() const { return meAlign; } + rtl_TextEncoding GetCharSet() const { return meCharSet; } bool IsSymbolFont() const { return mbSymbolFlag; } @@ -51,6 +52,7 @@ public: void SetItalic(const FontItalic eItalic ) { meItalic = eItalic; } void SetWeight(const FontWeight eWeight ) { meWeight = eWeight; } void SetWidthType(const FontWidth eWidthType) { meWidthType = eWidthType; } + void SetAlignment(const TextAlign eAlignment) { meAlign = eAlignment; } void SetCharSet( const rtl_TextEncoding ); void SetSymbolFlag(const bool ); @@ -101,6 +103,7 @@ private: FontPitch mePitch; // Pitch Type FontWidth meWidthType; // Width Type FontItalic meItalic; // Slant Type + TextAlign meAlign; // Text alignment rtl_TextEncoding meCharSet; // RTL_TEXTENCODING_SYMBOL or RTL_TEXTENCODING_UNICODE bool mbSymbolFlag; // Is font a symbol? diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index ee353c2155a4..cde8e097821c 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -50,6 +50,7 @@ public: FontPitch GetPitchNoAsk() const { return mePitch; } FontWidth GetWidthType() { if(meWidthType==WIDTH_DONTKNOW) AskConfig(); return meWidthType; } FontWidth GetWidthTypeNoAsk() const { return meWidthType; } + TextAlign GetAlignment() const { return meAlign; } rtl_TextEncoding GetCharSet() const { return meCharSet; } bool IsSymbolFont() const { return mbSymbol; } @@ -62,6 +63,7 @@ public: void SetItalic( const FontItalic eItalic ) { meItalic = eItalic; } void SetWeight( const FontWeight eWeight ) { meWeight = eWeight; } void SetWidthType( const FontWidth eWidthType ) { meWidthType = eWidthType; } + void SetAlignment( const TextAlign eAlignment ) { meAlign = eAlignment; } void SetCharSet( const rtl_TextEncoding eCharSet ) { meCharSet = eCharSet; } void SetSymbolFlag( const bool bSymbolFlag ) { mbSymbol = bSymbolFlag; } diff --git a/vcl/qa/cppunit/font.cxx b/vcl/qa/cppunit/font.cxx index 5a8ad8384523..d496ebe418d3 100644 --- a/vcl/qa/cppunit/font.cxx +++ b/vcl/qa/cppunit/font.cxx @@ -26,6 +26,7 @@ public: void testWidthType(); void testPitch(); void testItalic(); + void testAlignment(); void testQuality(); void testBuiltInFontFlag(); void testEmbeddableFontFlag(); @@ -39,6 +40,7 @@ public: CPPUNIT_TEST(testWidthType); CPPUNIT_TEST(testPitch); CPPUNIT_TEST(testItalic); + CPPUNIT_TEST(testAlignment); CPPUNIT_TEST(testQuality); CPPUNIT_TEST(testBuiltInFontFlag); CPPUNIT_TEST(testEmbeddableFontFlag); @@ -91,6 +93,18 @@ void VclFontTest::testItalic() CPPUNIT_ASSERT_EQUAL_MESSAGE( "Italic should be EXPANDED", FontItalic::ITALIC_NORMAL, aFont.GetItalic()); } + +void VclFontTest::testAlignment() +{ + vcl::Font aFont; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Text alignment should be ALIGN_TOP", TextAlign::ALIGN_TOP, aFont.GetAlignment()); + + aFont.SetAlignment(TextAlign::ALIGN_BASELINE); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Text alignment should be ALIGN_BASELINE", TextAlign::ALIGN_BASELINE, aFont.GetAlignment()); +} + + void VclFontTest::testPitch() { vcl::Font aFont; diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 6763664329c1..6f593a7931b4 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -191,8 +191,8 @@ void TextEngine::SetFont( const vcl::Font& rFont ) aFillColor.SetTransparency( 0 ); maFont.SetFillColor( aFillColor ); - maFont.SetAlign( ALIGN_TOP ); - mpRefDev->SetFont( maFont); + maFont.SetAlignment( ALIGN_TOP ); + mpRefDev->SetFont( maFont ); Size aTextSize; aTextSize.Width() = mpRefDev->GetTextWidth(" "); aTextSize.Height() = mpRefDev->GetTextHeight(); diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 90070a4bd361..7d5c0d4ab8aa 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -532,7 +532,7 @@ sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, bool Kapt, sal_u aColor=Sgv2SvFarbe(Atr.L.LFarbe,Atr.L.LBFarbe,Atr.L.LIntens); aFont.SetColor(aColor); aColor=Sgv2SvFarbe(Atr.F.FFarbe,Atr.F.FBFarbe,Atr.F.FIntens); aFont.SetFillColor(aColor); aFont.SetTransparent(true); - aFont.SetAlign(ALIGN_BASELINE); + aFont.SetAlignment(ALIGN_BASELINE); nRotation/=10; nRotation=3600-nRotation; if (nRotation==3600) nRotation=0; aFont.SetOrientation(nRotation); diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 4785f3660cfa..68ed00c6adc9 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -587,7 +587,7 @@ void EMFWriter::ImplCheckTextAttr() // TextAlign sal_uInt32 nTextAlign; - switch( rFont.GetAlign() ) + switch( rFont.GetAlignment() ) { case ALIGN_TOP: nTextAlign = TA_TOP; break; case ALIGN_BOTTOM: nTextAlign = TA_BOTTOM; break; diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index 03135e0173e5..39ed115c6b60 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -1427,11 +1427,11 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b aTmp.SetTransparent( false ); if ( ( mnTextAlign & TA_BASELINE) == TA_BASELINE ) - aTmp.SetAlign( ALIGN_BASELINE ); + aTmp.SetAlignment( ALIGN_BASELINE ); else if( ( mnTextAlign & TA_BOTTOM) == TA_BOTTOM ) - aTmp.SetAlign( ALIGN_BOTTOM ); + aTmp.SetAlignment( ALIGN_BOTTOM ); else - aTmp.SetAlign( ALIGN_TOP ); + aTmp.SetAlignment( ALIGN_TOP ); if ( nGfxMode == GM_ADVANCED ) { @@ -1489,7 +1489,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b { maLatestFont = aTmp; mpGDIMetaFile->AddAction( new MetaFontAction( aTmp ) ); - mpGDIMetaFile->AddAction( new MetaTextAlignAction( aTmp.GetAlign() ) ); + mpGDIMetaFile->AddAction( new MetaTextAlignAction( aTmp.GetAlignment() ) ); mpGDIMetaFile->AddAction( new MetaTextColorAction( aTmp.GetColor() ) ); mpGDIMetaFile->AddAction( new MetaTextFillColorAction( aTmp.GetFillColor(), !aTmp.IsTransparent() ) ); } diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index aa873e311d78..f12b51096dc9 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1454,9 +1454,9 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) { aSrcFont.SetCharSet( RTL_TEXTENCODING_MS_1252 ); } - eSrcTextAlign = aSrcFont.GetAlign(); + eSrcTextAlign = aSrcFont.GetAlignment(); aSrcTextColor = aSrcFont.GetColor(); - aSrcFont.SetAlign( ALIGN_BASELINE ); + aSrcFont.SetAlignment( ALIGN_BASELINE ); aSrcFont.SetColor( COL_WHITE ); } break; @@ -1789,7 +1789,7 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, vcl::Font aFont; aFont.SetCharSet( GetExtendedTextEncoding( RTL_TEXTENCODING_MS_1252 ) ); aFont.SetColor( Color( COL_WHITE ) ); - aFont.SetAlign( ALIGN_BASELINE ); + aFont.SetAlignment( ALIGN_BASELINE ); aDstFont = aSrcFont = aFont; CreateSelectDeleteFont(aDstFont); diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index dafc81225dd9..9270d0ba3ee2 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -128,12 +128,12 @@ void Font::SetTransparent( bool bTransparent ) } } -void Font::SetAlign( FontAlign eAlign ) +void Font::SetAlignment( FontAlign eAlign ) { if( mpImplFont->meAlign != eAlign ) { MakeUnique(); - mpImplFont->meAlign = eAlign; + mpImplFont->SetAlignment(eAlign); } } @@ -776,7 +776,7 @@ const Color& Font::GetColor() const { return mpImplFont->maColor; } const Color& Font::GetFillColor() const { return mpImplFont->maFillColor; } bool Font::IsTransparent() const { return mpImplFont->mbTransparent; } -FontAlign Font::GetAlign() const { return mpImplFont->meAlign; } +FontAlign Font::GetAlignment() const { return mpImplFont->GetAlignment(); } const OUString& Font::GetFamilyName() const { return mpImplFont->GetFamilyName(); } const OUString& Font::GetStyleName() const { return mpImplFont->maStyleName; } diff --git a/vcl/source/font/fontattributes.cxx b/vcl/source/font/fontattributes.cxx index 4f5c9e4bfcce..0702932007c2 100644 --- a/vcl/source/font/fontattributes.cxx +++ b/vcl/source/font/fontattributes.cxx @@ -28,6 +28,7 @@ FontAttributes::FontAttributes() mePitch( PITCH_DONTKNOW ), meWidthType ( WIDTH_DONTKNOW ), meItalic ( ITALIC_NONE ), + meAlign ( ALIGN_TOP ), meCharSet( RTL_TEXTENCODING_DONTKNOW ), mbSymbolFlag( false ), mnQuality( 0 ), @@ -45,6 +46,7 @@ FontAttributes::FontAttributes( const FontAttributes& rFontAttributes ) : mePitch( rFontAttributes.mePitch ), meWidthType( rFontAttributes.meWidthType ), meItalic( rFontAttributes.meItalic ), + meAlign( rFontAttributes.meAlign ), meCharSet( rFontAttributes.meCharSet ), mbSymbolFlag( rFontAttributes.mbSymbolFlag ), maMapNames( rFontAttributes.maMapNames ), @@ -55,7 +57,6 @@ FontAttributes::FontAttributes( const FontAttributes& rFontAttributes ) : mbEmbeddable( rFontAttributes.mbEmbeddable ) {} - bool FontAttributes::CompareDeviceIndependentFontAttributes(const FontAttributes& rOther) const { if (maFamilyName != rOther.maFamilyName) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index d78501278124..11e43a993fb6 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8846,7 +8846,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool double fXScale = 1.0; double fSkew = 0.0; sal_Int32 nPixelFontHeight = m_pReferenceDevice->mpFontInstance->maFontSelData.mnHeight; - TextAlign eAlign = m_aCurrentPDFState.m_aFont.GetAlign(); + TextAlign eAlign = m_aCurrentPDFState.m_aFont.GetAlignment(); // transform font height back to current units // note: the layout calculates in outdevs device pixel !! @@ -9873,7 +9873,7 @@ void PDFWriterImpl::drawTextLine( const Point& rPos, long nWidth, FontStrikeout } Point aPos( rPos ); - TextAlign eAlign = m_aCurrentPDFState.m_aFont.GetAlign(); + TextAlign eAlign = m_aCurrentPDFState.m_aFont.GetAlignment(); if( eAlign == ALIGN_TOP ) aPos.Y() += HCONV( pFontInstance->mxFontMetric->GetAscent() ); else if( eAlign == ALIGN_BOTTOM ) @@ -12066,7 +12066,7 @@ void PDFWriterImpl::pop() if( ! (aState.m_nFlags & PushFlags::OVERLINECOLOR ) ) setOverlineColor( aState.m_aOverlineColor ); if( ! (aState.m_nFlags & PushFlags::TEXTALIGN ) ) - setTextAlign( aState.m_aFont.GetAlign() ); + setTextAlign( aState.m_aFont.GetAlignment() ); if( ! (aState.m_nFlags & PushFlags::TEXTFILLCOLOR) ) setTextFillColor( aState.m_aFont.GetFillColor() ); if( ! (aState.m_nFlags & PushFlags::REFPOINT) ) diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 9a1d86153593..2864fa06e987 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -1149,7 +1149,7 @@ public: void setTextAlign( TextAlign eAlign ) { - m_aGraphicsStack.front().m_aFont.SetAlign( eAlign ); + m_aGraphicsStack.front().m_aFont.SetAlignment( eAlign ); m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFont; } diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 83f19b021fbf..c7aba9117076 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -249,7 +249,7 @@ void ImplWriteFont( SvStream& rOStm, const vcl::Font& rFont, rOStm.WriteInt16( rActualCharSet ); rOStm.WriteInt16( rFont.GetFamilyType() ); rOStm.WriteInt16( rFont.GetPitch() ); - rOStm.WriteInt16( rFont.GetAlign() ); + rOStm.WriteInt16( rFont.GetAlignment() ); rOStm.WriteInt16( nWeight ); rOStm.WriteInt16( rFont.GetUnderline() ); rOStm.WriteInt16( rFont.GetStrikeout() ); @@ -828,7 +828,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) aFont.SetCharSet( (rtl_TextEncoding) nCharSet ); aFont.SetFamily( (FontFamily) nFamily ); aFont.SetPitch( (FontPitch) nPitch ); - aFont.SetAlign( (FontAlign) nAlign ); + aFont.SetAlignment( (FontAlign) nAlign ); aFont.SetWeight( ( nWeight == 1 ) ? WEIGHT_LIGHT : ( nWeight == 2 ) ? WEIGHT_NORMAL : ( nWeight == 3 ) ? WEIGHT_BOLD : WEIGHT_DONTKNOW ); aFont.SetUnderline( (FontUnderline) nUnderline ); @@ -844,7 +844,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) eActualCharSet = osl_getThreadTextEncoding(); rMtf.AddAction( new MetaFontAction( aFont ) ); - rMtf.AddAction( new MetaTextAlignAction( aFont.GetAlign() ) ); + rMtf.AddAction( new MetaTextAlignAction( aFont.GetAlignment() ) ); rMtf.AddAction( new MetaTextColorAction( aFont.GetColor() ) ); rMtf.AddAction( new MetaTextFillColorAction( aFont.GetFillColor(), !aFont.IsTransparent() ) ); @@ -2063,7 +2063,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { vcl::Font aSaveFont( rSaveVDev.GetFont() ); - aSaveFont.SetAlign( static_cast<const MetaTextAlignAction*>(pAction)->GetTextAlign() ); + aSaveFont.SetAlignment( static_cast<const MetaTextAlignAction*>(pAction)->GetTextAlign() ); rSaveVDev.SetFont( aSaveFont ); ImplWriteFont( rOStm, rSaveVDev.GetFont(), rActualCharSet ); nCount++; diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index c9c8d3792849..4850234cd068 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -58,6 +58,7 @@ FontMetric OutputDevice::GetDevFont( int nDevFontIndex ) const aFontMetric.SetPitch( rData.GetPitch() ); aFontMetric.SetWeight( rData.GetWeight() ); aFontMetric.SetItalic( rData.GetItalic() ); + aFontMetric.SetAlignment( rData.GetAlignment() ); aFontMetric.SetWidthType( rData.GetWidthType() ); aFontMetric.SetScalableFlag( rData.IsScalable() ); aFontMetric.SetBuiltInFontFlag( rData.IsBuiltInFont() ); @@ -182,6 +183,7 @@ FontMetric OutputDevice::GetFontMetric() const aMetric.SetPitch( xFontMetric->GetPitch() ); aMetric.SetWeight( xFontMetric->GetWeight() ); aMetric.SetItalic( xFontMetric->GetItalic() ); + aMetric.SetAlignment( xFontMetric->GetAlignment() ); aMetric.SetWidthType( xFontMetric->GetWidthType() ); if ( pFontInstance->mnOwnOrientation ) aMetric.SetOrientation( pFontInstance->mnOwnOrientation ); @@ -1124,7 +1126,7 @@ bool OutputDevice::ImplNewFont() const } // calculate text offset depending on TextAlignment - TextAlign eAlign = maFont.GetAlign(); + TextAlign eAlign = maFont.GetAlignment(); if ( eAlign == ALIGN_BASELINE ) { mnTextOffX = 0; diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index eb118dec4c6b..fd875f526c8b 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -94,7 +94,7 @@ OutputDevice::OutputDevice() : mbOutputClipped = false; maTextColor = Color( COL_BLACK ); maOverlineColor = Color( COL_TRANSPARENT ); - meTextAlign = maFont.GetAlign(); + meTextAlign = maFont.GetAlignment(); meRasterOp = ROP_OVERPAINT; mnAntialiasing = AntialiasingFlags::NONE; meTextLanguage = 0; // TODO: get default from configuration? diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx index 4a0f4855b7a7..99ec55b6803e 100644 --- a/vcl/source/outdev/outdevstate.cxx +++ b/vcl/source/outdev/outdevstate.cxx @@ -532,7 +532,7 @@ void OutputDevice::SetFont( const vcl::Font& rNewFont ) mpMetaFile->AddAction( new MetaFontAction( aFont ) ); // the color and alignment actions don't belong here // TODO: get rid of them without breaking anything... - mpMetaFile->AddAction( new MetaTextAlignAction( aFont.GetAlign() ) ); + mpMetaFile->AddAction( new MetaTextAlignAction( aFont.GetAlignment() ) ); mpMetaFile->AddAction( new MetaTextFillColorAction( aFont.GetFillColor(), !aFont.IsTransparent() ) ); } diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 147d82ffcefa..4211bad7d28b 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -806,9 +806,9 @@ void OutputDevice::SetTextAlign( TextAlign eAlign ) if ( mpMetaFile ) mpMetaFile->AddAction( new MetaTextAlignAction( eAlign ) ); - if ( maFont.GetAlign() != eAlign ) + if ( maFont.GetAlignment() != eAlign ) { - maFont.SetAlign( eAlign ); + maFont.SetAlignment( eAlign ); mbNewFont = true; } |