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_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
8 void CPDF_Object::Release() | 8 void CPDF_Object::Release() |
9 { | 9 { |
10 if (m_ObjNum) { | 10 if (m_ObjNum) { |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 return PDF_DecodeText(((CPDF_Name*)this)->m_Name, pCharMap); | 321 return PDF_DecodeText(((CPDF_Name*)this)->m_Name, pCharMap); |
322 } | 322 } |
323 return CFX_WideString(); | 323 return CFX_WideString(); |
324 } | 324 } |
325 void CPDF_Object::SetUnicodeText(FX_LPCWSTR pUnicodes, int len) | 325 void CPDF_Object::SetUnicodeText(FX_LPCWSTR pUnicodes, int len) |
326 { | 326 { |
327 if (m_Type == PDFOBJ_STRING) { | 327 if (m_Type == PDFOBJ_STRING) { |
328 ((CPDF_String*)this)->m_String = PDF_EncodeText(pUnicodes, len); | 328 ((CPDF_String*)this)->m_String = PDF_EncodeText(pUnicodes, len); |
329 } else if (m_Type == PDFOBJ_STREAM) { | 329 } else if (m_Type == PDFOBJ_STREAM) { |
330 CFX_ByteString result = PDF_EncodeText(pUnicodes, len); | 330 CFX_ByteString result = PDF_EncodeText(pUnicodes, len); |
331 ((CPDF_Stream*)this)->SetData((FX_LPBYTE)(FX_LPCSTR)result, result.GetLe
ngth(), FALSE, FALSE); | 331 ((CPDF_Stream*)this)->SetData((FX_LPBYTE)result.c_str(), result.GetLengt
h(), FALSE, FALSE); |
332 } | 332 } |
333 } | 333 } |
334 CPDF_Number::CPDF_Number(int value) | 334 CPDF_Number::CPDF_Number(int value) |
335 { | 335 { |
336 m_Type = PDFOBJ_NUMBER; | 336 m_Type = PDFOBJ_NUMBER; |
337 m_bInteger = TRUE; | 337 m_bInteger = TRUE; |
338 m_Integer = value; | 338 m_Integer = value; |
339 } | 339 } |
340 CPDF_Number::CPDF_Number(FX_FLOAT value) | 340 CPDF_Number::CPDF_Number(FX_FLOAT value) |
341 { | 341 { |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 pObj->m_ObjNum = objnum; | 1286 pObj->m_ObjNum = objnum; |
1287 m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); | 1287 m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); |
1288 if (m_LastObjNum < objnum) { | 1288 if (m_LastObjNum < objnum) { |
1289 m_LastObjNum = objnum; | 1289 m_LastObjNum = objnum; |
1290 } | 1290 } |
1291 } | 1291 } |
1292 FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const | 1292 FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const |
1293 { | 1293 { |
1294 return m_LastObjNum; | 1294 return m_LastObjNum; |
1295 } | 1295 } |
OLD | NEW |