vcl/Library_vcl.mk | 1 vcl/inc/pdf/pdffontcache.hxx | 71 ---------------------------------------- vcl/inc/pdf/pdfwriter_impl.hxx | 3 - vcl/source/gdi/pdffontcache.cxx | 66 ------------------------------------- 4 files changed, 1 insertion(+), 140 deletions(-)
New commits: commit 789b517819495a9efff5538de7e8e5106fc64f81 Author: Khaled Hosny <kha...@aliftype.com> AuthorDate: Mon Sep 5 21:33:25 2022 +0200 Commit: خالد حسني <kha...@aliftype.com> CommitDate: Tue Sep 6 15:07:04 2022 +0200 vcl: Drop now unused PDFFontCache Change-Id: I7959103f43d993e39bff03e7c71289c37a5cfa3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139458 Tested-by: Jenkins Reviewed-by: خالد حسني <kha...@aliftype.com> diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 5416cbb361c5..b4135d502b2e 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -286,7 +286,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/gdi/oldprintadaptor \ vcl/source/gdi/pdfbuildin_fonts \ vcl/source/gdi/pdfextoutdevdata \ - vcl/source/gdi/pdffontcache \ vcl/source/gdi/pdfwriter \ vcl/source/gdi/pdfwriter_impl2 \ vcl/source/gdi/pdfwriter_impl \ diff --git a/vcl/inc/pdf/pdffontcache.hxx b/vcl/inc/pdf/pdffontcache.hxx deleted file mode 100644 index a6b58d8e7b00..000000000000 --- a/vcl/inc/pdf/pdffontcache.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include <sal/config.h> - -#include <typeinfo> - -#include <sal/types.h> - -#include <salgdi.hxx> - -namespace vcl -{ - class PDFFontCache - { - struct FontIdentifier - { - sal_IntPtr m_nFontId; - bool m_bVertical; - std::type_info* m_typeFontFace; - - FontIdentifier( const vcl::font::PhysicalFontFace*, bool bVertical ); - - // Less than needed for std::set and std::map - bool operator<( const FontIdentifier& rRight ) const - { - std::type_info *pType = rRight.m_typeFontFace; - - return m_nFontId < rRight.m_nFontId || - ( m_nFontId == rRight.m_nFontId && - ( m_typeFontFace->before( *pType ) || - ( *m_typeFontFace == *pType && m_bVertical < rRight.m_bVertical ) ) ); - } - }; - struct FontData - { - std::vector< sal_Int32 > m_nWidths; - Ucs2UIntMap m_aGlyphIdToIndex; - }; - typedef std::map< FontIdentifier, sal_uInt32 > FontToIndexMap; - - std::vector< FontData > m_aFonts; - FontToIndexMap m_aFontToIndex; - - FontData& getFont( const vcl::font::PhysicalFontFace*, bool bVertical ); - public: - PDFFontCache() {} - - sal_Int32 getGlyphWidth( const vcl::font::PhysicalFontFace*, sal_GlyphId, bool bVertical, SalGraphics* ); - }; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index 048b03cf2351..af77b58da544 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -57,7 +57,7 @@ #include <vcl/filter/pdfobjectcontainer.hxx> #include <pdf/ExternalPDFStreams.hxx> #include <pdf/pdfbuildin_fonts.hxx> -#include <pdf/pdffontcache.hxx> +#include <salgdi.hxx> class StyleSettings; class FontSubsetInfo; @@ -741,7 +741,6 @@ private: std::map<const vcl::font::PhysicalFontFace*, FontSubset> m_aSubsets; std::map<const vcl::font::PhysicalFontFace*, EmbedFont> m_aSystemFonts; sal_Int32 m_nNextFID; - PDFFontCache m_aFontCache; /// Cache some most recent bitmaps we've exported, in case we encounter them again.. o3tl::lru_map<BitmapChecksum, diff --git a/vcl/source/gdi/pdffontcache.cxx b/vcl/source/gdi/pdffontcache.cxx deleted file mode 100644 index e4646f8777bd..000000000000 --- a/vcl/source/gdi/pdffontcache.cxx +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <sal/config.h> - -#include <sal/types.h> - -#include <font/PhysicalFontFace.hxx> -#include <pdf/pdffontcache.hxx> -#include <salgdi.hxx> - -#include <typeinfo> - -using namespace vcl; - -PDFFontCache::FontIdentifier::FontIdentifier( const vcl::font::PhysicalFontFace* pFont, bool bVertical ) : - m_nFontId( pFont->GetFontId() ), - m_bVertical( bVertical ), - m_typeFontFace( const_cast<std::type_info*>(&typeid(pFont)) ) -{ -} - -PDFFontCache::FontData& PDFFontCache::getFont( const vcl::font::PhysicalFontFace* pFont, bool bVertical ) -{ - FontIdentifier aId( pFont, bVertical ); - FontToIndexMap::iterator it = m_aFontToIndex.find( aId ); - if( it != m_aFontToIndex.end() ) - return m_aFonts[ it->second ]; - m_aFontToIndex[ aId ] = sal_uInt32(m_aFonts.size()); - m_aFonts.emplace_back( ); - return m_aFonts.back(); -} - -sal_Int32 PDFFontCache::getGlyphWidth( const vcl::font::PhysicalFontFace* pFont, sal_GlyphId nGlyph, bool bVertical, SalGraphics* pGraphics ) -{ - sal_Int32 nWidth = 0; - FontData& rFontData( getFont( pFont, bVertical ) ); - if( rFontData.m_nWidths.empty() ) - { - pGraphics->GetGlyphWidths( pFont, bVertical, rFontData.m_nWidths, rFontData.m_aGlyphIdToIndex ); - } - if( ! rFontData.m_nWidths.empty() ) - { - if (nGlyph < rFontData.m_nWidths.size()) - nWidth = rFontData.m_nWidths[nGlyph]; - } - return nWidth; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */