summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-04 10:20:28 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-04 17:49:15 +0000
commitb4a75830cc03dc6c44c4e0f3b5e31d05a0d8596a (patch)
tree9b11e23c4a0d59e3cb9464130465b694c68c25a1 /core/fpdfapi/font
parentdcefccc9f0f2002f79a4a67048fac1360c1d6c26 (diff)
downloadpdfium-b4a75830cc03dc6c44c4e0f3b5e31d05a0d8596a.tar.xz
Remove CFX_GlyphMap
It's only instantiated in one place, and then nothing is ever put into the map. Change-Id: I8ebee324e0ec63c139309275c8de115d38063dc6 Reviewed-on: https://pdfium-review.googlesource.com/4877 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/font')
-rw-r--r--core/fpdfapi/font/ttgsubtable.cpp49
-rw-r--r--core/fpdfapi/font/ttgsubtable.h13
2 files changed, 0 insertions, 62 deletions
diff --git a/core/fpdfapi/font/ttgsubtable.cpp b/core/fpdfapi/font/ttgsubtable.cpp
index 5b3d4cd4b9..b8d6946657 100644
--- a/core/fpdfapi/font/ttgsubtable.cpp
+++ b/core/fpdfapi/font/ttgsubtable.cpp
@@ -12,55 +12,6 @@
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
-CFX_GlyphMap::CFX_GlyphMap() {}
-
-CFX_GlyphMap::~CFX_GlyphMap() {}
-
-extern "C" {
-static int _CompareInt(const void* p1, const void* p2) {
- return (*(uint32_t*)p1) - (*(uint32_t*)p2);
-}
-};
-
-struct _IntPair {
- int32_t key;
- int32_t value;
-};
-
-void CFX_GlyphMap::SetAt(int key, int value) {
- uint32_t count = m_Buffer.GetSize() / sizeof(_IntPair);
- _IntPair* buf = (_IntPair*)m_Buffer.GetBuffer();
- _IntPair pair = {key, value};
- if (count == 0 || key > buf[count - 1].key) {
- m_Buffer.AppendBlock(&pair, sizeof(_IntPair));
- return;
- }
- int low = 0, high = count - 1;
- while (low <= high) {
- int mid = (low + high) / 2;
- if (buf[mid].key < key) {
- low = mid + 1;
- } else if (buf[mid].key > key) {
- high = mid - 1;
- } else {
- buf[mid].value = value;
- return;
- }
- }
- m_Buffer.InsertBlock(low * sizeof(_IntPair), &pair, sizeof(_IntPair));
-}
-
-bool CFX_GlyphMap::Lookup(int key, int& value) {
- void* pResult =
- bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_IntPair),
- sizeof(_IntPair), _CompareInt);
- if (!pResult) {
- return false;
- }
- value = ((uint32_t*)pResult)[1];
- return true;
-}
-
CFX_CTTGSUBTable::CFX_CTTGSUBTable()
: m_bFeautureMapLoad(false), loaded(false) {}
diff --git a/core/fpdfapi/font/ttgsubtable.h b/core/fpdfapi/font/ttgsubtable.h
index 4b937f0473..c3bff43957 100644
--- a/core/fpdfapi/font/ttgsubtable.h
+++ b/core/fpdfapi/font/ttgsubtable.h
@@ -17,18 +17,6 @@
#include "core/fxge/fx_font.h"
#include "core/fxge/fx_freetype.h"
-class CFX_GlyphMap {
- public:
- CFX_GlyphMap();
- ~CFX_GlyphMap();
-
- void SetAt(int key, int value);
- bool Lookup(int key, int& value);
-
- protected:
- CFX_BinaryBuf m_Buffer;
-};
-
class CFX_CTTGSUBTable {
public:
CFX_CTTGSUBTable();
@@ -154,7 +142,6 @@ class CFX_CTTGSUBTable {
virtual ~TCoverageFormatBase() {}
uint16_t CoverageFormat;
- CFX_GlyphMap m_glyphMap;
private:
TCoverageFormatBase(const TCoverageFormatBase&);