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 #include "../../../include/fxcrt/fx_string.h" | 8 #include "../../../include/fxcrt/fx_string.h" |
9 | 9 |
10 //static | 10 //static |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 CFX_ByteString CPDF_Number::GetString() const | 368 CFX_ByteString CPDF_Number::GetString() const |
369 { | 369 { |
370 return m_bInteger ? CFX_ByteString::FormatInteger(m_Integer, FXFORMAT_SIGNED
) : CFX_ByteString::FormatFloat(m_Float); | 370 return m_bInteger ? CFX_ByteString::FormatInteger(m_Integer, FXFORMAT_SIGNED
) : CFX_ByteString::FormatFloat(m_Float); |
371 } | 371 } |
372 void CPDF_Number::SetNumber(FX_FLOAT value) | 372 void CPDF_Number::SetNumber(FX_FLOAT value) |
373 { | 373 { |
374 m_bInteger = FALSE; | 374 m_bInteger = FALSE; |
375 m_Float = value; | 375 m_Float = value; |
376 } | 376 } |
377 CPDF_String::CPDF_String(const CFX_WideString& str) : CPDF_Object(PDFOBJ_STRING)
, m_bHex(FALSE) { | 377 CPDF_String::CPDF_String(const CFX_WideString& str) : CPDF_Object(PDFOBJ_STRING)
, m_bHex(FALSE) { |
378 m_String = PDF_EncodeText(str, str.GetLength()); | 378 m_String = PDF_EncodeText(str); |
379 } | 379 } |
380 CPDF_Array::~CPDF_Array() | 380 CPDF_Array::~CPDF_Array() |
381 { | 381 { |
382 int size = m_Objects.GetSize(); | 382 int size = m_Objects.GetSize(); |
383 CPDF_Object** pList = (CPDF_Object**)m_Objects.GetData(); | 383 CPDF_Object** pList = (CPDF_Object**)m_Objects.GetData(); |
384 for (int i = 0; i < size; i ++) { | 384 for (int i = 0; i < size; i ++) { |
385 if (pList[i]) | 385 if (pList[i]) |
386 pList[i]->Release(); | 386 pList[i]->Release(); |
387 } | 387 } |
388 } | 388 } |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 pObj->m_ObjNum = objnum; | 1284 pObj->m_ObjNum = objnum; |
1285 m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); | 1285 m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); |
1286 if (m_LastObjNum < objnum) { | 1286 if (m_LastObjNum < objnum) { |
1287 m_LastObjNum = objnum; | 1287 m_LastObjNum = objnum; |
1288 } | 1288 } |
1289 } | 1289 } |
1290 FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const | 1290 FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const |
1291 { | 1291 { |
1292 return m_LastObjNum; | 1292 return m_LastObjNum; |
1293 } | 1293 } |
OLD | NEW |