| OLD | NEW |
| (Empty) |
| 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 | |
| 8 #include "SkPdfInlineLevelStructureElementsDictionary_autogen.h" | |
| 9 #include "SkPdfNativeDoc.h" | |
| 10 | |
| 11 bool SkPdfInlineLevelStructureElementsDictionary::isLineHeightANumber(SkPdfNativ
eDoc* doc) { | |
| 12 SkPdfNativeObject* ret = get("LineHeight", ""); | |
| 13 if (doc) {ret = doc->resolveReference(ret);} | |
| 14 return ret != NULL && ret->isNumber(); | |
| 15 } | |
| 16 | |
| 17 double SkPdfInlineLevelStructureElementsDictionary::getLineHeightAsNumber(SkPdfN
ativeDoc* doc) { | |
| 18 SkPdfNativeObject* ret = get("LineHeight", ""); | |
| 19 if (doc) {ret = doc->resolveReference(ret);} | |
| 20 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
| 21 // TODO(edisonn): warn about missing default value for optional fields | |
| 22 return 0; | |
| 23 } | |
| 24 | |
| 25 bool SkPdfInlineLevelStructureElementsDictionary::isLineHeightAName(SkPdfNativeD
oc* doc) { | |
| 26 SkPdfNativeObject* ret = get("LineHeight", ""); | |
| 27 if (doc) {ret = doc->resolveReference(ret);} | |
| 28 return ret != NULL && ret->isName(); | |
| 29 } | |
| 30 | |
| 31 SkString SkPdfInlineLevelStructureElementsDictionary::getLineHeightAsName(SkPdfN
ativeDoc* doc) { | |
| 32 SkPdfNativeObject* ret = get("LineHeight", ""); | |
| 33 if (doc) {ret = doc->resolveReference(ret);} | |
| 34 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 35 // TODO(edisonn): warn about missing default value for optional fields | |
| 36 return SkString(); | |
| 37 } | |
| 38 | |
| 39 bool SkPdfInlineLevelStructureElementsDictionary::has_LineHeight() const { | |
| 40 return get("LineHeight", "") != NULL; | |
| 41 } | |
| OLD | NEW |