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

Side by Side Diff: xfa/fee/fde_txtedtengine.cpp

Issue 1857713003: Rename GetCStr and GetPtr to match CFX_ByteString (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 8 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/fde/css/fde_cssstyleselector.cpp ('k') | xfa/fgas/crt/fgas_stream.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 #include "xfa/fee/fde_txtedtengine.h" 7 #include "xfa/fee/fde_txtedtengine.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 } 1617 }
1618 ClearSelection(); 1618 ClearSelection();
1619 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo); 1619 m_Param.pEventSink->On_TextChanged(this, m_ChangeInfo);
1620 m_Param.pEventSink->On_SelChanged(this); 1620 m_Param.pEventSink->On_SelChanged(this);
1621 SetCaretPos(nSelStart, TRUE); 1621 SetCaretPos(nSelStart, TRUE);
1622 return; 1622 return;
1623 } 1623 }
1624 } 1624 }
1625 IFDE_TxtEdtDoRecord* IFDE_TxtEdtDoRecord::Create( 1625 IFDE_TxtEdtDoRecord* IFDE_TxtEdtDoRecord::Create(
1626 const CFX_ByteStringC& bsDoRecord) { 1626 const CFX_ByteStringC& bsDoRecord) {
1627 const FX_CHAR* lpBuf = bsDoRecord.GetCStr(); 1627 const FX_CHAR* lpBuf = bsDoRecord.c_str();
1628 int32_t nType = *((int32_t*)lpBuf); 1628 int32_t nType = *((int32_t*)lpBuf);
1629 switch (nType) { 1629 switch (nType) {
1630 case FDE_TXTEDT_DORECORD_INS: 1630 case FDE_TXTEDT_DORECORD_INS:
1631 return new CFDE_TxtEdtDoRecord_Insert(bsDoRecord); 1631 return new CFDE_TxtEdtDoRecord_Insert(bsDoRecord);
1632 case FDE_TXTEDT_DORECORD_DEL: 1632 case FDE_TXTEDT_DORECORD_DEL:
1633 return new CFDE_TxtEdtDoRecord_DeleteRange(bsDoRecord); 1633 return new CFDE_TxtEdtDoRecord_DeleteRange(bsDoRecord);
1634 default: 1634 default:
1635 break; 1635 break;
1636 } 1636 }
1637 return NULL; 1637 return NULL;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 ArchiveSaver << m_nCaret; 1683 ArchiveSaver << m_nCaret;
1684 ArchiveSaver << m_wsInsert; 1684 ArchiveSaver << m_wsInsert;
1685 int32_t nLength = ArchiveSaver.GetLength(); 1685 int32_t nLength = ArchiveSaver.GetLength();
1686 const uint8_t* lpSrcBuf = ArchiveSaver.GetBuffer(); 1686 const uint8_t* lpSrcBuf = ArchiveSaver.GetBuffer();
1687 FX_CHAR* lpDstBuf = bsDoRecord.GetBuffer(nLength); 1687 FX_CHAR* lpDstBuf = bsDoRecord.GetBuffer(nLength);
1688 FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength); 1688 FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength);
1689 bsDoRecord.ReleaseBuffer(nLength); 1689 bsDoRecord.ReleaseBuffer(nLength);
1690 } 1690 }
1691 void CFDE_TxtEdtDoRecord_Insert::Deserialize( 1691 void CFDE_TxtEdtDoRecord_Insert::Deserialize(
1692 const CFX_ByteStringC& bsDoRecord) { 1692 const CFX_ByteStringC& bsDoRecord) {
1693 CFX_ArchiveLoader ArchiveLoader((const uint8_t*)bsDoRecord.GetCStr(), 1693 CFX_ArchiveLoader ArchiveLoader(
1694 bsDoRecord.GetLength()); 1694 reinterpret_cast<const uint8_t*>(bsDoRecord.c_str()),
1695 bsDoRecord.GetLength());
1695 int32_t nType = 0; 1696 int32_t nType = 0;
1696 ArchiveLoader >> nType; 1697 ArchiveLoader >> nType;
1697 FXSYS_assert(nType == FDE_TXTEDT_DORECORD_INS); 1698 FXSYS_assert(nType == FDE_TXTEDT_DORECORD_INS);
1698 int32_t nEngine = 0; 1699 int32_t nEngine = 0;
1699 ArchiveLoader >> nEngine; 1700 ArchiveLoader >> nEngine;
1700 m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; 1701 m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
1701 ArchiveLoader >> m_nCaret; 1702 ArchiveLoader >> m_nCaret;
1702 ArchiveLoader >> m_wsInsert; 1703 ArchiveLoader >> m_wsInsert;
1703 } 1704 }
1704 CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange( 1705 CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 ArchiveSaver << m_nCaret; 1760 ArchiveSaver << m_nCaret;
1760 ArchiveSaver << m_wsRange; 1761 ArchiveSaver << m_wsRange;
1761 int32_t nLength = ArchiveSaver.GetLength(); 1762 int32_t nLength = ArchiveSaver.GetLength();
1762 const uint8_t* lpSrcBuf = ArchiveSaver.GetBuffer(); 1763 const uint8_t* lpSrcBuf = ArchiveSaver.GetBuffer();
1763 FX_CHAR* lpDstBuf = bsDoRecord.GetBuffer(nLength); 1764 FX_CHAR* lpDstBuf = bsDoRecord.GetBuffer(nLength);
1764 FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength); 1765 FXSYS_memcpy(lpDstBuf, lpSrcBuf, nLength);
1765 bsDoRecord.ReleaseBuffer(nLength); 1766 bsDoRecord.ReleaseBuffer(nLength);
1766 } 1767 }
1767 void CFDE_TxtEdtDoRecord_DeleteRange::Deserialize( 1768 void CFDE_TxtEdtDoRecord_DeleteRange::Deserialize(
1768 const CFX_ByteStringC& bsDoRecord) { 1769 const CFX_ByteStringC& bsDoRecord) {
1769 CFX_ArchiveLoader ArchiveLoader((const uint8_t*)bsDoRecord.GetCStr(), 1770 CFX_ArchiveLoader ArchiveLoader(
1770 bsDoRecord.GetLength()); 1771 reinterpret_cast<const uint8_t*>(bsDoRecord.c_str()),
1772 bsDoRecord.GetLength());
1771 int32_t nType = 0; 1773 int32_t nType = 0;
1772 ArchiveLoader >> nType; 1774 ArchiveLoader >> nType;
1773 FXSYS_assert(nType == FDE_TXTEDT_DORECORD_DEL); 1775 FXSYS_assert(nType == FDE_TXTEDT_DORECORD_DEL);
1774 int32_t nEngine = 0; 1776 int32_t nEngine = 0;
1775 ArchiveLoader >> nEngine; 1777 ArchiveLoader >> nEngine;
1776 m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; 1778 m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine;
1777 int32_t iSel = 0; 1779 int32_t iSel = 0;
1778 ArchiveLoader >> iSel; 1780 ArchiveLoader >> iSel;
1779 m_bSel = !!iSel; 1781 m_bSel = !!iSel;
1780 ArchiveLoader >> m_nIndex; 1782 ArchiveLoader >> m_nIndex;
1781 ArchiveLoader >> m_nCaret; 1783 ArchiveLoader >> m_nCaret;
1782 ArchiveLoader >> m_wsRange; 1784 ArchiveLoader >> m_wsRange;
1783 } 1785 }
OLDNEW
« no previous file with comments | « xfa/fde/css/fde_cssstyleselector.cpp ('k') | xfa/fgas/crt/fgas_stream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698