summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtengine.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-07 16:36:39 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-08 01:36:02 +0000
commitbba2a7cf30da9e84bcc14ef32dbb0bb944229219 (patch)
tree94a74de8d07b3e395bf6e08a62811a3a0d652d19 /xfa/fde/cfde_txtedtengine.cpp
parent55e026b7b6eec17b012c819c4a7d39e63094b5c4 (diff)
downloadpdfium-bba2a7cf30da9e84bcc14ef32dbb0bb944229219.tar.xz
Update to use CFX_Rect{F} and CFX_Matrix constructors.
This Cl updates the code to use the constructors instead of creating an empty object and calling Set(). It also removes the various memsets of the CFX_Rect{F} classes. Change-Id: I6e20cec00866a38372858dcba5a30d31103172e4 Reviewed-on: https://pdfium-review.googlesource.com/2550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtengine.cpp')
-rw-r--r--xfa/fde/cfde_txtedtengine.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index 7ef6b3ff06..a61f6ab4d9 100644
--- a/xfa/fde/cfde_txtedtengine.cpp
+++ b/xfa/fde/cfde_txtedtengine.cpp
@@ -69,7 +69,6 @@ CFDE_TxtEdtEngine::CFDE_TxtEdtEngine()
m_nFirstLineEnd(FDE_TXTEDIT_LINEEND_Auto),
m_bAutoLineEnd(true),
m_wLineEnd(kUnicodeParagraphSeparator) {
- FXSYS_memset(&m_rtCaret, 0, sizeof(CFX_RectF));
m_bAutoLineEnd = (m_Param.nLineEnd == FDE_TXTEDIT_LINEEND_Auto);
}
@@ -663,14 +662,14 @@ int32_t CFDE_TxtEdtEngine::DoLayout(IFX_Pause* pPause) {
void CFDE_TxtEdtEngine::EndLayout() {
UpdatePages();
int32_t nLength = GetTextLength();
- if (m_nCaret > nLength) {
+ if (m_nCaret > nLength)
m_nCaret = nLength;
- }
+
int32_t nIndex = m_nCaret;
- if (!m_bBefore) {
+ if (!m_bBefore)
nIndex--;
- }
- m_rtCaret.Set(0, 0, 1, m_Param.fFontSize);
+
+ m_rtCaret = CFX_RectF(0, 0, 1, m_Param.fFontSize);
Unlock();
}
@@ -1381,12 +1380,11 @@ bool CFDE_TxtEdtEngine::IsFitArea(CFX_WideString& wsText) {
pTextOut->SetLineSpace(m_Param.fLineSpace);
pTextOut->SetFont(m_Param.pFont);
pTextOut->SetFontSize(m_Param.fFontSize);
- CFX_RectF rcText;
- FXSYS_memset(&rcText, 0, sizeof(rcText));
uint32_t dwStyle = 0;
if (!(m_Param.dwMode & FDE_TEXTEDITMODE_MultiLines))
dwStyle |= FDE_TTOSTYLE_SingleLine;
+ CFX_RectF rcText;
if (m_Param.dwMode & FDE_TEXTEDITMODE_AutoLineWrap) {
dwStyle |= FDE_TTOSTYLE_LineWrap;
rcText.width = m_Param.fPlateWidth;