OLD | NEW |
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 "../../../include/fpdfapi/fpdf_page.h" | 7 #include "../../../include/fpdfapi/fpdf_page.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fpdfapi/fpdf_serial.h" | 9 #include "../../../include/fpdfapi/fpdf_serial.h" |
10 #include "pageint.h" | 10 #include "pageint.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 if (len > 32) { | 119 if (len > 32) { |
120 m_ParamBuf1[index].m_Type = 0; | 120 m_ParamBuf1[index].m_Type = 0; |
121 m_ParamBuf1[index].m_pObject = CPDF_Name::Create(PDF_NameDecode(CFX_Byte
StringC(name, len))); | 121 m_ParamBuf1[index].m_pObject = CPDF_Name::Create(PDF_NameDecode(CFX_Byte
StringC(name, len))); |
122 } else { | 122 } else { |
123 m_ParamBuf1[index].m_Type = PDFOBJ_NAME; | 123 m_ParamBuf1[index].m_Type = PDFOBJ_NAME; |
124 if (FXSYS_memchr(name, '#', len) == NULL) { | 124 if (FXSYS_memchr(name, '#', len) == NULL) { |
125 FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, name, len); | 125 FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, name, len); |
126 m_ParamBuf1[index].m_Name.m_Len = len; | 126 m_ParamBuf1[index].m_Name.m_Len = len; |
127 } else { | 127 } else { |
128 CFX_ByteString str = PDF_NameDecode(CFX_ByteStringC(name, len)); | 128 CFX_ByteString str = PDF_NameDecode(CFX_ByteStringC(name, len)); |
129 FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, (FX_LPCSTR)str, s
tr.GetLength()); | 129 FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, str.c_str(), str.
GetLength()); |
130 m_ParamBuf1[index].m_Name.m_Len = str.GetLength(); | 130 m_ParamBuf1[index].m_Name.m_Len = str.GetLength(); |
131 } | 131 } |
132 } | 132 } |
133 } | 133 } |
134 void CPDF_StreamContentParser::AddNumberParam(FX_LPCSTR str, int len) | 134 void CPDF_StreamContentParser::AddNumberParam(FX_LPCSTR str, int len) |
135 { | 135 { |
136 int index = GetNextParamPos(); | 136 int index = GetNextParamPos(); |
137 m_ParamBuf1[index].m_Type = PDFOBJ_NUMBER; | 137 m_ParamBuf1[index].m_Type = PDFOBJ_NUMBER; |
138 FX_atonum(CFX_ByteStringC(str, len), m_ParamBuf1[index].m_Number.m_bInteger, | 138 FX_atonum(CFX_ByteStringC(str, len), m_ParamBuf1[index].m_Number.m_bInteger, |
139 &m_ParamBuf1[index].m_Number.m_Integer); | 139 &m_ParamBuf1[index].m_Number.m_Integer); |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 buf.AppendChar((char)code); | 1579 buf.AppendChar((char)code); |
1580 } | 1580 } |
1581 bFirst = !bFirst; | 1581 bFirst = !bFirst; |
1582 } | 1582 } |
1583 } | 1583 } |
1584 if (!bFirst) { | 1584 if (!bFirst) { |
1585 buf.AppendChar((char)code); | 1585 buf.AppendChar((char)code); |
1586 } | 1586 } |
1587 return buf.GetByteString(); | 1587 return buf.GetByteString(); |
1588 } | 1588 } |
OLD | NEW |