From 28f97ff783c16f3391384ce97b765ce4eb310ac7 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 4 Apr 2016 16:41:35 -0700 Subject: Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC. Having this happen implicitly can be dangerous because the lifetime has to be considered; we should have caught the "red bots" in https://codereview.chromium.org/1847333004/#ps60001 at compile time. Review URL: https://codereview.chromium.org/1853233002 --- xfa/fee/fde_txtedtengine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xfa/fee') diff --git a/xfa/fee/fde_txtedtengine.cpp b/xfa/fee/fde_txtedtengine.cpp index d397afd7e3..19b5b24311 100644 --- a/xfa/fee/fde_txtedtengine.cpp +++ b/xfa/fee/fde_txtedtengine.cpp @@ -391,7 +391,7 @@ int32_t CFDE_TxtEdtEngine::Insert(int32_t nStart, new CFDE_TxtEdtDoRecord_Insert(this, m_nCaret, lpBuffer, nLength); CFX_ByteString bsDoRecord; pRecord->Serialize(bsDoRecord); - m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord); + m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord.AsByteStringC()); pRecord->Release(); } GetText(m_ChangeInfo.wsPrevText, 0); @@ -454,7 +454,7 @@ int32_t CFDE_TxtEdtEngine::Delete(int32_t nStart, FX_BOOL bBackspace) { new CFDE_TxtEdtDoRecord_DeleteRange(this, nStart, m_nCaret, wsRange); CFX_ByteString bsDoRecord; pRecord->Serialize(bsDoRecord); - m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord); + m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord.AsByteStringC()); pRecord->Release(); } m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete; @@ -944,7 +944,7 @@ void CFDE_TxtEdtEngine::DeleteRange_DoRecord(int32_t nStart, this, nStart, m_nCaret, wsRange, bSel); CFX_ByteString bsDoRecord; pRecord->Serialize(bsDoRecord); - m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord); + m_Param.pEventSink->On_AddDoRecord(this, bsDoRecord.AsByteStringC()); pRecord->Release(); } m_ChangeInfo.nChangeType = FDE_TXTEDT_TEXTCHANGE_TYPE_Delete; -- cgit v1.2.3