diff options
author | tsepez <tsepez@chromium.org> | 2016-04-19 14:11:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-19 14:11:59 -0700 |
commit | 4d31d0c653cf66f72bdef7cebbf7cff45d33f6c6 (patch) | |
tree | 63bd0f15c758b60a5ce577ac1a1f8bb24cb387c8 /xfa/fxfa | |
parent | e3bbfa29b9d38dbbb77c12692eba3c40a7fb2870 (diff) | |
download | pdfium-4d31d0c653cf66f72bdef7cebbf7cff45d33f6c6.tar.xz |
Remove a few more char* members from structs/classes.
This is a result of looking for the anti-paterns /char\*\sm_/
and /m_.*=.*\.c_str/ which indicate that a class may be using
the contents of a string without extending the lifetime of
the underlying storage.
Along the way, change to uint8_t in fx_dib; this is unrelated but
avoids grep hits (it is binary, not chars anyways).
Also remove two string operators that make it easy to assign in
a manner that does not extend contents lifetime.
Review URL: https://codereview.chromium.org/1902953002
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/app/xfa_textlayout.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_document_imp.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_object_imp.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index 80342a383e..532d6f54ce 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -37,8 +37,8 @@ void CXFA_CSSTagProvider::GetNextAttribute(FX_POSITION& pos, CFX_WideString* pName = NULL; CFX_WideString* pValue = NULL; m_Attributes.GetNextAssoc(pos, (void*&)pName, (void*&)pValue); - wsAttr = *pName; - wsValue = *pValue; + wsAttr = pName->AsStringC(); + wsValue = pValue->AsStringC(); } void CXFA_CSSTagProvider::SetAttribute(const CFX_WideString& wsAttr, const CFX_WideString& wsValue) { diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp index bdcfba47cb..39bdf2503c 100644 --- a/xfa/fxfa/parser/xfa_document_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_imp.cpp @@ -388,7 +388,7 @@ void CXFA_Document::DoProtoMerge() { !wsUseVal.IsEmpty()) { FX_STRSIZE uSharpPos = wsUseVal.Find('#'); if (uSharpPos < 0) { - wsURI = wsUseVal; + wsURI = wsUseVal.AsStringC(); } else { wsURI = CFX_WideStringC(wsUseVal.c_str(), uSharpPos); FX_STRSIZE uLen = wsUseVal.GetLength(); diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp index 306bd0f173..93b596ae99 100644 --- a/xfa/fxfa/parser/xfa_object_imp.cpp +++ b/xfa/fxfa/parser/xfa_object_imp.cpp @@ -4084,7 +4084,7 @@ FX_BOOL CXFA_Node::TryCData(XFA_ATTRIBUTE eAttr, if (eAttr == XFA_ATTRIBUTE_Value) { CFX_WideString* pStr = (CFX_WideString*)GetUserData(pKey, bProto); if (pStr) { - wsValue = *pStr; + wsValue = pStr->AsStringC(); return TRUE; } } else { |