diff options
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/cxfa_linkuserdata.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_linkuserdata.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_textlayout.cpp | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/xfa/fxfa/cxfa_linkuserdata.cpp b/xfa/fxfa/cxfa_linkuserdata.cpp index c32b74664c..84cee352a7 100644 --- a/xfa/fxfa/cxfa_linkuserdata.cpp +++ b/xfa/fxfa/cxfa_linkuserdata.cpp @@ -6,7 +6,7 @@ #include "xfa/fxfa/cxfa_linkuserdata.h" -CXFA_LinkUserData::CXFA_LinkUserData(wchar_t* pszText) +CXFA_LinkUserData::CXFA_LinkUserData(const wchar_t* pszText) : m_wsURLContent(pszText) {} CXFA_LinkUserData::~CXFA_LinkUserData() {} diff --git a/xfa/fxfa/cxfa_linkuserdata.h b/xfa/fxfa/cxfa_linkuserdata.h index 3d0f95e91c..f62bd3c044 100644 --- a/xfa/fxfa/cxfa_linkuserdata.h +++ b/xfa/fxfa/cxfa_linkuserdata.h @@ -19,7 +19,7 @@ class CXFA_LinkUserData : public Retainable { const wchar_t* GetLinkURL() const { return m_wsURLContent.c_str(); } private: - explicit CXFA_LinkUserData(wchar_t* pszText); + explicit CXFA_LinkUserData(const wchar_t* pszText); ~CXFA_LinkUserData() override; WideString m_wsURLContent; diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index 41d46f8824..e360c16dde 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -746,9 +746,8 @@ bool CXFA_TextLayout::LoadRichText( ASSERT(pElement); WideString wsLinkContent = pElement->GetString(L"href"); if (!wsLinkContent.IsEmpty()) { - pLinkData = pdfium::MakeRetain<CXFA_LinkUserData>( - wsLinkContent.GetBuffer(wsLinkContent.GetLength())); - wsLinkContent.ReleaseBuffer(wsLinkContent.GetLength()); + pLinkData = + pdfium::MakeRetain<CXFA_LinkUserData>(wsLinkContent.c_str()); } } |