Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1510)

Unified Diff: xfa/fde/tto/fde_textout.cpp

Issue 1900743004: Store WideString, not raw pointer, in FX_TXTRUN (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | xfa/fee/fde_txtedtpage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/tto/fde_textout.cpp
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index fe4e019eb74ba323234836537ef4cd1a2fa07496..7895b785f3dbb32b8a076126be90df69ec296114 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -142,7 +142,7 @@ class CFDE_TextOut : public IFDE_TextOut, public CFX_Target {
int32_t GetDisplayPos(FDE_LPTTOPIECE pPiece);
int32_t GetCharRects(FDE_LPTTOPIECE pPiece);
- void ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN& tr);
+ FX_TXTRUN ToTextRun(const FDE_LPTTOPIECE pPiece);
void DrawLine(const FDE_LPTTOPIECE pPiece, CFDE_Pen*& pPen);
CFX_TxtBreak* m_pTxtBreak;
@@ -975,32 +975,33 @@ void CFDE_TextOut::OnDraw(const CFX_RectF& rtClip) {
delete pBrush;
delete pPen;
}
+
int32_t CFDE_TextOut::GetDisplayPos(FDE_LPTTOPIECE pPiece) {
- FX_TXTRUN tr;
- ToTextRun(pPiece, tr);
+ FX_TXTRUN tr = ToTextRun(pPiece);
ExpandBuffer(tr.iLength, 2);
return m_pTxtBreak->GetDisplayPos(&tr, m_pCharPos);
}
+
int32_t CFDE_TextOut::GetCharRects(FDE_LPTTOPIECE pPiece) {
- FX_TXTRUN tr;
- ToTextRun(pPiece, tr);
+ FX_TXTRUN tr = ToTextRun(pPiece);
m_rectArray.RemoveAll();
return m_pTxtBreak->GetCharRects(&tr, m_rectArray);
}
-void CFDE_TextOut::ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN& tr) {
- tr.pAccess = NULL;
- tr.pIdentity = NULL;
- tr.pStr = (m_wsText + pPiece->iStartChar).c_str();
+
+FX_TXTRUN CFDE_TextOut::ToTextRun(const FDE_LPTTOPIECE pPiece) {
+ FX_TXTRUN tr;
+ tr.wsStr = m_wsText + pPiece->iStartChar;
tr.pWidths = m_pCharWidths + pPiece->iStartChar;
tr.iLength = pPiece->iChars;
tr.pFont = m_pFont;
tr.fFontSize = m_fFontSize;
tr.dwStyles = m_dwTxtBkStyles;
- tr.iCharRotation = 0;
tr.dwCharStyles = pPiece->dwCharStyles;
tr.wLineBreakChar = m_wParagraphBkChar;
tr.pRect = &pPiece->rtPiece;
+ return tr;
}
+
void CFDE_TextOut::DrawLine(const FDE_LPTTOPIECE pPiece, CFDE_Pen*& pPen) {
FX_BOOL bUnderLine = !!(m_dwStyles & FDE_TTOSTYLE_Underline);
FX_BOOL bStrikeOut = !!(m_dwStyles & FDE_TTOSTYLE_Strikeout);
« no previous file with comments | « no previous file | xfa/fee/fde_txtedtpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698