cf2cfa174c
Review URL: https://codereview.chromium.org/23361009 git-svn-id: http://skia.googlecode.com/svn/trunk@10854 2bbb7eff-a529-9590-31e7-b0007b416f81
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
/*
|
|
* Copyright 2013 Google Inc.
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#include "SkPdfImportDataActionDictionary_autogen.h"
|
|
#include "SkPdfNativeDoc.h"
|
|
|
|
SkString SkPdfImportDataActionDictionary::S(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("S", "");
|
|
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 required field, assert for known good pdfs
|
|
return SkString();
|
|
}
|
|
|
|
bool SkPdfImportDataActionDictionary::has_S() const {
|
|
return get("S", "") != NULL;
|
|
}
|
|
|
|
SkPdfFileSpec SkPdfImportDataActionDictionary::F(SkPdfNativeDoc* doc) {
|
|
SkPdfNativeObject* ret = get("F", "");
|
|
if (doc) {ret = doc->resolveReference(ret);}
|
|
if ((ret != NULL && false) || (doc == NULL && ret != NULL && ret->isReference())) return ret->fileSpecValue();
|
|
// TODO(edisonn): warn about missing required field, assert for known good pdfs
|
|
return SkPdfFileSpec();
|
|
}
|
|
|
|
bool SkPdfImportDataActionDictionary::has_F() const {
|
|
return get("F", "") != NULL;
|
|
}
|