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

Side by Side Diff: core/src/fxcrt/fx_basic_buffer.cpp

Issue 1477663003: Manual fixups to PDF_ENABLE_XFA in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Same as master Created 5 years 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 | « core/src/fxcrt/extension.h ('k') | core/src/fxcrt/fx_extension.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 "core/include/fxcrt/fx_basic.h" 7 #include "core/include/fxcrt/fx_basic.h"
8 8
9 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); 9 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);
10 CFX_BinaryBuf::CFX_BinaryBuf() 10 CFX_BinaryBuf::CFX_BinaryBuf()
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 AppendBlock(buf.m_pBuffer, buf.m_DataSize); 200 AppendBlock(buf.m_pBuffer, buf.m_DataSize);
201 return *this; 201 return *this;
202 } 202 }
203 void CFX_WideTextBuf::operator=(const CFX_WideStringC& str) { 203 void CFX_WideTextBuf::operator=(const CFX_WideStringC& str) {
204 CopyData(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR)); 204 CopyData(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR));
205 } 205 }
206 CFX_WideStringC CFX_WideTextBuf::GetWideString() const { 206 CFX_WideStringC CFX_WideTextBuf::GetWideString() const {
207 return CFX_WideStringC((const FX_WCHAR*)m_pBuffer, 207 return CFX_WideStringC((const FX_WCHAR*)m_pBuffer,
208 m_DataSize / sizeof(FX_WCHAR)); 208 m_DataSize / sizeof(FX_WCHAR));
209 } 209 }
210
210 #ifdef PDF_ENABLE_XFA 211 #ifdef PDF_ENABLE_XFA
211 CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(uint8_t i) { 212 CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(uint8_t i) {
212 if (m_pStream) { 213 if (m_pStream) {
213 m_pStream->WriteBlock(&i, 1); 214 m_pStream->WriteBlock(&i, 1);
214 } else { 215 } else {
215 m_SavingBuf.AppendByte(i); 216 m_SavingBuf.AppendByte(i);
216 } 217 }
217 return *this; 218 return *this;
218 } 219 }
219 CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(int i) { 220 CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(int i) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 return *this; 326 return *this;
326 } 327 }
327 FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize) { 328 FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize) {
328 if (m_LoadingPos + dwSize > m_LoadingSize) { 329 if (m_LoadingPos + dwSize > m_LoadingSize) {
329 return FALSE; 330 return FALSE;
330 } 331 }
331 FXSYS_memcpy(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize); 332 FXSYS_memcpy(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize);
332 m_LoadingPos += dwSize; 333 m_LoadingPos += dwSize;
333 return TRUE; 334 return TRUE;
334 } 335 }
335 #endif 336 #endif // PDF_ENABLE_XFA
337
336 void CFX_BitStream::Init(const uint8_t* pData, FX_DWORD dwSize) { 338 void CFX_BitStream::Init(const uint8_t* pData, FX_DWORD dwSize) {
337 m_pData = pData; 339 m_pData = pData;
338 m_BitSize = dwSize * 8; 340 m_BitSize = dwSize * 8;
339 m_BitPos = 0; 341 m_BitPos = 0;
340 } 342 }
341 void CFX_BitStream::ByteAlign() { 343 void CFX_BitStream::ByteAlign() {
342 int mod = m_BitPos % 8; 344 int mod = m_BitPos % 8;
343 if (mod == 0) { 345 if (mod == 0) {
344 return; 346 return;
345 } 347 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 452 }
451 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) { 453 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) {
452 if (!m_pFile) { 454 if (!m_pFile) {
453 return FALSE; 455 return FALSE;
454 } 456 }
455 if (!pBuf || size < 1) { 457 if (!pBuf || size < 1) {
456 return TRUE; 458 return TRUE;
457 } 459 }
458 return m_pFile->WriteBlock(pBuf, size); 460 return m_pFile->WriteBlock(pBuf, size);
459 } 461 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/extension.h ('k') | core/src/fxcrt/fx_extension.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698