diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-03 16:23:03 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-03 21:50:51 +0000 |
commit | 8afa22d5701a6c47b3f34267a2c52948efc3d301 (patch) | |
tree | eaa6e06fe2abb5c7cf09c3bd01e1ab89b5909b1f /xfa/fxfa/parser/cxfa_image.cpp | |
parent | 4f88617ad2a4d352af87b95c2f7293d12e7bd2c8 (diff) | |
download | pdfium-8afa22d5701a6c47b3f34267a2c52948efc3d301.tar.xz |
Fold CXFA_ImageData into CXFA_Image
This CL folds the CXFA_ImageData wrapper into CXFA_Image.
Change-Id: I36596abc4dff7d17dc6ee13a857a084f41164c7a
Reviewed-on: https://pdfium-review.googlesource.com/22190
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_image.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_image.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_image.cpp b/xfa/fxfa/parser/cxfa_image.cpp index 928738109e..88ca977bb2 100644 --- a/xfa/fxfa/parser/cxfa_image.cpp +++ b/xfa/fxfa/parser/cxfa_image.cpp @@ -39,3 +39,37 @@ CXFA_Image::CXFA_Image(CXFA_Document* doc, XFA_PacketType packet) kName) {} CXFA_Image::~CXFA_Image() {} + +XFA_AttributeEnum CXFA_Image::GetAspect() { + return JSObject()->GetEnum(XFA_Attribute::Aspect); +} + +WideString CXFA_Image::GetContentType() { + return JSObject()->TryCData(XFA_Attribute::ContentType, true).value_or(L""); +} + +WideString CXFA_Image::GetHref() { + return JSObject()->TryCData(XFA_Attribute::Href, true).value_or(L""); +} + +XFA_AttributeEnum CXFA_Image::GetTransferEncoding() { + return static_cast<XFA_AttributeEnum>( + JSObject()->GetEnum(XFA_Attribute::TransferEncoding)); +} + +WideString CXFA_Image::GetContent() { + return JSObject()->TryContent(false, true).value_or(L""); +} + +void CXFA_Image::SetContentType(const WideString& wsContentType) { + JSObject()->SetCData(XFA_Attribute::ContentType, wsContentType, false, false); +} + +void CXFA_Image::SetHref(const WideString& wsHref) { + JSObject()->SetCData(XFA_Attribute::Href, wsHref, false, false); +} + +void CXFA_Image::SetTransferEncoding(XFA_AttributeEnum iTransferEncoding) { + JSObject()->SetEnum(XFA_Attribute::TransferEncoding, iTransferEncoding, + false); +} |