Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cjx_boolean.cpp
Go to the documentation of this file.
1
// Copyright 2017 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
include
"fxjs/xfa/cjx_boolean.h"
8
9
#
include
"fxjs/fxv8.h"
10
#
include
"fxjs/xfa/cfxjse_value.h"
11
#
include
"v8/include/v8-primitive.h"
12
#
include
"xfa/fxfa/parser/cxfa_boolean.h"
13
14
CJX_Boolean::CJX_Boolean(CXFA_Boolean* node) :
CJX_Object
(node) {}
15
16
CJX_Boolean::~
CJX_Boolean
() =
default
;
17
18
bool
CJX_Boolean::
DynamicTypeIs
(
TypeTag
eType)
const
{
19
return
eType == static_type__ || ParentType__
::
DynamicTypeIs
(eType);
20
}
21
22
void
CJX_Boolean::defaultValue(
v8
::Isolate* pIsolate,
23
v8::Local<v8::Value>* pValue,
24
bool
bSetting,
25
XFA_Attribute
eAttribute) {
26
if
(!bSetting) {
27
*pValue =
28
fxv8::NewBooleanHelper(pIsolate,
GetContent
(
true
).EqualsASCII(
"1"
));
29
return
;
30
}
31
32
ByteString
newValue;
33
if
(pValue && !(
fxv8
::
IsNull
(
*pValue
)
||
fxv8
::
IsUndefined
(
*pValue
)
))
34
newValue = fxv8::ReentrantToByteStringHelper(pIsolate, *pValue);
35
36
int32_t iValue = FXSYS_atoi(newValue.c_str());
37
WideString
wsNewValue
(
iValue == 0 ? L"0" : L"1"
)
;
38
WideString
wsFormatValue
(
wsNewValue
)
;
39
CXFA_Node
* pContainerNode =
GetXFANode
()->GetContainerNode();
40
if
(pContainerNode)
41
wsFormatValue
=
pContainerNode
->
GetFormatDataValue
(
wsNewValue
)
;
42
43
SetContent
(wsNewValue, wsFormatValue,
true
,
true
,
true
);
44
}
45
46
void
CJX_Boolean::value(
v8
::Isolate* pIsolate,
47
v8::Local<v8::Value>* pValue,
48
bool
bSetting,
49
XFA_Attribute
eAttribute) {
50
defaultValue(pIsolate, pValue, bSetting, eAttribute);
51
}
ByteString
fxcrt::ByteString ByteString
Definition
bytestring.h:180
CJX_Boolean::DynamicTypeIs
bool DynamicTypeIs(TypeTag eType) const override
Definition
cjx_boolean.cpp:18
CJX_Boolean::~CJX_Boolean
~CJX_Boolean() override
CJX_Object
Definition
cjx_object.h:46
CJX_Object::GetContent
WideString GetContent(bool bScriptModify) const
Definition
cjx_object.cpp:693
CJX_Object::TypeTag
TypeTag
Definition
cjx_object.h:49
CJX_Object::DynamicTypeIs
virtual bool DynamicTypeIs(TypeTag eType) const
Definition
cjx_object.cpp:123
CJX_Object::GetXFANode
CXFA_Node * GetXFANode() const
Definition
cjx_object.cpp:136
CJX_Object::SetContent
void SetContent(const WideString &wsContent, const WideString &wsXMLValue, bool bNotify, bool bScriptModify, bool bSyncData)
Definition
cjx_object.cpp:532
CXFA_Node
Definition
cxfa_node.h:94
CXFA_Node::GetFormatDataValue
WideString GetFormatDataValue(const WideString &wsValue)
Definition
cxfa_node.cpp:4898
fxcrt::WideString::operator=
WideString & operator=(WideString &&that) noexcept
Definition
widestring.cpp:472
fxcrt::WideString::WideString
WideString(const WideString &other)=default
fxcrt::WideString::WideString
WideString(const wchar_t *ptr)
Definition
widestring.cpp:407
XFA_Attribute
XFA_Attribute
Definition
fxfa_basic.h:67
fxv8
Definition
fxv8.h:22
fxv8::IsUndefined
bool IsUndefined(v8::Local< v8::Value > value)
Definition
fxv8.cpp:20
fxv8::IsNull
bool IsNull(v8::Local< v8::Value > value)
Definition
fxv8.cpp:24
v8
Definition
fxv8_unittest.h:15
WideString
fxcrt::WideString WideString
Definition
widestring.h:207
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fxjs
xfa
cjx_boolean.cpp
Generated on
for Qt by
1.18.0