summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_unicode.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-01 14:41:25 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-03-02 14:08:12 +0000
commit4a21114e3a95d3798c5027de33b8e90550fc0eb7 (patch)
tree493a167f34a0116e9b5c93bddf2b36e5ca70f5aa /xfa/fgas/layout/fgas_unicode.cpp
parent65ec174225546abdc977c8f4c92e792e44ca4e0a (diff)
downloadpdfium-4a21114e3a95d3798c5027de33b8e90550fc0eb7.tar.xz
Use std::deque for CFX_TPOArray
They both encompass the same concept: a segmented array that can grow without copying. Change-Id: Ifc02207385b1bc106df41932c7b78ec2e9cc2146 Reviewed-on: https://pdfium-review.googlesource.com/2894 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/fgas_unicode.cpp')
-rw-r--r--xfa/fgas/layout/fgas_unicode.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/xfa/fgas/layout/fgas_unicode.cpp b/xfa/fgas/layout/fgas_unicode.cpp
deleted file mode 100644
index 10fdbf0810..0000000000
--- a/xfa/fgas/layout/fgas_unicode.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fgas/layout/fgas_unicode.h"
-
-void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray& tpos, int32_t iStart, int32_t iEnd) {
- ASSERT(iStart > -1 && iStart < tpos.GetSize());
- ASSERT(iEnd > -1 && iEnd < tpos.GetSize());
- if (iStart >= iEnd) {
- return;
- }
- int32_t i = iStart, j = iEnd;
- FX_TPO *pCur = tpos.GetPtrAt(iStart), *pSort;
- int32_t v = pCur->pos;
- while (i < j) {
- while (j > i) {
- pSort = tpos.GetPtrAt(j);
- if (pSort->pos < v) {
- FX_TPO t = *pSort;
- *pSort = *pCur;
- *pCur = t;
- pCur = pSort;
- break;
- }
- j--;
- }
- while (i < j) {
- pSort = tpos.GetPtrAt(i);
- if (pSort->pos > v) {
- FX_TPO t = *pSort;
- *pSort = *pCur;
- *pCur = t;
- pCur = pSort;
- break;
- }
- i++;
- }
- }
- i--, j++;
- if (iStart < i) {
- FX_TEXTLAYOUT_PieceSort(tpos, iStart, i);
- }
- if (j < iEnd) {
- FX_TEXTLAYOUT_PieceSort(tpos, j, iEnd);
- }
-}