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/fpdfdoc/fpdf_doc.h" | 7 #include "core/include/fpdfdoc/fpdf_doc.h" |
| 8 |
8 CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document* pDoc) | 9 CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document* pDoc) |
9 : m_pDoc(pDoc) {} | 10 : m_pDoc(pDoc) {} |
10 CPDF_ViewerPreferences::~CPDF_ViewerPreferences() {} | 11 CPDF_ViewerPreferences::~CPDF_ViewerPreferences() {} |
11 FX_BOOL CPDF_ViewerPreferences::IsDirectionR2L() const { | 12 FX_BOOL CPDF_ViewerPreferences::IsDirectionR2L() const { |
12 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); | 13 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); |
13 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); | 14 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
14 if (!pDict) { | 15 if (!pDict) { |
15 return FALSE; | 16 return FALSE; |
16 } | 17 } |
17 return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction")); | 18 return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction")); |
(...skipping 25 matching lines...) Expand all Loading... |
43 return pRange; | 44 return pRange; |
44 } | 45 } |
45 CFX_ByteString CPDF_ViewerPreferences::Duplex() const { | 46 CFX_ByteString CPDF_ViewerPreferences::Duplex() const { |
46 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); | 47 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); |
47 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); | 48 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
48 if (!pDict) { | 49 if (!pDict) { |
49 return FX_BSTRC("None"); | 50 return FX_BSTRC("None"); |
50 } | 51 } |
51 return pDict->GetString(FX_BSTRC("Duplex")); | 52 return pDict->GetString(FX_BSTRC("Duplex")); |
52 } | 53 } |
OLD | NEW |