Fix botch in setting CFGAS_TxtBreak::Run::wsStr.
Broken (by me, as it turns out) in
https://codereview.chromium.org/1882043004
The original code was adding an offset to a pointer. The new code was
silently invoking WideString::operator+(wchar_t) under the covers as
noticed when enabling some shortening warnings.
Change-Id: I43ce13e52ee899d3a4f7efc3a73f0f4723f878bb
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90713
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index a946e76..0ddad29 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -505,7 +505,7 @@
m_CharPos.resize(pPiece->char_count, TextCharPos());
CFGAS_TxtBreak::Run tr;
- tr.wsStr = m_wsText + pPiece->start_char;
+ tr.wsStr = m_wsText.Substr(pPiece->start_char);
tr.pWidths = &m_CharWidths[pPiece->start_char];
tr.iLength = pPiece->char_count;
tr.pFont = m_pFont;