diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2015-10-21 08:57:40 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2015-10-21 08:57:40 -0400 |
commit | 8430a5d04883fac4666d0c321fc679bcaf99cb71 (patch) | |
tree | 08e0bdbd642aebab3362bd31e0abc671158aa14b /core/src/fpdfapi/fpdf_parser | |
parent | 5a5b6fb3759daf1201ffc9702f626f4b243922d0 (diff) | |
download | pdfium-8430a5d04883fac4666d0c321fc679bcaf99cb71.tar.xz |
Remove void* ctor from CPDF_Number.
This Removes the ctor that took a pointer to the data to store and copied it
into the union memory. Instead, the call sites look at the type and pass the
correct value.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1422473002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp index 2755493136..e82479104f 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp @@ -247,8 +247,9 @@ CPDF_Object* CPDF_Object::CloneInternal(FX_BOOL bDirect, case PDFOBJ_BOOLEAN: return new CPDF_Boolean(this->AsBoolean()->m_bValue); case PDFOBJ_NUMBER: - return new CPDF_Number(((CPDF_Number*)this)->m_bInteger, - &((CPDF_Number*)this)->m_Integer); + if (((CPDF_Number*)this)->m_bInteger) + return new CPDF_Number(((CPDF_Number*)this)->m_Integer); + return new CPDF_Number(((CPDF_Number*)this)->m_Float); case PDFOBJ_STRING: return new CPDF_String(((CPDF_String*)this)->m_String, ((CPDF_String*)this)->IsHex()); @@ -359,11 +360,6 @@ CPDF_Number::CPDF_Number(int value) CPDF_Number::CPDF_Number(FX_FLOAT value) : CPDF_Object(PDFOBJ_NUMBER), m_bInteger(FALSE), m_Float(value) {} -CPDF_Number::CPDF_Number(FX_BOOL bInteger, void* pData) - : CPDF_Object(PDFOBJ_NUMBER), - m_bInteger(bInteger), - m_Integer(*(int*)pData) {} - CPDF_Number::CPDF_Number(const CFX_ByteStringC& str) : CPDF_Object(PDFOBJ_NUMBER) { FX_atonum(str, m_bInteger, &m_Integer); |