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

Side by Side Diff: xfa/fgas/layout/fgas_textbreak.h

Issue 2095653002: Remove NULL in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « xfa/fgas/layout/fgas_rtfbreak.cpp ('k') | xfa/fgas/layout/fgas_textbreak.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ 7 #ifndef XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
8 #define XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ 8 #define XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
9 9
10 #include "core/fxcrt/include/fx_ucd.h" 10 #include "core/fxcrt/include/fx_ucd.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 class CFX_TxtPiece : public CFX_Target { 106 class CFX_TxtPiece : public CFX_Target {
107 public: 107 public:
108 CFX_TxtPiece(); 108 CFX_TxtPiece();
109 109
110 int32_t GetEndPos() const { 110 int32_t GetEndPos() const {
111 return m_iWidth < 0 ? m_iStartPos : m_iStartPos + m_iWidth; 111 return m_iWidth < 0 ? m_iStartPos : m_iStartPos + m_iWidth;
112 } 112 }
113 int32_t GetLength() const { return m_iChars; } 113 int32_t GetLength() const { return m_iChars; }
114 int32_t GetEndChar() const { return m_iStartChar + m_iChars; } 114 int32_t GetEndChar() const { return m_iStartChar + m_iChars; }
115 CFX_TxtChar* GetCharPtr(int32_t index) const { 115 CFX_TxtChar* GetCharPtr(int32_t index) const {
116 ASSERT(index > -1 && index < m_iChars && m_pChars != NULL); 116 ASSERT(index > -1 && index < m_iChars && m_pChars);
117 return m_pChars->GetDataPtr(m_iStartChar + index); 117 return m_pChars->GetDataPtr(m_iStartChar + index);
118 } 118 }
119 void GetString(FX_WCHAR* pText) const { 119 void GetString(FX_WCHAR* pText) const {
120 ASSERT(pText != NULL); 120 ASSERT(pText);
121 int32_t iEndChar = m_iStartChar + m_iChars; 121 int32_t iEndChar = m_iStartChar + m_iChars;
122 CFX_Char* pChar; 122 CFX_Char* pChar;
123 for (int32_t i = m_iStartChar; i < iEndChar; i++) { 123 for (int32_t i = m_iStartChar; i < iEndChar; i++) {
124 pChar = m_pChars->GetDataPtr(i); 124 pChar = m_pChars->GetDataPtr(i);
125 *pText++ = (FX_WCHAR)pChar->m_wCharCode; 125 *pText++ = (FX_WCHAR)pChar->m_wCharCode;
126 } 126 }
127 } 127 }
128 void GetString(CFX_WideString& wsText) const { 128 void GetString(CFX_WideString& wsText) const {
129 FX_WCHAR* pText = wsText.GetBuffer(m_iChars); 129 FX_WCHAR* pText = wsText.GetBuffer(m_iChars);
130 GetString(pText); 130 GetString(pText);
131 wsText.ReleaseBuffer(m_iChars); 131 wsText.ReleaseBuffer(m_iChars);
132 } 132 }
133 void GetWidths(int32_t* pWidths) const { 133 void GetWidths(int32_t* pWidths) const {
134 ASSERT(pWidths != NULL); 134 ASSERT(pWidths);
135 int32_t iEndChar = m_iStartChar + m_iChars; 135 int32_t iEndChar = m_iStartChar + m_iChars;
136 CFX_Char* pChar; 136 CFX_Char* pChar;
137 for (int32_t i = m_iStartChar; i < iEndChar; i++) { 137 for (int32_t i = m_iStartChar; i < iEndChar; i++) {
138 pChar = m_pChars->GetDataPtr(i); 138 pChar = m_pChars->GetDataPtr(i);
139 *pWidths++ = pChar->m_iCharWidth; 139 *pWidths++ = pChar->m_iCharWidth;
140 } 140 }
141 } 141 }
142 142
143 uint32_t m_dwStatus; 143 uint32_t m_dwStatus;
144 int32_t m_iStartPos; 144 int32_t m_iStartPos;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 uint32_t AppendChar(FX_WCHAR wch); 222 uint32_t AppendChar(FX_WCHAR wch);
223 uint32_t EndBreak(uint32_t dwStatus = FX_TXTBREAK_PieceBreak); 223 uint32_t EndBreak(uint32_t dwStatus = FX_TXTBREAK_PieceBreak);
224 int32_t CountBreakChars() const; 224 int32_t CountBreakChars() const;
225 int32_t CountBreakPieces() const; 225 int32_t CountBreakPieces() const;
226 const CFX_TxtPiece* GetBreakPiece(int32_t index) const; 226 const CFX_TxtPiece* GetBreakPiece(int32_t index) const;
227 void ClearBreakPieces(); 227 void ClearBreakPieces();
228 void Reset(); 228 void Reset();
229 int32_t GetDisplayPos(const FX_TXTRUN* pTxtRun, 229 int32_t GetDisplayPos(const FX_TXTRUN* pTxtRun,
230 FXTEXT_CHARPOS* pCharPos, 230 FXTEXT_CHARPOS* pCharPos,
231 FX_BOOL bCharCode = FALSE, 231 FX_BOOL bCharCode = FALSE,
232 CFX_WideString* pWSForms = NULL, 232 CFX_WideString* pWSForms = nullptr,
233 FX_AdjustCharDisplayPos pAdjustPos = NULL) const; 233 FX_AdjustCharDisplayPos pAdjustPos = nullptr) const;
234 int32_t GetCharRects(const FX_TXTRUN* pTxtRun, 234 int32_t GetCharRects(const FX_TXTRUN* pTxtRun,
235 CFX_RectFArray& rtArray, 235 CFX_RectFArray& rtArray,
236 FX_BOOL bCharBBox = FALSE) const; 236 FX_BOOL bCharBBox = FALSE) const;
237 void AppendChar_PageLoad(CFX_TxtChar* pCurChar, uint32_t dwProps); 237 void AppendChar_PageLoad(CFX_TxtChar* pCurChar, uint32_t dwProps);
238 uint32_t AppendChar_Combination(CFX_TxtChar* pCurChar, int32_t iRotation); 238 uint32_t AppendChar_Combination(CFX_TxtChar* pCurChar, int32_t iRotation);
239 uint32_t AppendChar_Tab(CFX_TxtChar* pCurChar, int32_t iRotation); 239 uint32_t AppendChar_Tab(CFX_TxtChar* pCurChar, int32_t iRotation);
240 uint32_t AppendChar_Control(CFX_TxtChar* pCurChar, int32_t iRotation); 240 uint32_t AppendChar_Control(CFX_TxtChar* pCurChar, int32_t iRotation);
241 uint32_t AppendChar_Arabic(CFX_TxtChar* pCurChar, int32_t iRotation); 241 uint32_t AppendChar_Arabic(CFX_TxtChar* pCurChar, int32_t iRotation);
242 uint32_t AppendChar_Others(CFX_TxtChar* pCurChar, int32_t iRotation); 242 uint32_t AppendChar_Others(CFX_TxtChar* pCurChar, int32_t iRotation);
243 243
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 CFX_TxtLine* m_pTxtLine2; 301 CFX_TxtLine* m_pTxtLine2;
302 CFX_TxtLine* m_pCurLine; 302 CFX_TxtLine* m_pCurLine;
303 int32_t m_iReady; 303 int32_t m_iReady;
304 int32_t m_iTolerance; 304 int32_t m_iTolerance;
305 int32_t m_iHorScale; 305 int32_t m_iHorScale;
306 int32_t m_iVerScale; 306 int32_t m_iVerScale;
307 int32_t m_iCharSpace; 307 int32_t m_iCharSpace;
308 }; 308 };
309 309
310 #endif // XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ 310 #endif // XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_
OLDNEW
« no previous file with comments | « xfa/fgas/layout/fgas_rtfbreak.cpp ('k') | xfa/fgas/layout/fgas_textbreak.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698