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 "xfa/fde/xml/fde_xml_imp.h" | 7 #include "xfa/fde/xml/fde_xml_imp.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 CFX_WideString wsValue; | 618 CFX_WideString wsValue; |
619 wsValue.Format(L"%d", iAttriValue); | 619 wsValue.Format(L"%d", iAttriValue); |
620 SetString(pwsAttriName, wsValue); | 620 SetString(pwsAttriName, wsValue); |
621 } | 621 } |
622 | 622 |
623 FX_FLOAT CFDE_XMLInstruction::GetFloat(const FX_WCHAR* pwsAttriName, | 623 FX_FLOAT CFDE_XMLInstruction::GetFloat(const FX_WCHAR* pwsAttriName, |
624 FX_FLOAT fDefValue) const { | 624 FX_FLOAT fDefValue) const { |
625 int32_t iCount = m_Attributes.GetSize(); | 625 int32_t iCount = m_Attributes.GetSize(); |
626 for (int32_t i = 0; i < iCount; i += 2) { | 626 for (int32_t i = 0; i < iCount; i += 2) { |
627 if (m_Attributes[i].Compare(pwsAttriName) == 0) { | 627 if (m_Attributes[i].Compare(pwsAttriName) == 0) { |
628 return FX_wcstof(m_Attributes[i + 1].c_str()); | 628 return FX_wcstof(m_Attributes[i + 1].c_str(), -1, nullptr); |
629 } | 629 } |
630 } | 630 } |
631 return fDefValue; | 631 return fDefValue; |
632 } | 632 } |
633 | 633 |
634 void CFDE_XMLInstruction::SetFloat(const FX_WCHAR* pwsAttriName, | 634 void CFDE_XMLInstruction::SetFloat(const FX_WCHAR* pwsAttriName, |
635 FX_FLOAT fAttriValue) { | 635 FX_FLOAT fAttriValue) { |
636 CFX_WideString wsValue; | 636 CFX_WideString wsValue; |
637 wsValue.Format(L"%f", fAttriValue); | 637 wsValue.Format(L"%f", fAttriValue); |
638 SetString(pwsAttriName, wsValue); | 638 SetString(pwsAttriName, wsValue); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 CFX_WideString wsValue; | 834 CFX_WideString wsValue; |
835 wsValue.Format(L"%d", iAttriValue); | 835 wsValue.Format(L"%d", iAttriValue); |
836 SetString(pwsAttriName, wsValue); | 836 SetString(pwsAttriName, wsValue); |
837 } | 837 } |
838 | 838 |
839 FX_FLOAT CFDE_XMLElement::GetFloat(const FX_WCHAR* pwsAttriName, | 839 FX_FLOAT CFDE_XMLElement::GetFloat(const FX_WCHAR* pwsAttriName, |
840 FX_FLOAT fDefValue) const { | 840 FX_FLOAT fDefValue) const { |
841 int32_t iCount = m_Attributes.GetSize(); | 841 int32_t iCount = m_Attributes.GetSize(); |
842 for (int32_t i = 0; i < iCount; i += 2) { | 842 for (int32_t i = 0; i < iCount; i += 2) { |
843 if (m_Attributes[i].Compare(pwsAttriName) == 0) { | 843 if (m_Attributes[i].Compare(pwsAttriName) == 0) { |
844 return FX_wcstof(m_Attributes[i + 1].c_str()); | 844 return FX_wcstof(m_Attributes[i + 1].c_str(), -1, nullptr); |
845 } | 845 } |
846 } | 846 } |
847 return fDefValue; | 847 return fDefValue; |
848 } | 848 } |
849 | 849 |
850 void CFDE_XMLElement::SetFloat(const FX_WCHAR* pwsAttriName, | 850 void CFDE_XMLElement::SetFloat(const FX_WCHAR* pwsAttriName, |
851 FX_FLOAT fAttriValue) { | 851 FX_FLOAT fAttriValue) { |
852 CFX_WideString wsValue; | 852 CFX_WideString wsValue; |
853 wsValue.Format(L"%f", fAttriValue); | 853 wsValue.Format(L"%f", fAttriValue); |
854 SetString(pwsAttriName, wsValue); | 854 SetString(pwsAttriName, wsValue); |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 m_BlockBuffer.DeleteTextChars(m_iDataLength - m_iEntityStart, FALSE); | 1904 m_BlockBuffer.DeleteTextChars(m_iDataLength - m_iEntityStart, FALSE); |
1905 m_pCurrentBlock = m_BlockBuffer.GetAvailableBlock(m_iIndexInBlock); | 1905 m_pCurrentBlock = m_BlockBuffer.GetAvailableBlock(m_iIndexInBlock); |
1906 m_iEntityStart = -1; | 1906 m_iEntityStart = -1; |
1907 } else { | 1907 } else { |
1908 if (m_iEntityStart < 0 && ch == L'&') { | 1908 if (m_iEntityStart < 0 && ch == L'&') { |
1909 m_iEntityStart = m_iDataLength - 1; | 1909 m_iEntityStart = m_iDataLength - 1; |
1910 } | 1910 } |
1911 } | 1911 } |
1912 m_pStart++; | 1912 m_pStart++; |
1913 } | 1913 } |
OLD | NEW |