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 "../../include/fpdfdoc/fpdf_doc.h" |
8 CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc
) | 8 CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc
) |
9 { | 9 { |
10 } | 10 } |
11 CPDF_ViewerPreferences::~CPDF_ViewerPreferences() | 11 CPDF_ViewerPreferences::~CPDF_ViewerPreferences() |
12 { | 12 { |
13 } | 13 } |
14 FX_BOOL CPDF_ViewerPreferences::IsDirectionR2L() const | 14 bool CPDF_ViewerPreferences::IsDirectionR2L() const |
15 { | 15 { |
16 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); | 16 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); |
17 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); | 17 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
18 if (!pDict) { | 18 if (!pDict) { |
19 return FALSE; | 19 return false; |
20 } | 20 } |
21 return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction")); | 21 return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction")); |
22 } | 22 } |
23 FX_BOOL CPDF_ViewerPreferences::PrintScaling() const | 23 bool CPDF_ViewerPreferences::PrintScaling() const |
24 { | 24 { |
25 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); | 25 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); |
26 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); | 26 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
27 if (!pDict) { | 27 if (!pDict) { |
28 return TRUE; | 28 return true; |
29 } | 29 } |
30 return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling")); | 30 return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling")); |
31 } | 31 } |
32 int32_t CPDF_ViewerPreferences::NumCopies() const | 32 int32_t CPDF_ViewerPreferences::NumCopies() const |
33 { | 33 { |
34 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); | 34 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); |
35 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); | 35 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
36 if (!pDict) { | 36 if (!pDict) { |
37 return 1; | 37 return 1; |
38 } | 38 } |
(...skipping 12 matching lines...) Expand all Loading... |
51 } | 51 } |
52 CFX_ByteString CPDF_ViewerPreferences::Duplex() const | 52 CFX_ByteString CPDF_ViewerPreferences::Duplex() const |
53 { | 53 { |
54 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); | 54 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); |
55 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); | 55 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
56 if (!pDict) { | 56 if (!pDict) { |
57 return FX_BSTRC("None"); | 57 return FX_BSTRC("None"); |
58 } | 58 } |
59 return pDict->GetString(FX_BSTRC("Duplex")); | 59 return pDict->GetString(FX_BSTRC("Duplex")); |
60 } | 60 } |
OLD | NEW |