summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/cfwl_edit.cpp')
-rw-r--r--xfa/fwl/cfwl_edit.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index 051c39f74e..b98278c622 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -1075,10 +1075,15 @@ void CFWL_Edit::InitCaret() {
}
void CFWL_Edit::UpdateCursorRect() {
- int32_t bidi_level = 0;
- m_rtCaret = CFX_RectF();
- std::tie(bidi_level, m_rtCaret) =
- m_EdtEngine.GetCharacterInfo(m_CursorPosition);
+ int32_t bidi_level;
+ if (m_EdtEngine.GetLength() > 0) {
+ std::tie(bidi_level, m_rtCaret) =
+ m_EdtEngine.GetCharacterInfo(m_CursorPosition);
+ } else {
+ bidi_level = 0;
+ m_rtCaret = CFX_RectF();
+ }
+
// TODO(dsinclair): This should handle bidi level ...
m_rtCaret.width = 1.0f;