vcl/headless/svptext.cxx | 5 -- vcl/inc/headless/svpgdi.hxx | 1 vcl/inc/quartz/salgdi.h | 9 ---- vcl/inc/salgdi.hxx | 12 ------ vcl/inc/textrender.hxx | 1 vcl/inc/unx/cairotextrender.hxx | 1 vcl/inc/unx/genpspgraphics.h | 3 - vcl/inc/unx/salgdi.h | 2 - vcl/inc/win/salgdi.h | 9 ---- vcl/quartz/salgdi.cxx | 7 --- vcl/source/gdi/pdfwriter_impl.cxx | 60 ------------------------------- vcl/unx/generic/gdi/cairotextrender.cxx | 5 -- vcl/unx/generic/gdi/font.cxx | 5 -- vcl/unx/generic/print/genpspgraphics.cxx | 5 -- vcl/win/gdi/salfont.cxx | 5 -- 15 files changed, 1 insertion(+), 129 deletions(-)
New commits: commit 1ee56fc9f446bad5853b121a3c5b137c1d00bbf4 Author: Khaled Hosny <khaledho...@eglug.org> Date: Tue Nov 29 10:41:53 2016 +0200 SalGraphics::GetFontEncodingVector() is a noop now Change-Id: Id706fa242277a0ea7ba44f52eab4a56e404bd2fa Reviewed-on: https://gerrit.libreoffice.org/31372 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Khaled Hosny <khaledho...@eglug.org> diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 65c7d05..2d44659 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -73,11 +73,6 @@ bool SvpSalGraphics::CreateFontSubset( return m_aTextRenderImpl.CreateFontSubset(rToFile, pFont, pGlyphIds, pEncoding, pWidths, nGlyphCount, rInfo); } -const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded, std::set<sal_Unicode> const** ppPriority) -{ - return m_aTextRenderImpl.GetFontEncodingVector(pFont, pNonEncoded, ppPriority); -} - const void* SvpSalGraphics::GetEmbedFontData( const PhysicalFontFace* pFont, const sal_Ucs* pUnicodes, diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index a5440e2..bcd4ac6 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -153,7 +153,6 @@ public: int nGlyphs, FontSubsetInfo& rInfo ) override; - virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded, std::set<sal_Unicode> const** ) override; virtual const void* GetEmbedFontData( const PhysicalFontFace*, const sal_Ucs* pUnicodes, sal_Int32* pWidths, diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index f6776b3..f752fd2 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -362,15 +362,6 @@ public: FontSubsetInfo& rInfo // out parameter ) override; - // GetFontEncodingVector: a method to get the encoding map Unicode - // to font encoded character; this is only used for type1 fonts and - // may return NULL in case of unknown encoding vector - // if ppNonEncoded is set and non encoded characters (that is type1 - // glyphs with only a name) exist it is set to the corresponding - // map for non encoded glyphs; the encoding vector contains -1 - // as encoding for these cases - virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded, std::set<sal_Unicode> const** ) override; - // GetEmbedFontData: gets the font data for a font marked // embeddable by GetDevFontList or NULL in case of error // parameters: pFont: describes the font in question diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 71a8442..e7382be 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -172,18 +172,6 @@ public: int nGlyphs, FontSubsetInfo& rInfo ) = 0; - // GetFontEncodingVector: a method to get the encoding map Unicode - // to font encoded character; this is only used for type1 fonts and - // may return NULL in case of unknown encoding vector - // if ppNonEncoded is set and non encoded characters (that is type1 - // glyphs with only a name) exist it is set to the corresponding - // map for non encoded glyphs; the encoding vector contains -1 - // as encoding for these cases - virtual const Ucs2SIntMap* GetFontEncodingVector( - const PhysicalFontFace*, - const Ucs2OStrMap** ppNonEncoded, - std::set<sal_Unicode> const** ppPriority) = 0; - // GetEmbedFontData: gets the font data for a font marked // embeddable by GetDevFontList or NULL in case of error // parameters: pFont: describes the font in question diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 0c01526..694fa7b 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -51,7 +51,6 @@ public: int nGlyphs, FontSubsetInfo& rInfo) = 0; - virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded, std::set<sal_Unicode> const** ppPriority) = 0; virtual const void* GetEmbedFontData( const PhysicalFontFace*, const sal_Ucs* pUnicodes, diff --git a/vcl/inc/unx/cairotextrender.hxx b/vcl/inc/unx/cairotextrender.hxx index 5c9859f..a8a0d6d 100644 --- a/vcl/inc/unx/cairotextrender.hxx +++ b/vcl/inc/unx/cairotextrender.hxx @@ -67,7 +67,6 @@ public: int nGlyphs, FontSubsetInfo& rInfo) override; - virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded, std::set<sal_Unicode> const**) override; virtual const void* GetEmbedFontData( const PhysicalFontFace*, const sal_Ucs* pUnicodes, diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h index 9d2e530..97e759e 100644 --- a/vcl/inc/unx/genpspgraphics.h +++ b/vcl/inc/unx/genpspgraphics.h @@ -111,9 +111,6 @@ public: sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) override; - virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, - const Ucs2OStrMap** ppNonEncoded, - std::set<sal_Unicode> const** ppPriority) override; virtual const void* GetEmbedFontData( const PhysicalFontFace*, const sal_Ucs* pUnicodes, sal_Int32* pWidths, diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 8d56c8c..2a64ebf 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -131,8 +131,6 @@ public: int nGlyphs, FontSubsetInfo& rInfo ) override; - virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded, std::set<sal_Unicode> const**) override; - virtual const void* GetEmbedFontData( const PhysicalFontFace*, const sal_Ucs* pUnicodes, diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 6dedfe7..a07af12 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -390,15 +390,6 @@ public: FontSubsetInfo& rInfo // out parameter ) override; - // GetFontEncodingVector: a method to get the encoding map Unicode - // to font encoded character; this is only used for type1 fonts and - // may return NULL in case of unknown encoding vector - // if ppNonEncoded is set and non encoded characters (that is type1 - // glyphs with only a name) exist it is set to the corresponding - // map for non encoded glyphs; the encoding vector contains -1 - // as encoding for these cases - virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded, std::set<sal_Unicode> const** ) override; - // GetEmbedFontData: gets the font data for a font marked // embeddable by GetDevFontList or NULL in case of error // parameters: pFont: describes the font in question diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index e46ad77..e57fd95 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -840,13 +840,6 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV ::CloseTTFont( pSftFont ); } -const Ucs2SIntMap* AquaSalGraphics::GetFontEncodingVector( const PhysicalFontFace*, - const Ucs2OStrMap** /*ppNonEncoded*/, - std::set<sal_Unicode> const** ) -{ - return nullptr; -} - const void* AquaSalGraphics::GetEmbedFontData( const PhysicalFontFace*, const sal_Ucs* /*pUnicodes*/, sal_Int32* /*pWidths*/, diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 88590df..12fe24d 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -3063,9 +3063,6 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical assert(pGraphics); // prepare font encoding - std::set<sal_Unicode> const * pPriority(nullptr); - const Ucs2SIntMap *const pEncoding = - pGraphics->GetFontEncodingVector( pFont, nullptr, &pPriority ); sal_Int32 nToUnicodeStream = 0; sal_uInt8 nEncoding[256]; sal_Ucs nEncodedCodes[256]; @@ -3073,58 +3070,6 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical aUnicodes.reserve( 256 ); sal_Int32 pUnicodesPerGlyph[256]; sal_Int32 pEncToUnicodeIndex[256]; - if( pEncoding ) - { - memset( nEncoding, 0, sizeof(nEncoding) ); - memset( nEncodedCodes, 0, sizeof(nEncodedCodes) ); - memset( pUnicodesPerGlyph, 0, sizeof(pUnicodesPerGlyph) ); - memset( pEncToUnicodeIndex, 0, sizeof(pEncToUnicodeIndex) ); - for( Ucs2SIntMap::const_reverse_iterator it = pEncoding->rbegin(); it != pEncoding->rend(); ++it ) - { - if(it->second == -1) - continue; - sal_Int32 nCode = (sal_Int32)(it->second & 0x000000ff); - SAL_WARN_IF(nCode != it->second, "vcl.gdi", "emitEmbeddedFont: FIXME: cannot handle Type 1 font with code points > 256"); - //We're not doing this right here. We have taken a unicode-to-font_index map - //and are trying to generate a font_index-to-unicode mapping from it - //Which assumes that there is a 1-to-1 mapping there, but that might not be - //true. - // - //Instead perhaps we could try and get the GetFontCharMap and loop - //over sal_UCS4 GetCharFromIndex( int nCharIndex ) const from 0 to 255 - //to build it up - if (nEncoding[nCode] != 0) - { - // should not have 2 identical mappings - assert(nEncodedCodes[nCode] != it->first); - if (pPriority) - { - bool bExist = pPriority->find(nEncodedCodes[nCode]) != pPriority->end(); - bool bIter = pPriority->find(it->first) != pPriority->end(); - SAL_WARN_IF(bExist && bIter, "vcl.gdi", "both are preferred? odd..."); - if (bExist) - { - continue; - } - // note: aUnicodes will contain the old one but that - // does not matter because there's nothing iterating it - } - else - { - // is this fallback important? let's prefer lower one. - // actually the map is sorted so just rely on that - assert(nEncodedCodes[nCode] < it->first); - SAL_WARN("vcl.gdi", "emitEmbeddedFont: ignoring code " << nCode << " mapping to " << it->first << " in favor of " << nEncodedCodes[nCode]); - continue; - } - } - nEncodedCodes[ nCode ] = it->first; - nEncoding[ nCode ] = static_cast<sal_uInt8>( nCode ); - pEncToUnicodeIndex[ nCode ] = static_cast<sal_Int32>(aUnicodes.size()); - aUnicodes.push_back( it->first ); - pUnicodesPerGlyph[ nCode ] = 1; - } - } FontSubsetInfo aInfo; sal_Int32 pWidths[256]; @@ -3510,9 +3455,6 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical if( nFontDescriptor ) { - if( pEncoding ) - nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, SAL_N_ELEMENTS(nEncoding) ); - // write font object sal_Int32 nObject = createObject(); if( ! updateObject( nObject ) ) @@ -3524,7 +3466,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const Physical "<</Type/Font/Subtype/Type1/BaseFont/" ); appendName( aInfo.m_aPSName, aLine ); aLine.append( "\n" ); - if( !pFont->IsSymbolFont() && ( pEncoding == nullptr || pFont->GetCharSet() == RTL_TEXTENCODING_MS_1252 )) + if (!pFont->IsSymbolFont()) aLine.append( "/Encoding/WinAnsiEncoding\n" ); if( nToUnicodeStream ) { diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index d53e18f..8607530 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -552,11 +552,6 @@ void CairoTextRender::FreeEmbedFontData( const void* pData, long nLen ) GenPspGraphics::DoFreeEmbedFontData( pData, nLen ); } -const Ucs2SIntMap* CairoTextRender::GetFontEncodingVector(const PhysicalFontFace*, const Ucs2OStrMap**, std::set<sal_Unicode> const**) -{ - return nullptr; -} - void CairoTextRender::GetGlyphWidths( const PhysicalFontFace* pFont, bool bVertical, std::vector< sal_Int32 >& rWidths, diff --git a/vcl/unx/generic/gdi/font.cxx b/vcl/unx/generic/gdi/font.cxx index bed701d..937fa2b 100644 --- a/vcl/unx/generic/gdi/font.cxx +++ b/vcl/unx/generic/gdi/font.cxx @@ -151,11 +151,6 @@ void X11SalGraphics::FreeEmbedFontData( const void* pData, long nLen ) mxTextRenderImpl->FreeEmbedFontData(pData, nLen); } -const Ucs2SIntMap* X11SalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded, std::set<sal_Unicode> const** ppPriority) -{ - return mxTextRenderImpl->GetFontEncodingVector(pFont, pNonEncoded, ppPriority); -} - void X11SalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, bool bVertical, std::vector< sal_Int32 >& rWidths, diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index c1f1425..d1dbbf4 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -853,11 +853,6 @@ bool GenPspGraphics::CreateFontSubset( return bSuccess; } -const Ucs2SIntMap* GenPspGraphics::GetFontEncodingVector(const PhysicalFontFace*, const Ucs2OStrMap**, std::set<sal_Unicode> const**) -{ - return nullptr; -} - void GenPspGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, bool bVertical, std::vector< sal_Int32 >& rWidths, diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 6f5743f..7f7f681 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -1963,11 +1963,6 @@ void WinSalGraphics::FreeEmbedFontData( const void* pData, long /*nLen*/ ) delete[] static_cast<char const *>(pData); } -const Ucs2SIntMap* WinSalGraphics::GetFontEncodingVector(const PhysicalFontFace*, const Ucs2OStrMap**, std::set<sal_Unicode> const**) -{ - return nullptr; -} - void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, bool bVertical, std::vector< sal_Int32 >& rWidths, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits