diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-08-14 15:03:20 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-14 19:57:00 +0000 |
commit | 2d03e604b3979db45f6f2ea8c00c8d7fe0790790 (patch) | |
tree | ca8dd7b7115e66b5e72c1367cb5ddb6923b9dc7c /xfa/fde/cfde_txtedtpage.h | |
parent | c068c8e1ac5d41ace2a89827601669e8b573ef48 (diff) | |
download | pdfium-2d03e604b3979db45f6f2ea8c00c8d7fe0790790.tar.xz |
Cleaning up the visual set iterator
This CL starts cleaning up the visual set iterator code.
Change-Id: I643dc9edeeb0c7ff06ccd34a1977f811675413d8
Reviewed-on: https://pdfium-review.googlesource.com/10615
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtpage.h')
-rw-r--r-- | xfa/fde/cfde_txtedtpage.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/xfa/fde/cfde_txtedtpage.h b/xfa/fde/cfde_txtedtpage.h index aa88801ba7..c118fe2fee 100644 --- a/xfa/fde/cfde_txtedtpage.h +++ b/xfa/fde/cfde_txtedtpage.h @@ -11,22 +11,37 @@ #include <memory> #include <vector> +#include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/ifx_chariter.h" -#include "xfa/fde/ifde_visualset.h" +#include "core/fxge/cfx_renderdevice.h" class CFDE_TxtEdtEngine; class CFDE_TxtEdtParag; class CFDE_TxtEdtTextSet; -class CFDE_TxtEdtPage : public IFDE_VisualSet { +struct FDE_TEXTEDITPIECE { + FDE_TEXTEDITPIECE(); + FDE_TEXTEDITPIECE(const FDE_TEXTEDITPIECE& that); + ~FDE_TEXTEDITPIECE(); + + int32_t nStart; + int32_t nCount; + int32_t nBidiLevel; + CFX_RectF rtPiece; + uint32_t dwCharStyles; +}; + +inline FDE_TEXTEDITPIECE::FDE_TEXTEDITPIECE() = default; +inline FDE_TEXTEDITPIECE::FDE_TEXTEDITPIECE(const FDE_TEXTEDITPIECE& that) = + default; +inline FDE_TEXTEDITPIECE::~FDE_TEXTEDITPIECE() = default; + +class CFDE_TxtEdtPage { public: CFDE_TxtEdtPage(CFDE_TxtEdtEngine* pEngine, int32_t nLineIndex); - ~CFDE_TxtEdtPage() override; - - // IFDE_VisualSet: - FDE_VISUALOBJTYPE GetType() override; - CFX_RectF GetRect(const FDE_TEXTEDITPIECE& pPiece) override; + ~CFDE_TxtEdtPage(); + CFX_RectF GetRect(const FDE_TEXTEDITPIECE& pPiece); CFDE_TxtEdtEngine* GetEngine() const; int32_t GetCharRect(int32_t nIndex, CFX_RectF& rect, @@ -46,12 +61,14 @@ class CFDE_TxtEdtPage : public IFDE_VisualSet { void UnloadPage(const CFX_RectF* pClipBox); const CFX_RectF& GetContentsBox(); - size_t GetFirstPosition(); - FDE_TEXTEDITPIECE* GetNext(size_t* pos, IFDE_VisualSet*& pVisualSet); + size_t GetTextPieceCount() const; + const FDE_TEXTEDITPIECE& GetTextPiece(size_t pos) const; wchar_t GetChar(const FDE_TEXTEDITPIECE* pIdentity, int32_t index) const; int32_t GetWidth(const FDE_TEXTEDITPIECE* pIdentity, int32_t index) const; + CFDE_TxtEdtTextSet* GetTextSet() const { return m_pTextSet.get(); } + private: void NormalizePt2Rect(CFX_PointF& ptF, const CFX_RectF& rtF, |