OLD | NEW |
| 1 /* |
| 2 * Copyright 2013 Google Inc. |
| 3 |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
1 #include "SkPdfStructureElementAccessDictionary_autogen.h" | 8 #include "SkPdfStructureElementAccessDictionary_autogen.h" |
2 | 9 |
3 | 10 |
4 #include "SkPdfNativeDoc.h" | 11 #include "SkPdfNativeDoc.h" |
5 int64_t SkPdfStructureElementAccessDictionary::StructParent(SkPdfNativeDoc* doc)
{ | 12 int64_t SkPdfStructureElementAccessDictionary::StructParent(SkPdfNativeDoc* doc)
{ |
6 SkPdfNativeObject* ret = get("StructParent", ""); | 13 SkPdfNativeObject* ret = get("StructParent", ""); |
7 if (doc) {ret = doc->resolveReference(ret);} | 14 if (doc) {ret = doc->resolveReference(ret);} |
8 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | 15 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
9 // TODO(edisonn): warn about missing default value for optional fields | 16 // TODO(edisonn): warn about missing default value for optional fields |
10 return 0; | 17 return 0; |
11 } | 18 } |
12 | 19 |
13 bool SkPdfStructureElementAccessDictionary::has_StructParent() const { | 20 bool SkPdfStructureElementAccessDictionary::has_StructParent() const { |
14 return get("StructParent", "") != NULL; | 21 return get("StructParent", "") != NULL; |
15 } | 22 } |
16 | 23 |
17 int64_t SkPdfStructureElementAccessDictionary::StructParents(SkPdfNativeDoc* doc
) { | 24 int64_t SkPdfStructureElementAccessDictionary::StructParents(SkPdfNativeDoc* doc
) { |
18 SkPdfNativeObject* ret = get("StructParents", ""); | 25 SkPdfNativeObject* ret = get("StructParents", ""); |
19 if (doc) {ret = doc->resolveReference(ret);} | 26 if (doc) {ret = doc->resolveReference(ret);} |
20 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); | 27 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
21 // TODO(edisonn): warn about missing default value for optional fields | 28 // TODO(edisonn): warn about missing default value for optional fields |
22 return 0; | 29 return 0; |
23 } | 30 } |
24 | 31 |
25 bool SkPdfStructureElementAccessDictionary::has_StructParents() const { | 32 bool SkPdfStructureElementAccessDictionary::has_StructParents() const { |
26 return get("StructParents", "") != NULL; | 33 return get("StructParents", "") != NULL; |
27 } | 34 } |
28 | 35 |
OLD | NEW |