summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_textout.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-14 11:08:39 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-14 15:22:07 +0000
commit54a8390782c734f6c919f126ea5b93d5a3dcdc00 (patch)
tree29477bd7d077bbe8c11eddcd43701f0410a70816 /xfa/fde/cfde_textout.h
parent0bd847232a1f430c70dd9d8df177ce68a3cde010 (diff)
downloadpdfium-54a8390782c734f6c919f126ea5b93d5a3dcdc00.tar.xz
Cleanup CFDE_TextOut methods
This CL removes unused CFDE_TextOut methods and merges some single use methods. Change-Id: Ie625ad737aeb1dc163b03f15f4774744062a9491 Reviewed-on: https://pdfium-review.googlesource.com/10570 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_textout.h')
-rw-r--r--xfa/fde/cfde_textout.h34
1 files changed, 3 insertions, 31 deletions
diff --git a/xfa/fde/cfde_textout.h b/xfa/fde/cfde_textout.h
index 8d99900566..f2541bb11b 100644
--- a/xfa/fde/cfde_textout.h
+++ b/xfa/fde/cfde_textout.h
@@ -68,7 +68,6 @@ class CFDE_TTOLine {
int32_t GetSize() const;
FDE_TTOPIECE* GetPtrAt(int32_t index);
void RemoveLast(int32_t iCount);
- void RemoveAll();
private:
bool m_bNewReload;
@@ -82,44 +81,26 @@ class CFDE_TextOut {
void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont);
void SetFontSize(float fFontSize);
- void SetTextColor(FX_ARGB color);
+ void SetTextColor(FX_ARGB color) { m_TxtColor = color; }
void SetStyles(const FDE_TextStyle& dwStyles);
- void SetTabWidth(float fTabWidth);
- void SetParagraphBreakChar(wchar_t wch);
void SetAlignment(FDE_TextAlignment iAlignment);
void SetLineSpace(float fLineSpace);
- void SetDIBitmap(const CFX_RetainPtr<CFX_DIBitmap>& pDIB);
void SetRenderDevice(CFX_RenderDevice* pDevice);
- void SetClipRect(const CFX_Rect& rtClip);
- void SetClipRect(const CFX_RectF& rtClip);
- void SetMatrix(const CFX_Matrix& matrix);
+ void SetMatrix(const CFX_Matrix& matrix) { m_Matrix = matrix; }
void SetLineBreakTolerance(float fTolerance);
- void DrawText(const wchar_t* pwsStr, int32_t iLength, int32_t x, int32_t y);
- void DrawText(const wchar_t* pwsStr, int32_t iLength, float x, float y);
- void DrawText(const wchar_t* pwsStr, int32_t iLength, const CFX_Rect& rect);
- void DrawText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect);
-
- void SetLogicClipRect(const CFX_RectF& rtClip);
void CalcLogicSize(const wchar_t* pwsStr, int32_t iLength, CFX_SizeF& size);
void CalcLogicSize(const wchar_t* pwsStr, int32_t iLength, CFX_RectF& rect);
- void DrawLogicText(const wchar_t* pwsStr, int32_t iLength, float x, float y);
void DrawLogicText(const wchar_t* pwsStr,
int32_t iLength,
const CFX_RectF& rect);
- int32_t GetTotalLines();
+ int32_t GetTotalLines() const { return m_iTotalLines; }
private:
- void CalcTextSize(const wchar_t* pwsStr, int32_t iLength, CFX_RectF& rect);
bool RetrieveLineWidth(CFX_BreakType dwBreakStatus,
float& fStartPos,
float& fWidth,
float& fHeight);
- void SetLineWidth(CFX_RectF& rect);
- void DrawText(const wchar_t* pwsStr,
- int32_t iLength,
- const CFX_RectF& rect,
- const CFX_RectF& rtClip);
void LoadText(const wchar_t* pwsStr, int32_t iLength, const CFX_RectF& rect);
void Reload(const CFX_RectF& rect);
@@ -131,9 +112,7 @@ class CFDE_TextOut {
const CFX_RectF& rect);
void AppendPiece(const FDE_TTOPIECE& ttoPiece, bool bNeedReload, bool bEnd);
void DoAlignment(const CFX_RectF& rect);
- void OnDraw(const CFX_RectF& rtClip);
int32_t GetDisplayPos(FDE_TTOPIECE* pPiece);
- int32_t GetCharRects(const FDE_TTOPIECE* pPiece);
FX_TXTRUN ToTextRun(const FDE_TTOPIECE* pPiece);
@@ -145,24 +124,17 @@ class CFDE_TextOut {
float m_fTolerance;
FDE_TextAlignment m_iAlignment;
FDE_TextStyle m_Styles;
- int32_t m_iTxtBkAlignment;
std::vector<int32_t> m_CharWidths;
- wchar_t m_wParagraphBkChar;
FX_ARGB m_TxtColor;
uint32_t m_dwTxtBkStyles;
CFX_WideString m_wsText;
- CFX_RectF m_rtClip;
- CFX_RectF m_rtLogicClip;
CFX_Matrix m_Matrix;
std::deque<CFDE_TTOLine> m_ttoLines;
int32_t m_iCurLine;
int32_t m_iCurPiece;
int32_t m_iTotalLines;
std::vector<FXTEXT_CHARPOS> m_CharPos;
- // NOTE: m_pDefaultRenderDevice must outlive m_pRenderDevice.
- std::unique_ptr<CFX_DefaultRenderDevice> m_pDefaultRenderDevice;
std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice;
- std::vector<CFX_RectF> m_rectArray;
};
#endif // XFA_FDE_CFDE_TEXTOUT_H_