diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-06-14 11:10:32 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2013-06-16 15:30:01 +0000 |
commit | 3d12036000f4e13127affc0cb764fc65cf89af44 (patch) | |
tree | c52bb99e41e41e274c741ac6bbd5a7279494fe62 /vcl/aqua/source | |
parent | 7441d4bbdbbcb87193c32510f3577a0e531467e5 (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/aqua/source')
-rw-r--r-- | vcl/aqua/source/gdi/atsui/salatslayout.cxx | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/vcl/aqua/source/gdi/atsui/salatslayout.cxx b/vcl/aqua/source/gdi/atsui/salatslayout.cxx index 1b9776e8c195..fd080f6d9976 100644 --- a/vcl/aqua/source/gdi/atsui/salatslayout.cxx +++ b/vcl/aqua/source/gdi/atsui/salatslayout.cxx @@ -56,8 +56,6 @@ public: virtual void GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const; virtual bool GetBoundRect( SalGraphics&, Rectangle& ) const; - const PhysicalFontFace* GetFallbackFontData( sal_GlyphId ) const; - virtual void InitFont() const; virtual void MoveGlyph( int nStart, long nNewXPos ); virtual void DropGlyph( int nStart ); @@ -505,7 +503,8 @@ void ATSLayout::DrawText( SalGraphics& rGraphics ) const * @return : number of glyph details that were provided **/ int ATSLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int& nStart, - sal_Int32* pGlyphAdvances, int* pCharIndexes ) const + sal_Int32* pGlyphAdvances, int* pCharIndexes, + const PhysicalFontFace** pFallbackFonts ) const { if( nStart < 0 ) // first glyph requested? nStart = 0; @@ -582,6 +581,9 @@ int ATSLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int const int nLevel = mpFallbackInfo->AddFallback( nFallbackFontID ); // update sal_GlyphId with fallback level nGlyphId |= (nLevel << GF_FONTSHIFT); + + if( pFallbackFonts ) + *(pFallbackFonts++) = mpFallbackInfo->GetFallbackFontData( nLevel ); } // update resulting glyphid array @@ -1184,20 +1186,6 @@ void ATSLayout::MoveGlyph( int /*nStart*/, long /*nNewXPos*/ ) {} void ATSLayout::DropGlyph( int /*nStart*/ ) {} void ATSLayout::Simplify( bool /*bIsBase*/ ) {} -// get the PhysicalFontFace for a glyph fallback font -// for a glyphid that was returned by ATSLayout::GetNextGlyphs() -const PhysicalFontFace* ATSLayout::GetFallbackFontData( sal_GlyphId nGlyphId ) const -{ - // check if any fallback fonts were needed - if( !mpFallbackInfo ) - return NULL; - // check if the current glyph needs a fallback font - int nFallbackLevel = (nGlyphId & GF_FONTMASK) >> GF_FONTSHIFT; - if( !nFallbackLevel ) - return NULL; - return mpFallbackInfo->GetFallbackFontData( nFallbackLevel ); -} - // ======================================================================= int FallbackInfo::AddFallback( ATSUFontID nFontId ) |