summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/ttgsubtable.cpp
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/ttgsubtable.cpp
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/ttgsubtable.cpp')
-rw-r--r--core/fpdfapi/font/ttgsubtable.cpp49
1 files changed, 0 insertions, 49 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) {}