summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/sallayout.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2013-06-14 11:10:32 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2013-06-16 15:30:01 +0000
commit3d12036000f4e13127affc0cb764fc65cf89af44 (patch)
treec52bb99e41e41e274c741ac6bbd5a7279494fe62 /vcl/source/gdi/sallayout.cxx
parent7441d4bbdbbcb87193c32510f3577a0e531467e5 (diff)
Get rid of SalLayout::GetFallbackFontData()
This is only used in conjunction with SalLayout::GetNextGlyphs() in vcl/source/gdi/pdfwriter_impl.cxx to retrieve the fallback font, if any, used to layout the given glyph, but it is a very convoluted way to do a straight forward thing, and hard to adapt for new SalLayout implementations. So now I just pass a fallback fonts array, when requested, in GetNextGlyphs() itself. Change-Id: I24e7931f64867a4fb4e7b728c65faa6198e24aba Reviewed-on: https://gerrit.libreoffice.org/4285 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/source/gdi/sallayout.cxx')
-rw-r--r--vcl/source/gdi/sallayout.cxx25
1 files changed, 8 insertions, 17 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 4be0ce7c5baa..4df3123db038 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -866,13 +866,6 @@ bool SalLayout::IsSpacingGlyph( sal_GlyphId nGlyph ) const
return bRet;
}
-// -----------------------------------------------------------------------
-
-const PhysicalFontFace* SalLayout::GetFallbackFontData( sal_GlyphId /*nGlyphId*/ ) const
-{
- return NULL;
-}
-
// =======================================================================
GenericSalLayout::GenericSalLayout()
@@ -1353,7 +1346,8 @@ int GenericSalLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor
// -----------------------------------------------------------------------
int GenericSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos,
- int& nStart, sal_Int32* pGlyphAdvAry, int* pCharPosAry ) const
+ int& nStart, sal_Int32* pGlyphAdvAry, int* pCharPosAry,
+ const PhysicalFontFace** /*pFallbackFonts*/ ) const
{
GlyphVector::const_iterator pG = m_GlyphItems.begin();
GlyphVector::const_iterator pGEnd = m_GlyphItems.end();
@@ -1972,14 +1966,6 @@ void MultiSalLayout::InitFont() const
// -----------------------------------------------------------------------
-const PhysicalFontFace* MultiSalLayout::GetFallbackFontData( sal_GlyphId nGlyphId ) const
-{
- int nFallbackLevel = (nGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
- return mpFallbackFonts[ nFallbackLevel ];
-}
-
-// -----------------------------------------------------------------------
-
void MultiSalLayout::DrawText( SalGraphics& rGraphics ) const
{
for( int i = mnLevel; --i >= 0; )
@@ -2111,7 +2097,8 @@ void MultiSalLayout::GetCaretPositions( int nMaxIndex, sal_Int32* pCaretXArray )
// -----------------------------------------------------------------------
int MultiSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& rPos,
- int& nStart, sal_Int32* pGlyphAdvAry, int* pCharPosAry ) const
+ int& nStart, sal_Int32* pGlyphAdvAry, int* pCharPosAry,
+ const PhysicalFontFace** pFallbackFonts ) const
{
// for multi-level fallback only single glyphs should be used
if( mnLevel > 1 && nLen > 1 )
@@ -2141,6 +2128,10 @@ int MultiSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& r
pGlyphAdvAry[i] = w;
}
pGlyphIdxAry[ i ] |= nFontTag;
+ if( pFallbackFonts )
+ {
+ pFallbackFonts[ i ] = mpFallbackFonts[ nLevel ];
+ }
}
rPos += maDrawBase;
rPos += maDrawOffset;