diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-28 16:31:30 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-29 01:59:55 +0000 |
commit | d1a49df6833ff16f5cbaf98534eaae62693e520b (patch) | |
tree | 2bbf60556966b4939f3700cab9d1a6278e6b67f0 /drawinglayer/source | |
parent | 6402164182865d7644d2e93158a23e12a6da3926 (diff) |
vcl: add text alignment functions to ImplFont and FontAttributes
ImplFont and FontAttributes now have GetAlignment and SetAlignment,
and I have renamed Font::GetAlign to Font::GetAlignment, and
Font::SetAlign to Font::SetAlignment.
See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor
and mutator for font scaling in FontMetric") for reasoning behind
patch.
Unit test added to vcl/qa/cppunit/font.cxx to test text alignment.
Change-Id: I6272c84fc9416c90616d957d1897eba9469fe7ba
Reviewed-on: https://gerrit.libreoffice.org/21876
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/primitive2d/metafileprimitive2d.cxx | 12 | ||||
-rw-r--r-- | drawinglayer/source/primitive2d/textlayoutdevice.cxx | 2 |
2 files changed, 7 insertions, 7 deletions
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())); |