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 /starmath | |
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 'starmath')
-rw-r--r-- | starmath/source/dialog.cxx | 8 | ||||
-rw-r--r-- | starmath/source/format.cxx | 4 | ||||
-rw-r--r-- | starmath/source/rect.cxx | 2 | ||||
-rw-r--r-- | starmath/source/symbol.cxx | 4 | ||||
-rw-r--r-- | starmath/source/unomodel.cxx | 2 | ||||
-rw-r--r-- | starmath/source/utility.cxx | 2 | ||||
-rw-r--r-- | starmath/source/view.cxx | 4 | ||||
-rw-r--r-- | starmath/source/visitors.cxx | 2 |
8 files changed, 14 insertions, 14 deletions
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 ); } |