b74bdf0249
git-svn-id: http://skia.googlecode.com/svn/trunk@10842 2bbb7eff-a529-9590-31e7-b0007b416f81
36 lines
1.5 KiB
C++
36 lines
1.5 KiB
C++
#include "SkPdfInlineLevelStructureElementsDictionary_autogen.h"
|
|
|
|
|
|
#include "SkPdfNativeDoc.h"
|
|
bool SkPdfInlineLevelStructureElementsDictionary::isLineHeightANumber(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("LineHeight", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
return ret != NULL && ret->isNumber();
|
|
}
|
|
|
|
double SkPdfInlineLevelStructureElementsDictionary::getLineHeightAsNumber(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("LineHeight", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->numberValue();
|
|
// TODO(edisonn): warn about missing default value for optional fields
|
|
return 0;
|
|
}
|
|
|
|
bool SkPdfInlineLevelStructureElementsDictionary::isLineHeightAName(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("LineHeight", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
return ret != NULL && ret->isName();
|
|
}
|
|
|
|
SkString SkPdfInlineLevelStructureElementsDictionary::getLineHeightAsName(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("LineHeight", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->nameValue2();
|
|
// TODO(edisonn): warn about missing default value for optional fields
|
|
return SkString();
|
|
}
|
|
|
|
bool SkPdfInlineLevelStructureElementsDictionary::has_LineHeight() const {
|
|
return get("LineHeight", "") != NULL;
|
|
}
|