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

Side by Side Diff: core/fxcodec/codec/fx_codec_png.cpp

Issue 1870043003: Remove CFX_ByteString::Load() and operator= for CFX_ByteTextBuf (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "core/fxcodec/codec/codec_int.h" 9 #include "core/fxcodec/codec/codec_int.h"
10 #include "core/fxcodec/include/fx_codec.h" 10 #include "core/fxcodec/include/fx_codec.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (!FXSYS_memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) { 75 if (!FXSYS_memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) {
76 if (!bTime) { 76 if (!bTime) {
77 FXSYS_memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime)); 77 FXSYS_memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime));
78 FXSYS_memcpy( 78 FXSYS_memcpy(
79 pAttribute->m_strTime, text[i].text, 79 pAttribute->m_strTime, text[i].text,
80 std::min(sizeof(pAttribute->m_strTime) - 1, text[i].text_length)); 80 std::min(sizeof(pAttribute->m_strTime) - 1, text[i].text_length));
81 } 81 }
82 } else { 82 } else {
83 buf = "Author"; 83 buf = "Author";
84 if (!FXSYS_memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) { 84 if (!FXSYS_memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) {
85 pAttribute->m_strAuthor.Empty(); 85 pAttribute->m_strAuthor =
86 pAttribute->m_strAuthor.Load((uint8_t*)text[i].text, 86 CFX_ByteString(reinterpret_cast<uint8_t*>(text[i].text),
87 (FX_STRSIZE)text[i].text_length); 87 static_cast<FX_STRSIZE>(text[i].text_length));
88 } 88 }
89 } 89 }
90 } 90 }
91 #endif 91 #endif
92 } 92 }
93 } 93 }
94 struct FXPNG_Context { 94 struct FXPNG_Context {
95 png_structp png_ptr; 95 png_structp png_ptr;
96 png_infop info_ptr; 96 png_infop info_ptr;
97 void* parent_ptr; 97 void* parent_ptr;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 if (setjmp(png_jmpbuf(p->png_ptr))) { 245 if (setjmp(png_jmpbuf(p->png_ptr))) {
246 if (pAttribute && 246 if (pAttribute &&
247 0 == FXSYS_strcmp(m_szLastError, "Read Header Callback Error")) { 247 0 == FXSYS_strcmp(m_szLastError, "Read Header Callback Error")) {
248 _png_load_bmp_attribute(p->png_ptr, p->info_ptr, pAttribute); 248 _png_load_bmp_attribute(p->png_ptr, p->info_ptr, pAttribute);
249 } 249 }
250 return FALSE; 250 return FALSE;
251 } 251 }
252 png_process_data(p->png_ptr, p->info_ptr, (uint8_t*)src_buf, src_size); 252 png_process_data(p->png_ptr, p->info_ptr, (uint8_t*)src_buf, src_size);
253 return TRUE; 253 return TRUE;
254 } 254 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.cpp ('k') | core/fxcrt/fx_basic_bstring.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698