Chromium Code Reviews| 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 "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 8 #include "core/fpdfdoc/include/fpdf_doc.h" | 8 #include "core/fpdfdoc/include/fpdf_doc.h" |
| 9 | 9 |
| 10 CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document* pDoc) | 10 CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document* pDoc) |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 int32_t CPDF_ViewerPreferences::NumCopies() const { | 29 int32_t CPDF_ViewerPreferences::NumCopies() const { |
| 30 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); | 30 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); |
| 31 pDict = pDict->GetDictBy("ViewerPreferences"); | 31 pDict = pDict->GetDictBy("ViewerPreferences"); |
| 32 if (!pDict) { | 32 if (!pDict) { |
| 33 return 1; | 33 return 1; |
| 34 } | 34 } |
| 35 return pDict->GetIntegerBy("NumCopies"); | 35 return pDict->GetIntegerBy("NumCopies"); |
| 36 } | 36 } |
| 37 CPDF_Array* CPDF_ViewerPreferences::PrintPageRange() const { | 37 CPDF_Array* CPDF_ViewerPreferences::PrintPageRange() const { |
| 38 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); | 38 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); |
| 39 CPDF_Array* pRange = NULL; | 39 CPDF_Array* pRange = nullptr; |
|
Tom Sepez
2016/06/02 20:09:48
nit: local not needed.
Lei Zhang
2016/06/07 07:33:23
Done.
| |
| 40 pDict = pDict->GetDictBy("ViewerPreferences"); | 40 pDict = pDict->GetDictBy("ViewerPreferences"); |
| 41 if (!pDict) { | 41 if (!pDict) { |
| 42 return pRange; | 42 return pRange; |
| 43 } | 43 } |
| 44 pRange = pDict->GetArrayBy("PrintPageRange"); | 44 pRange = pDict->GetArrayBy("PrintPageRange"); |
| 45 return pRange; | 45 return pRange; |
| 46 } | 46 } |
| 47 CFX_ByteString CPDF_ViewerPreferences::Duplex() const { | 47 CFX_ByteString CPDF_ViewerPreferences::Duplex() const { |
| 48 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); | 48 CPDF_Dictionary* pDict = m_pDoc->GetRoot(); |
| 49 pDict = pDict->GetDictBy("ViewerPreferences"); | 49 pDict = pDict->GetDictBy("ViewerPreferences"); |
| 50 if (!pDict) { | 50 if (!pDict) { |
| 51 return "None"; | 51 return "None"; |
| 52 } | 52 } |
| 53 return pDict->GetStringBy("Duplex"); | 53 return pDict->GetStringBy("Duplex"); |
| 54 } | 54 } |
| OLD | NEW |