diff options
author | Khaled Hosny <khaled@aliftype.com> | 2022-09-08 16:57:03 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2022-09-08 22:15:25 +0200 |
commit | 88d7aa8ab79b1197191b5eb24a3b67d313797026 (patch) | |
tree | bc996c119a40d3cd916a0cacecae6296c49f5300 /vcl | |
parent | 91c0a4b982f5af093feb80eabe22b73376b5a430 (diff) |
vcl: Drop CmapResult indirection
Change-Id: I3b1beb5e976a255ef8ecdf8670b1e59547ec5ea4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139700
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/impfontcharmap.hxx | 6 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontFace.cxx | 5 | ||||
-rw-r--r-- | vcl/source/font/fontcharmap.cxx | 22 |
3 files changed, 12 insertions, 21 deletions
diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index 36809cdd986b..b2d47dc9f2b7 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -26,12 +26,12 @@ class ImplFontCharMap; typedef tools::SvRef<ImplFontCharMap> ImplFontCharMapRef; -class CmapResult; - class ImplFontCharMap final : public SvRefBase { public: - explicit ImplFontCharMap( const CmapResult& ); + explicit ImplFontCharMap( bool bSymbolic, + const sal_uInt32* pRangeCodes, + int nRangeCount); virtual ~ImplFontCharMap() override; private: diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx index 1133b0d6a131..9c1a1b586423 100644 --- a/vcl/source/font/PhysicalFontFace.cxx +++ b/vcl/source/font/PhysicalFontFace.cxx @@ -248,7 +248,7 @@ FontCharMapRef PhysicalFontFace::GetFontCharMap() const if (hb_set_get_population(pUnicodes)) { - // Convert HarfBuzz set to CmapResult ranges. + // Convert HarfBuzz set to code ranges. int nRangeCount = 0; hb_codepoint_t nFirst, nLast = HB_SET_VALUE_INVALID; while (hb_set_next_range(pUnicodes, &nFirst, &nLast)) @@ -263,8 +263,7 @@ FontCharMapRef PhysicalFontFace::GetFontCharMap() const *(pCP++) = nLast + 1; } - CmapResult aCmapResult(bSymbol, pRangeCodes, nRangeCount); - mxCharMap = new FontCharMap(aCmapResult); + mxCharMap = new FontCharMap(bSymbol, pRangeCodes, nRangeCount); } hb_set_destroy(pUnicodes); diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 5896e786eca0..450521cc6008 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -23,13 +23,6 @@ #include <algorithm> #include <vector> -CmapResult::CmapResult( bool bSymbolic, - const sal_UCS4* pRangeCodes, int nRangeCount ) -: mpRangeCodes( pRangeCodes) -, mnRangeCount( nRangeCount) -, mbSymbolic( bSymbolic) -{} - static ImplFontCharMapRef g_pDefaultImplFontCharMap; const sal_UCS4 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0}; const sal_UCS4 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100}; @@ -42,11 +35,11 @@ ImplFontCharMap::~ImplFontCharMap() } } -ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR ) -: mpRangeCodes( rCR.mpRangeCodes ) -, mnRangeCount( rCR.mnRangeCount ) +ImplFontCharMap::ImplFontCharMap(bool bSymbolic, const sal_UCS4* pRangeCodes, int nRangeCount) +: mpRangeCodes(pRangeCodes) +, mnRangeCount(nRangeCount) , mnCharCount( 0 ) - , m_bSymbolic(rCR.mbSymbolic) +, m_bSymbolic(bSymbolic) { const sal_UCS4* pRangePtr = mpRangeCodes; for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 ) @@ -67,8 +60,7 @@ ImplFontCharMapRef const & ImplFontCharMap::getDefaultMap( bool bSymbols ) nCodesCount = std::size(aDefaultSymbolRanges); } - CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 ); - g_pDefaultImplFontCharMap = ImplFontCharMapRef(new ImplFontCharMap(aDefaultCR)); + g_pDefaultImplFontCharMap = ImplFontCharMapRef(new ImplFontCharMap(bSymbols, pRangeCodes, nCodesCount/2)); return g_pDefaultImplFontCharMap; } @@ -115,8 +107,8 @@ FontCharMap::FontCharMap( ImplFontCharMapRef pIFCMap ) { } -FontCharMap::FontCharMap( const CmapResult& rCR ) - : mpImplFontCharMap(new ImplFontCharMap(rCR)) +FontCharMap::FontCharMap(bool bSymbolic, const sal_UCS4* pRangeCodes, int nRangeCount) + : mpImplFontCharMap(new ImplFontCharMap(bSymbolic, pRangeCodes, nRangeCount)) { } |