summaryrefslogtreecommitdiff
path: root/fxjs/cjx_node.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-02 17:50:58 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-02 17:50:58 +0000
commitf45406f8ec992560353756cff1e2c3931984e62b (patch)
tree1459b2277ec6e07764ccde70b1c9725f5c45fd0c /fxjs/cjx_node.h
parent565fb438dd4a426eddb10a6d35ff92ce90fa8ee1 (diff)
downloadpdfium-f45406f8ec992560353756cff1e2c3931984e62b.tar.xz
Move CJX_Node definitions to cpp file
This CL moves some method bodies from the .h to the .cpp file. This makes the .h file a lot easier to read. Change-Id: Ia6366d3b8dcfdb1b626814577fd93b027250474c Reviewed-on: https://pdfium-review.googlesource.com/17430 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cjx_node.h')
-rw-r--r--fxjs/cjx_node.h45
1 files changed, 9 insertions, 36 deletions
diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h
index abac5405a5..77c564e11b 100644
--- a/fxjs/cjx_node.h
+++ b/fxjs/cjx_node.h
@@ -86,14 +86,8 @@ class CJX_Node : public CJX_Object {
bool TryInteger(XFA_ATTRIBUTE eAttr,
int32_t& iValue,
bool bUseDefault = true);
- bool SetInteger(XFA_ATTRIBUTE eAttr, int32_t iValue, bool bNotify = false) {
- return SetValue(eAttr, XFA_ATTRIBUTETYPE_Integer, (void*)(uintptr_t)iValue,
- bNotify);
- }
- int32_t GetInteger(XFA_ATTRIBUTE eAttr) {
- int32_t iValue;
- return TryInteger(eAttr, iValue, true) ? iValue : 0;
- }
+ bool SetInteger(XFA_ATTRIBUTE eAttr, int32_t iValue, bool bNotify = false);
+ int32_t GetInteger(XFA_ATTRIBUTE eAttr);
bool TryCData(XFA_ATTRIBUTE eAttr,
WideStringView& wsValue,
@@ -107,10 +101,7 @@ class CJX_Node : public CJX_Object {
const WideString& wsValue,
bool bNotify = false,
bool bScriptModify = false);
- WideStringView GetCData(XFA_ATTRIBUTE eAttr) {
- WideStringView wsValue;
- return TryCData(eAttr, wsValue) ? wsValue : WideStringView();
- }
+ WideStringView GetCData(XFA_ATTRIBUTE eAttr);
bool TryContent(WideString& wsContent,
bool bScriptModify = false,
@@ -121,24 +112,12 @@ class CJX_Node : public CJX_Object {
bool bUseDefault = true);
bool SetEnum(XFA_ATTRIBUTE eAttr,
XFA_ATTRIBUTEENUM eValue,
- bool bNotify = false) {
- return SetValue(eAttr, XFA_ATTRIBUTETYPE_Enum, (void*)(uintptr_t)eValue,
- bNotify);
- }
- XFA_ATTRIBUTEENUM GetEnum(XFA_ATTRIBUTE eAttr) {
- XFA_ATTRIBUTEENUM eValue;
- return TryEnum(eAttr, eValue, true) ? eValue : XFA_ATTRIBUTEENUM_Unknown;
- }
+ bool bNotify = false);
+ XFA_ATTRIBUTEENUM GetEnum(XFA_ATTRIBUTE eAttr);
bool TryBoolean(XFA_ATTRIBUTE eAttr, bool& bValue, bool bUseDefault = true);
- bool SetBoolean(XFA_ATTRIBUTE eAttr, bool bValue, bool bNotify = false) {
- return SetValue(eAttr, XFA_ATTRIBUTETYPE_Boolean, (void*)(uintptr_t)bValue,
- bNotify);
- }
- bool GetBoolean(XFA_ATTRIBUTE eAttr) {
- bool bValue;
- return TryBoolean(eAttr, bValue, true) ? bValue : false;
- }
+ bool SetBoolean(XFA_ATTRIBUTE eAttr, bool bValue, bool bNotify = false);
+ bool GetBoolean(XFA_ATTRIBUTE eAttr);
bool TryMeasure(XFA_ATTRIBUTE eAttr,
CXFA_Measurement& mValue,
@@ -151,19 +130,13 @@ class CJX_Node : public CJX_Object {
bool SetUserData(void* pKey,
void* pData,
XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr);
- void* GetUserData(void* pKey, bool bProtoAlso = false) {
- void* pData;
- return TryUserData(pKey, pData, bProtoAlso) ? pData : nullptr;
- }
+ void* GetUserData(void* pKey, bool bProtoAlso = false);
bool TryObject(XFA_ATTRIBUTE eAttr, void*& pData);
bool SetObject(XFA_ATTRIBUTE eAttr,
void* pData,
XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr);
- void* GetObject(XFA_ATTRIBUTE eAttr) {
- void* pData;
- return TryObject(eAttr, pData) ? pData : nullptr;
- }
+ void* GetObject(XFA_ATTRIBUTE eAttr);
bool TryNamespace(WideString& wsNamespace);