summaryrefslogtreecommitdiff
path: root/xfa/fde
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fde')
-rw-r--r--xfa/fde/cfde_txtedtengine.cpp294
-rw-r--r--xfa/fde/cfde_txtedtpage.cpp49
-rw-r--r--xfa/fde/ifde_txtedtengine.h13
3 files changed, 95 insertions, 261 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index 7df4e0fb96..1d357e928f 100644
--- a/xfa/fde/cfde_txtedtengine.cpp
+++ b/xfa/fde/cfde_txtedtengine.cpp
@@ -205,9 +205,7 @@ int32_t CFDE_TxtEdtEngine::SetCaretPos(int32_t nIndex, bool bBefore) {
m_nCaret++;
m_bBefore = true;
}
- m_fCaretPosReserve = (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical)
- ? m_rtCaret.top
- : m_rtCaret.left;
+ m_fCaretPosReserve = m_rtCaret.left;
m_Param.pEventSink->OnCaretChanged();
m_nAnchorPos = -1;
return m_nCaret;
@@ -234,64 +232,38 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
} else {
m_nAnchorPos = -1;
}
- bool bVertical = m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical;
+
switch (eMoveCaret) {
case MC_Left: {
- if (bVertical) {
- CFX_PointF ptCaret;
- if (MoveUp(ptCaret)) {
- UpdateCaretIndex(ptCaret);
- }
- } else {
- bool bBefore = true;
- int32_t nIndex = MoveBackward(bBefore);
- if (nIndex >= 0) {
- UpdateCaretRect(nIndex, bBefore);
- }
+ bool bBefore = true;
+ int32_t nIndex = MoveBackward(bBefore);
+ if (nIndex >= 0) {
+ UpdateCaretRect(nIndex, bBefore);
}
- } break;
+ break;
+ }
case MC_Right: {
- if (bVertical) {
- CFX_PointF ptCaret;
- if (MoveDown(ptCaret)) {
- UpdateCaretIndex(ptCaret);
- }
- } else {
- bool bBefore = true;
- int32_t nIndex = MoveForward(bBefore);
- if (nIndex >= 0) {
- UpdateCaretRect(nIndex, bBefore);
- }
+ bool bBefore = true;
+ int32_t nIndex = MoveForward(bBefore);
+ if (nIndex >= 0) {
+ UpdateCaretRect(nIndex, bBefore);
}
- } break;
+ break;
+ }
case MC_Up: {
- if (bVertical) {
- bool bBefore = true;
- int32_t nIndex = MoveBackward(bBefore);
- if (nIndex >= 0) {
- UpdateCaretRect(nIndex, bBefore);
- }
- } else {
- CFX_PointF ptCaret;
- if (MoveUp(ptCaret)) {
- UpdateCaretIndex(ptCaret);
- }
+ CFX_PointF ptCaret;
+ if (MoveUp(ptCaret)) {
+ UpdateCaretIndex(ptCaret);
}
- } break;
+ break;
+ }
case MC_Down: {
- if (bVertical) {
- bool bBefore = true;
- int32_t nIndex = MoveForward(bBefore);
- if (nIndex >= 0) {
- UpdateCaretRect(nIndex, bBefore);
- }
- } else {
- CFX_PointF ptCaret;
- if (MoveDown(ptCaret)) {
- UpdateCaretIndex(ptCaret);
- }
+ CFX_PointF ptCaret;
+ if (MoveDown(ptCaret)) {
+ UpdateCaretIndex(ptCaret);
}
- } break;
+ break;
+ }
case MC_WordBackward:
break;
case MC_WordForward:
@@ -413,10 +385,9 @@ int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart,
if (IsSelect()) {
DeleteSelect();
}
- if (!(m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo))
- m_Param.pEventSink->OnAddDoRecord(
- pdfium::MakeUnique<CFDE_TxtEdtDoRecord_Insert>(this, m_nCaret, lpBuffer,
- nLength));
+ m_Param.pEventSink->OnAddDoRecord(
+ pdfium::MakeUnique<CFDE_TxtEdtDoRecord_Insert>(this, m_nCaret, lpBuffer,
+ nLength));
m_ChangeInfo.wsPrevText = GetText(0, -1);
Inner_Insert(m_nCaret, lpBuffer, nLength);
@@ -470,12 +441,11 @@ int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, bool bBackspace) {
if (!m_Param.pEventSink->OnValidate(wsText))
return FDE_TXTEDT_MODIFY_RET_F_Invalidate;
}
- if (!(m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)) {
- CFX_WideString wsRange = m_pTxtBuf->GetRange(nStart, nCount);
- m_Param.pEventSink->OnAddDoRecord(
- pdfium::MakeUnique<CFDE_TxtEdtDoRecord_DeleteRange>(this, nStart,
- m_nCaret, wsRange));
- }
+ CFX_WideString wsRange = m_pTxtBuf->GetRange(nStart, nCount);
+ m_Param.pEventSink->OnAddDoRecord(
+ pdfium::MakeUnique<CFDE_TxtEdtDoRecord_DeleteRange>(this, nStart,
+ m_nCaret, wsRange));
+
m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete;
m_ChangeInfo.wsDelete = GetText(nStart, nCount);
Inner_DeleteRange(nStart, nCount);
@@ -656,16 +626,12 @@ void CFDE_TxtEdtEngine::ClearSelection() {
bool CFDE_TxtEdtEngine::Redo(const IFDE_TxtEdtDoRecord* pDoRecord) {
if (IsLocked())
return false;
- if (m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)
- return false;
return pDoRecord->Redo();
}
bool CFDE_TxtEdtEngine::Undo(const IFDE_TxtEdtDoRecord* pDoRecord) {
if (IsLocked())
return false;
- if (m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)
- return false;
return pDoRecord->Undo();
}
@@ -945,12 +911,11 @@ void CFDE_TxtEdtEngine::DeleteRange_DoRecord(int32_t nStart,
}
ASSERT((nStart + nCount) <= m_pTxtBuf->GetTextLength());
- if (!(m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)) {
- CFX_WideString wsRange = m_pTxtBuf->GetRange(nStart, nCount);
- m_Param.pEventSink->OnAddDoRecord(
- pdfium::MakeUnique<CFDE_TxtEdtDoRecord_DeleteRange>(
- this, nStart, m_nCaret, wsRange, bSel));
- }
+ CFX_WideString wsRange = m_pTxtBuf->GetRange(nStart, nCount);
+ m_Param.pEventSink->OnAddDoRecord(
+ pdfium::MakeUnique<CFDE_TxtEdtDoRecord_DeleteRange>(
+ this, nStart, m_nCaret, wsRange, bSel));
+
m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete;
m_ChangeInfo.wsDelete = GetText(nStart, nCount);
Inner_DeleteRange(nStart, nCount);
@@ -1046,52 +1011,25 @@ void CFDE_TxtEdtEngine::UpdateTxtBreak() {
} else {
dwStyle |= FX_TXTLAYOUTSTYLE_SingleLine;
}
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
- dwStyle |= FX_TXTLAYOUTSTYLE_VerticalLayout;
- } else {
- dwStyle &= ~FX_TXTLAYOUTSTYLE_VerticalLayout;
- }
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_LineReserve) {
- dwStyle |= FX_TXTLAYOUTSTYLE_ReverseLine;
- } else {
- dwStyle &= ~FX_TXTLAYOUTSTYLE_ReverseLine;
- }
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_RTL) {
- dwStyle |= FX_TXTLAYOUTSTYLE_RTLReadingOrder;
- } else {
- dwStyle &= ~FX_TXTLAYOUTSTYLE_RTLReadingOrder;
- }
+ dwStyle &= ~FX_TXTLAYOUTSTYLE_VerticalLayout;
+ dwStyle &= ~FX_TXTLAYOUTSTYLE_ReverseLine;
+ dwStyle &= ~FX_TXTLAYOUTSTYLE_RTLReadingOrder;
+
if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText) {
dwStyle |= FX_TXTLAYOUTSTYLE_CombText;
} else {
dwStyle &= ~FX_TXTLAYOUTSTYLE_CombText;
}
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CharVertial) {
- dwStyle |= FX_TXTLAYOUTSTYLE_VerticalChars;
- } else {
- dwStyle &= ~FX_TXTLAYOUTSTYLE_VerticalChars;
- }
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_ExpandTab) {
- dwStyle |= FX_TXTLAYOUTSTYLE_ExpandTab;
- } else {
- dwStyle &= ~FX_TXTLAYOUTSTYLE_ExpandTab;
- }
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_ArabicContext) {
- dwStyle |= FX_TXTLAYOUTSTYLE_ArabicContext;
- } else {
- dwStyle &= ~FX_TXTLAYOUTSTYLE_ArabicContext;
- }
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_ArabicShapes) {
- dwStyle |= FX_TXTLAYOUTSTYLE_ArabicShapes;
- } else {
- dwStyle &= ~FX_TXTLAYOUTSTYLE_ArabicShapes;
- }
+
+ dwStyle &= ~FX_TXTLAYOUTSTYLE_VerticalChars;
+ dwStyle &= ~FX_TXTLAYOUTSTYLE_ExpandTab;
+ dwStyle &= ~FX_TXTLAYOUTSTYLE_ArabicContext;
+ dwStyle &= ~FX_TXTLAYOUTSTYLE_ArabicShapes;
+
m_pTextBreak->SetLayoutStyles(dwStyle);
uint32_t dwAligment = 0;
if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Justified) {
dwAligment |= FX_TXTLINEALIGNMENT_Justified;
- } else if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Distributed) {
- dwAligment |= FX_TXTLINEALIGNMENT_Distributed;
}
if (m_Param.dwAlignment & FDE_TEXTEDITALIGN_Center) {
dwAligment |= FX_TXTLINEALIGNMENT_Center;
@@ -1099,25 +1037,16 @@ void CFDE_TxtEdtEngine::UpdateTxtBreak() {
dwAligment |= FX_TXTLINEALIGNMENT_Right;
}
m_pTextBreak->SetAlignment(dwAligment);
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
- if (m_Param.dwMode & FDE_TEXTEDITMODE_AutoLineWrap) {
- m_pTextBreak->SetLineWidth(m_Param.fPlateHeight);
- } else {
- m_pTextBreak->SetLineWidth(kPageWidthMax);
- }
+
+ if (m_Param.dwMode & FDE_TEXTEDITMODE_AutoLineWrap) {
+ m_pTextBreak->SetLineWidth(m_Param.fPlateWidth);
} else {
- if (m_Param.dwMode & FDE_TEXTEDITMODE_AutoLineWrap) {
- m_pTextBreak->SetLineWidth(m_Param.fPlateWidth);
- } else {
- m_pTextBreak->SetLineWidth(kPageWidthMax);
- }
+ m_pTextBreak->SetLineWidth(kPageWidthMax);
}
+
m_nPageLineCount = m_Param.nLineCount;
if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText) {
- FX_FLOAT fCombWidth =
- m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical
- ? m_Param.fPlateHeight
- : m_Param.fPlateWidth;
+ FX_FLOAT fCombWidth = m_Param.fPlateWidth;
if (m_nLimit > 0) {
fCombWidth /= m_nLimit;
}
@@ -1323,85 +1252,34 @@ int32_t CFDE_TxtEdtEngine::MoveBackward(bool& bBefore) {
bool CFDE_TxtEdtEngine::MoveUp(CFX_PointF& ptCaret) {
IFDE_TxtEdtPage* pPage = GetPage(m_nCaretPage);
const CFX_RectF& rtContent = pPage->GetContentsBox();
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
- ptCaret.x = m_rtCaret.left + m_rtCaret.width / 2 - m_Param.fLineSpace;
- ptCaret.y = m_fCaretPosReserve;
- bool bLineReserve =
- !!(m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_LineReserve);
- if (ptCaret.x < rtContent.left) {
- if (bLineReserve) {
- if (m_nCaretPage == CountPages() - 1) {
- return false;
- }
- } else {
- if (m_nCaretPage == 0) {
- return false;
- }
- }
- if (bLineReserve) {
- m_nCaretPage++;
- } else {
- m_nCaretPage--;
- }
- ptCaret.x -= rtContent.left;
- IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage);
- ptCaret.x += pCurPage->GetContentsBox().right();
- }
- } else {
- ptCaret.x = m_fCaretPosReserve;
- ptCaret.y = m_rtCaret.top + m_rtCaret.height / 2 - m_Param.fLineSpace;
- if (ptCaret.y < rtContent.top) {
- if (m_nCaretPage == 0) {
- return false;
- }
- ptCaret.y -= rtContent.top;
- m_nCaretPage--;
- IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage);
- ptCaret.y += pCurPage->GetContentsBox().bottom();
+ ptCaret.x = m_fCaretPosReserve;
+ ptCaret.y = m_rtCaret.top + m_rtCaret.height / 2 - m_Param.fLineSpace;
+ if (ptCaret.y < rtContent.top) {
+ if (m_nCaretPage == 0) {
+ return false;
}
+ ptCaret.y -= rtContent.top;
+ m_nCaretPage--;
+ IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage);
+ ptCaret.y += pCurPage->GetContentsBox().bottom();
}
+
return true;
}
bool CFDE_TxtEdtEngine::MoveDown(CFX_PointF& ptCaret) {
IFDE_TxtEdtPage* pPage = GetPage(m_nCaretPage);
const CFX_RectF& rtContent = pPage->GetContentsBox();
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
- ptCaret.x = m_rtCaret.left + m_rtCaret.width / 2 + m_Param.fLineSpace;
- ptCaret.y = m_fCaretPosReserve;
- if (ptCaret.x >= rtContent.right()) {
- bool bLineReserve =
- !!(m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_LineReserve);
- if (bLineReserve) {
- if (m_nCaretPage == 0) {
- return false;
- }
- } else {
- if (m_nCaretPage == CountPages() - 1) {
- return false;
- }
- }
- if (bLineReserve) {
- m_nCaretPage--;
- } else {
- m_nCaretPage++;
- }
- ptCaret.x -= rtContent.right();
- IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage);
- ptCaret.x += pCurPage->GetContentsBox().left;
- }
- } else {
- ptCaret.x = m_fCaretPosReserve;
- ptCaret.y = m_rtCaret.top + m_rtCaret.height / 2 + m_Param.fLineSpace;
- if (ptCaret.y >= rtContent.bottom()) {
- if (m_nCaretPage == CountPages() - 1) {
- return false;
- }
- ptCaret.y -= rtContent.bottom();
- m_nCaretPage++;
- IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage);
- ptCaret.y += pCurPage->GetContentsBox().top;
+ ptCaret.x = m_fCaretPosReserve;
+ ptCaret.y = m_rtCaret.top + m_rtCaret.height / 2 + m_Param.fLineSpace;
+ if (ptCaret.y >= rtContent.bottom()) {
+ if (m_nCaretPage == CountPages() - 1) {
+ return false;
}
+ ptCaret.y -= rtContent.bottom();
+ m_nCaretPage++;
+ IFDE_TxtEdtPage* pCurPage = GetPage(m_nCaretPage);
+ ptCaret.y += pCurPage->GetContentsBox().top;
}
return true;
}
@@ -1542,9 +1420,7 @@ void CFDE_TxtEdtEngine::UpdateCaretRect(int32_t nIndex, bool bBefore) {
m_nCaret++;
m_bBefore = true;
}
- m_fCaretPosReserve = (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical)
- ? m_rtCaret.top
- : m_rtCaret.left;
+ m_fCaretPosReserve = m_rtCaret.left;
m_Param.pEventSink->OnCaretChanged();
}
@@ -1561,25 +1437,15 @@ void CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF& rtCaret,
bBefore = false;
}
int32_t nBIDILevel = pPage->GetCharRect(nIndexInpage, rtCaret, bCombText);
- if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
- if ((!FX_IsOdd(nBIDILevel) && !bBefore) ||
- (FX_IsOdd(nBIDILevel) && bBefore)) {
- rtCaret.Offset(0, rtCaret.height - 1.0f);
- }
- if (rtCaret.height == 0 && rtCaret.top > 1.0f)
- rtCaret.top -= 1.0f;
+ if ((!FX_IsOdd(nBIDILevel) && !bBefore) ||
+ (FX_IsOdd(nBIDILevel) && bBefore)) {
+ rtCaret.Offset(rtCaret.width - 1.0f, 0);
+ }
+ if (rtCaret.width == 0 && rtCaret.left > 1.0f)
+ rtCaret.left -= 1.0f;
- rtCaret.height = 1.0f;
- } else {
- if ((!FX_IsOdd(nBIDILevel) && !bBefore) ||
- (FX_IsOdd(nBIDILevel) && bBefore)) {
- rtCaret.Offset(rtCaret.width - 1.0f, 0);
- }
- if (rtCaret.width == 0 && rtCaret.left > 1.0f)
- rtCaret.left -= 1.0f;
+ rtCaret.width = 1.0f;
- rtCaret.width = 1.0f;
- }
m_Param.pEventSink->OnPageUnload(m_nCaretPage);
}
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp
index 51621dae1c..ff19d12338 100644
--- a/xfa/fde/cfde_txtedtpage.cpp
+++ b/xfa/fde/cfde_txtedtpage.cpp
@@ -83,8 +83,6 @@ int32_t CFDE_TxtEdtPage::GetCharRect(int32_t nIndex,
}
int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint, bool& bBefore) {
- bool bVertical = m_pEditEngine->GetEditParams()->dwLayoutStyles &
- FDE_TEXTEDITLAYOUT_DocVertical;
CFX_PointF ptF = fPoint;
NormalizePt2Rect(ptF, m_rtPageContents, kTolerance);
int32_t nCount = m_PieceMassArr.GetSize();
@@ -95,18 +93,13 @@ int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint, bool& bBefore) {
int32_t i = 0;
for (i = 0; i < nCount; i++) {
const FDE_TEXTEDITPIECE* pPiece = m_PieceMassArr.GetPtrAt(i);
- if (!bInLine && (bVertical ? (pPiece->rtPiece.left <= ptF.x &&
- pPiece->rtPiece.right() > ptF.x)
- : (pPiece->rtPiece.top <= ptF.y &&
- pPiece->rtPiece.bottom() > ptF.y))) {
+ if (!bInLine &&
+ (pPiece->rtPiece.top <= ptF.y && pPiece->rtPiece.bottom() > ptF.y)) {
nBgn = nEnd = i;
rtLine = pPiece->rtPiece;
bInLine = true;
} else if (bInLine) {
- if (bVertical ? (!(pPiece->rtPiece.left <= ptF.x &&
- pPiece->rtPiece.right() > ptF.x))
- : (pPiece->rtPiece.bottom() <= ptF.y ||
- pPiece->rtPiece.top > ptF.y)) {
+ if (pPiece->rtPiece.bottom() <= ptF.y || pPiece->rtPiece.top > ptF.y) {
nEnd = i - 1;
break;
} else {
@@ -142,9 +135,7 @@ int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint, bool& bBefore) {
bBefore = true;
return nCaret;
}
- if (bVertical
- ? (ptF.y > ((rectArr[j].top + rectArr[j].bottom()) / 2))
- : (ptF.x > ((rectArr[j].left + rectArr[j].right()) / 2))) {
+ if (ptF.x > ((rectArr[j].left + rectArr[j].right()) / 2)) {
bBefore = FX_IsOdd(pPiece->nBidiLevel);
} else {
bBefore = !FX_IsOdd(pPiece->nBidiLevel);
@@ -293,15 +284,9 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
m_pEndParag->LoadParag();
m_pEndParag->GetLineRange(nEndLine - nEndLineInParag, nPageEnd, nTemp);
nPageEnd += (nTemp - 1);
- bool bVertial = pParams->dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical;
- bool bLineReserve =
- !!(pParams->dwLayoutStyles & FDE_TEXTEDITLAYOUT_LineReserve);
- FX_FLOAT fLineStart =
- bVertial
- ? (bLineReserve ? (pParams->fPlateWidth - pParams->fLineSpace) : 0.0f)
- : 0.0f;
- FX_FLOAT fLineStep =
- (bVertial && bLineReserve) ? (-pParams->fLineSpace) : pParams->fLineSpace;
+
+ FX_FLOAT fLineStart = 0.0f;
+ FX_FLOAT fLineStep = pParams->fLineSpace;
FX_FLOAT fLinePos = fLineStart;
if (!m_pTextSet)
m_pTextSet = pdfium::MakeUnique<CFDE_TxtEdtTextSet>(this);
@@ -366,19 +351,13 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox,
}
}
}
- if (pParams->dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
- TxtEdtPiece.rtPiece.left = fLinePos;
- TxtEdtPiece.rtPiece.top = (FX_FLOAT)pPiece->m_iStartPos / 20000.0f;
- TxtEdtPiece.rtPiece.width = pParams->fLineSpace;
- TxtEdtPiece.rtPiece.height =
- (FX_FLOAT)pPiece->m_iWidth / 20000.0f + fParaBreakWidth;
- } else {
- TxtEdtPiece.rtPiece.left = (FX_FLOAT)pPiece->m_iStartPos / 20000.0f;
- TxtEdtPiece.rtPiece.top = fLinePos;
- TxtEdtPiece.rtPiece.width =
- (FX_FLOAT)pPiece->m_iWidth / 20000.0f + fParaBreakWidth;
- TxtEdtPiece.rtPiece.height = pParams->fLineSpace;
- }
+
+ TxtEdtPiece.rtPiece.left = (FX_FLOAT)pPiece->m_iStartPos / 20000.0f;
+ TxtEdtPiece.rtPiece.top = fLinePos;
+ TxtEdtPiece.rtPiece.width =
+ (FX_FLOAT)pPiece->m_iWidth / 20000.0f + fParaBreakWidth;
+ TxtEdtPiece.rtPiece.height = pParams->fLineSpace;
+
if (bFirstPiece) {
m_rtPageContents = TxtEdtPiece.rtPiece;
bFirstPiece = false;
diff --git a/xfa/fde/ifde_txtedtengine.h b/xfa/fde/ifde_txtedtengine.h
index 56b8daa1b6..12f0cd88bf 100644
--- a/xfa/fde/ifde_txtedtengine.h
+++ b/xfa/fde/ifde_txtedtengine.h
@@ -19,27 +19,16 @@ class CFWL_Edit;
#define FDE_TEXTEDITMODE_ReadOnly (1L << 2)
#define FDE_TEXTEDITMODE_LimitArea_Vert (1L << 3)
#define FDE_TEXTEDITMODE_LimitArea_Horz (1L << 4)
-#define FDE_TEXTEDITMODE_NoRedoUndo (1L << 5)
-#define FDE_TEXTEDITMODE_FIELD_TAB (1L << 6)
-#define FDE_TEXTEDITMODE_FIELD_AUTO (1L << 7)
#define FDE_TEXTEDITMODE_Validate (1L << 8)
#define FDE_TEXTEDITMODE_Password (1L << 9)
-#define FDE_TEXTEDITALIGN_Left (0L << 0)
+#define FDE_TEXTEDITALIGN_Left 0
#define FDE_TEXTEDITALIGN_Center (1L << 0)
#define FDE_TEXTEDITALIGN_Right (2L << 0)
#define FDE_TEXTEDITALIGN_Normal (1L << 3)
#define FDE_TEXTEDITALIGN_Justified (1L << 4)
-#define FDE_TEXTEDITALIGN_Distributed (1L << 5)
-#define FDE_TEXTEDITLAYOUT_DocVertical (1L << 0)
-#define FDE_TEXTEDITLAYOUT_CharVertial (1L << 1)
-#define FDE_TEXTEDITLAYOUT_LineReserve (1L << 2)
-#define FDE_TEXTEDITLAYOUT_RTL (1L << 3)
#define FDE_TEXTEDITLAYOUT_CombText (1L << 4)
-#define FDE_TEXTEDITLAYOUT_ExpandTab (1L << 5)
-#define FDE_TEXTEDITLAYOUT_ArabicContext (1L << 6)
-#define FDE_TEXTEDITLAYOUT_ArabicShapes (1L << 7)
#define FDE_TEXTEDITLAYOUT_LastLineHeight (1L << 8)
enum FDE_TXTEDTMOVECARET {