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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 static const FX_CHAR* const g_sHighlightingMode[] = { | 184 static const FX_CHAR* const g_sHighlightingMode[] = { |
185 // Must match order of HiglightingMode enum. | 185 // Must match order of HiglightingMode enum. |
186 "N", "I", "O", "P", "T", nullptr}; | 186 "N", "I", "O", "P", "T", nullptr}; |
187 CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode() { | 187 CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode() { |
188 if (!m_pWidgetDict) { | 188 if (!m_pWidgetDict) { |
189 return Invert; | 189 return Invert; |
190 } | 190 } |
191 CFX_ByteString csH = m_pWidgetDict->GetStringBy("H", "I"); | 191 CFX_ByteString csH = m_pWidgetDict->GetStringBy("H", "I"); |
192 for (int i = 0; g_sHighlightingMode[i]; ++i) { | 192 for (int i = 0; g_sHighlightingMode[i]; ++i) { |
193 if (csH.Equal(g_sHighlightingMode[i])) | 193 if (csH == g_sHighlightingMode[i]) |
194 return static_cast<HighlightingMode>(i); | 194 return static_cast<HighlightingMode>(i); |
195 } | 195 } |
196 return Invert; | 196 return Invert; |
197 } | 197 } |
198 | 198 |
199 CPDF_ApSettings CPDF_FormControl::GetMK() const { | 199 CPDF_ApSettings CPDF_FormControl::GetMK() const { |
200 return CPDF_ApSettings(m_pWidgetDict ? m_pWidgetDict->GetDictBy("MK") | 200 return CPDF_ApSettings(m_pWidgetDict ? m_pWidgetDict->GetDictBy("MK") |
201 : nullptr); | 201 : nullptr); |
202 } | 202 } |
203 | 203 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 } | 426 } |
427 | 427 |
428 CPDF_IconFit CPDF_ApSettings::GetIconFit() const { | 428 CPDF_IconFit CPDF_ApSettings::GetIconFit() const { |
429 return CPDF_IconFit(m_pDict ? m_pDict->GetDictBy("IF") : nullptr); | 429 return CPDF_IconFit(m_pDict ? m_pDict->GetDictBy("IF") : nullptr); |
430 } | 430 } |
431 | 431 |
432 int CPDF_ApSettings::GetTextPosition() const { | 432 int CPDF_ApSettings::GetTextPosition() const { |
433 return m_pDict ? m_pDict->GetIntegerBy("TP", TEXTPOS_CAPTION) | 433 return m_pDict ? m_pDict->GetIntegerBy("TP", TEXTPOS_CAPTION) |
434 : TEXTPOS_CAPTION; | 434 : TEXTPOS_CAPTION; |
435 } | 435 } |
OLD | NEW |