diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-21 08:38:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-22 00:24:15 +0200 |
commit | b10c8f3fce37d72019f4767fdb9612b46845aecd (patch) | |
tree | b6a74975522b301cb9892021a32135ee75bf7a2d /vcl/source/font | |
parent | 4790dd4d957827f9b2eeffe23ce1a8d63635df0d (diff) |
turn the cache around to work on LogicalFontInstance
instead of a FontSelectPattern with an associated LogicalFontInstance
use a LogicalFontInstance with owned FontSelectPatternAttributes
Change-Id: I939f84731fcb8db5ff6484dcfbd2f9199bb50d23
Reviewed-on: https://gerrit.libreoffice.org/59388
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/font')
-rw-r--r-- | vcl/source/font/PhysicalFontCollection.cxx | 2 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontFace.cxx | 2 | ||||
-rw-r--r-- | vcl/source/font/fontcache.cxx | 8 | ||||
-rw-r--r-- | vcl/source/font/fontinstance.cxx | 5 |
4 files changed, 8 insertions, 9 deletions
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index fc5a08ca8feb..821da5cdf937 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -943,7 +943,7 @@ static bool FindMetricCompatibleFont(FontSelectPatternAttributes& rFontSelData) return false; } -PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& rFSD ) const +PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPatternAttributes& rFSD ) const { // give up if no fonts are available if( !Count() ) diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx index a244e7966eb6..5aa39e677dcb 100644 --- a/vcl/source/font/PhysicalFontFace.cxx +++ b/vcl/source/font/PhysicalFontFace.cxx @@ -37,7 +37,7 @@ PhysicalFontFace::PhysicalFontFace( const FontAttributes& rDFA ) SetSymbolFlag( true ); } -rtl::Reference<LogicalFontInstance> PhysicalFontFace::CreateFontInstance(const FontSelectPattern& rFSD) const +rtl::Reference<LogicalFontInstance> PhysicalFontFace::CreateFontInstance(const FontSelectPatternAttributes& rFSD) const { return new LogicalFontInstance(*this, rFSD); } diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx index 5ab66052e9c1..4272fd1ef113 100644 --- a/vcl/source/font/fontcache.cxx +++ b/vcl/source/font/fontcache.cxx @@ -95,12 +95,12 @@ rtl::Reference<LogicalFontInstance> ImplFontCache::GetFontInstance( PhysicalFont const vcl::Font& rFont, const Size& rSize, float fExactHeight ) { // initialize internal font request object - FontSelectPattern aFontSelData(rFont, rFont.GetFamilyName(), rSize, fExactHeight); + FontSelectPatternAttributes aFontSelData(rFont, rFont.GetFamilyName(), rSize, fExactHeight); return GetFontInstance( pFontList, aFontSelData ); } rtl::Reference<LogicalFontInstance> ImplFontCache::GetFontInstance( PhysicalFontCollection const * pFontList, - FontSelectPattern& aFontSelData ) + FontSelectPatternAttributes& aFontSelData ) { rtl::Reference<LogicalFontInstance> pFontInstance; PhysicalFontFamily* pFontFamily = nullptr; @@ -192,7 +192,7 @@ rtl::Reference<LogicalFontInstance> ImplFontCache::GetFontInstance( PhysicalFont } rtl::Reference<LogicalFontInstance> ImplFontCache::GetGlyphFallbackFont( PhysicalFontCollection const * pFontCollection, - FontSelectPattern& rFontSelData, int nFallbackLevel, OUString& rMissingCodes ) + FontSelectPatternAttributes& rFontSelData, LogicalFontInstance* pFontInstance, int nFallbackLevel, OUString& rMissingCodes ) { // get a candidate font for glyph fallback // unless the previously selected font got a device specific substitution @@ -212,7 +212,7 @@ rtl::Reference<LogicalFontInstance> ImplFontCache::GetGlyphFallbackFont( Physica if (nFallbackLevel == 1) pFallbackData = pFontCollection->FindFontFamily("EUDC"); if (!pFallbackData) - pFallbackData = pFontCollection->GetGlyphFallbackFont(rFontSelData, rFontSelData.mpFontInstance.get(), rMissingCodes, nFallbackLevel-1); + pFallbackData = pFontCollection->GetGlyphFallbackFont(rFontSelData, pFontInstance, rMissingCodes, nFallbackLevel-1); // escape when there are no font candidates if( !pFallbackData ) return nullptr; diff --git a/vcl/source/font/fontinstance.cxx b/vcl/source/font/fontinstance.cxx index 25c637706ca6..218787280228 100644 --- a/vcl/source/font/fontinstance.cxx +++ b/vcl/source/font/fontinstance.cxx @@ -40,7 +40,7 @@ namespace std } -LogicalFontInstance::LogicalFontInstance(const PhysicalFontFace& rFontFace, const FontSelectPattern& rFontSelData ) +LogicalFontInstance::LogicalFontInstance(const PhysicalFontFace& rFontFace, const FontSelectPatternAttributes& rFontSelData ) : mxFontMetric( new ImplFontMetricData( rFontSelData )) , mpConversion( nullptr ) , mnLineHeight( 0 ) @@ -53,12 +53,11 @@ LogicalFontInstance::LogicalFontInstance(const PhysicalFontFace& rFontFace, cons , m_nAveWidthFactor(1.0f) , m_pFontFace(&const_cast<PhysicalFontFace&>(rFontFace)) { - const_cast<FontSelectPattern*>(&m_aFontSelData)->mpFontInstance = this; } void LogicalFontInstance::SetNonAntialiased(bool bNonAntialiased) { - const_cast<FontSelectPattern*>(&m_aFontSelData)->mbNonAntialiased = bNonAntialiased; + const_cast<FontSelectPatternAttributes*>(&m_aFontSelData)->mbNonAntialiased = bNonAntialiased; } LogicalFontInstance::~LogicalFontInstance() |