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

Unified Diff: xfa/src/fxfa/src/app/xfa_textlayout.h

Issue 1730713002: Moar _CAPS work, part 3. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits. Created 4 years, 10 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 | « xfa/src/fxfa/src/app/xfa_fftext.cpp ('k') | xfa/src/fxfa/src/app/xfa_textlayout.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxfa/src/app/xfa_textlayout.h
diff --git a/xfa/src/fxfa/src/app/xfa_textlayout.h b/xfa/src/fxfa/src/app/xfa_textlayout.h
index 44a27ad46c6321b165c374e8851e6bb6565e170d..fa32b70961c4e5d82e99d14b514f3be067df3e25 100644
--- a/xfa/src/fxfa/src/app/xfa_textlayout.h
+++ b/xfa/src/fxfa/src/app/xfa_textlayout.h
@@ -225,7 +225,14 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target {
IFX_MEMAllocator* m_pAllocator;
FX_DWORD m_dwRefCount;
};
-typedef struct _XFA_TEXTPIECE : public CFX_Target {
+
+struct XFA_TEXTPIECE : public CFX_Target {
+ XFA_TEXTPIECE() : pszText(nullptr), pFont(nullptr), pLinkData(nullptr) {}
+ ~XFA_TEXTPIECE() {
+ if (pLinkData)
+ pLinkData->Release();
+ }
+
FX_WCHAR* pszText;
int32_t iChars;
int32_t* pWidths;
@@ -240,20 +247,9 @@ typedef struct _XFA_TEXTPIECE : public CFX_Target {
FX_FLOAT fFontSize;
CFX_RectF rtPiece;
CXFA_LinkUserData* pLinkData;
+};
+typedef CFX_ArrayTemplate<XFA_TEXTPIECE*> CXFA_PieceArray;
- _XFA_TEXTPIECE() : pszText(NULL), pFont(NULL), pLinkData(NULL) {
- pszText = NULL;
- }
- ~_XFA_TEXTPIECE() {
- pszText = NULL;
- if (NULL != pLinkData) {
- pLinkData->Release();
- pLinkData = NULL;
- }
- }
-} XFA_TEXTPIECE, *XFA_LPTEXTPIECE;
-typedef XFA_TEXTPIECE const* XFA_LPCTEXTPIECE;
-typedef CFX_ArrayTemplate<XFA_LPTEXTPIECE> CXFA_PieceArray;
class CXFA_PieceLine : public CFX_Target {
public:
CXFA_PieceLine() {}
@@ -383,10 +379,10 @@ class CXFA_TextLayout {
int32_t iPiece,
FXTEXT_CHARPOS* pCharPos,
const CFX_Matrix& tmDoc2Device);
- int32_t GetDisplayPos(XFA_LPCTEXTPIECE pPiece,
+ int32_t GetDisplayPos(const XFA_TEXTPIECE* pPiece,
FXTEXT_CHARPOS* pCharPos,
FX_BOOL bCharCode = FALSE);
- FX_BOOL ToRun(XFA_LPCTEXTPIECE pPiece, FX_RTFTEXTOBJ& tr);
+ FX_BOOL ToRun(const XFA_TEXTPIECE* pPiece, FX_RTFTEXTOBJ& tr);
void DoTabstops(IFDE_CSSComputedStyle* pStyle, CXFA_PieceLine* pPieceLine);
FX_BOOL Layout(int32_t iBlock);
int32_t CountBlocks() const;
« no previous file with comments | « xfa/src/fxfa/src/app/xfa_fftext.cpp ('k') | xfa/src/fxfa/src/app/xfa_textlayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698