summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedttextset.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-30 12:16:16 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-30 16:26:12 +0000
commit68eefa6a6f6bbab73000a29e2cac3e104be1cc81 (patch)
treeb48dbf0932022bc551ae06e2400262c203856942 /xfa/fde/cfde_txtedttextset.cpp
parentaa3a9cd82df9dff1ef136797259e606a39c18b75 (diff)
downloadpdfium-68eefa6a6f6bbab73000a29e2cac3e104be1cc81.tar.xz
Rebuild CFDE_TextEditEngine.
This CL rebuilds the text edit engine in a simpler fashion. Instead of depending on multiple pages, paragraphs and buffer fields there is a single text edit engine which contains a gap buffer. This makes the code easier to understand and follow. Change-Id: I10fe85603fa9ed15a647eaac2d931f113cd0c7b0 Reviewed-on: https://pdfium-review.googlesource.com/11990 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedttextset.cpp')
-rw-r--r--xfa/fde/cfde_txtedttextset.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/xfa/fde/cfde_txtedttextset.cpp b/xfa/fde/cfde_txtedttextset.cpp
deleted file mode 100644
index 0b6cf8214e..0000000000
--- a/xfa/fde/cfde_txtedttextset.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2016 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/fde/cfde_txtedttextset.h"
-
-#include "xfa/fde/cfde_txtedtengine.h"
-#include "xfa/fgas/font/cfgas_gefont.h"
-#include "xfa/fgas/layout/cfx_txtbreak.h"
-
-CFDE_TxtEdtTextSet::CFDE_TxtEdtTextSet(CFDE_TxtEdtPage* pPage)
- : m_pPage(pPage) {}
-
-CFDE_TxtEdtTextSet::~CFDE_TxtEdtTextSet() {}
-
-int32_t CFDE_TxtEdtTextSet::GetDisplayPos(const FDE_TEXTEDITPIECE& piece,
- FXTEXT_CHARPOS* pCharPos) const {
- int32_t nLength = piece.nCount;
- if (nLength < 1)
- return 0;
-
- CFDE_TxtEdtEngine* pEngine =
- static_cast<CFDE_TxtEdtEngine*>(m_pPage->GetEngine());
- const FDE_TXTEDTPARAMS* pTextParams = pEngine->GetEditParams();
- CFX_TxtBreak* pBreak = pEngine->GetTextBreak();
- uint32_t dwLayoutStyle = pBreak->GetLayoutStyles();
- FX_TXTRUN tr;
- tr.pAccess = m_pPage.Get();
- tr.pIdentity = &piece;
- tr.iLength = nLength;
- tr.pFont = pTextParams->pFont;
- tr.fFontSize = pTextParams->fFontSize;
- tr.dwStyles = dwLayoutStyle;
- tr.dwCharStyles = piece.dwCharStyles;
- tr.pRect = &piece.rtPiece;
- return pBreak->GetDisplayPos(&tr, pCharPos);
-}
-
-std::vector<CFX_RectF> CFDE_TxtEdtTextSet::GetCharRects(
- const FDE_TEXTEDITPIECE* pPiece,
- bool bBBox) const {
- if (!pPiece || pPiece->nCount < 1)
- return std::vector<CFX_RectF>();
-
- auto* pEngine = static_cast<CFDE_TxtEdtEngine*>(m_pPage->GetEngine());
- const FDE_TXTEDTPARAMS* pTextParams = pEngine->GetEditParams();
- uint32_t dwLayoutStyle = pEngine->GetTextBreak()->GetLayoutStyles();
- FX_TXTRUN tr;
- tr.pAccess = m_pPage.Get();
- tr.pIdentity = pPiece;
- tr.iLength = pPiece->nCount;
- tr.pFont = pTextParams->pFont;
- tr.fFontSize = pTextParams->fFontSize;
- tr.dwStyles = dwLayoutStyle;
- tr.dwCharStyles = pPiece->dwCharStyles;
- tr.pRect = &pPiece->rtPiece;
- return pEngine->GetTextBreak()->GetCharRects(&tr, bBBox);
-}