Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Okular
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joao Oliveira
Okular
Commits
da013338
Commit
da013338
authored
Jul 19, 2019
by
Joao Oliveira
Committed by
Albert Astals Cid
Jul 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the KJSPrototype pointers and deleted unused arguments.
parent
ad858267
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
16 deletions
+20
-16
core/script/kjs_app.cpp
core/script/kjs_app.cpp
+5
-5
core/script/kjs_display.cpp
core/script/kjs_display.cpp
+6
-4
core/script/kjs_document.cpp
core/script/kjs_document.cpp
+1
-1
core/script/kjs_field.cpp
core/script/kjs_field.cpp
+2
-2
core/script/kjs_ocg.cpp
core/script/kjs_ocg.cpp
+6
-4
No files found.
core/script/kjs_app.cpp
View file @
da013338
...
...
@@ -220,11 +220,11 @@ static KJSObject appSetInterval( KJSContext *ctx, void *object,
}
// app.clearInterval()
static
KJSObject
appClearInterval
(
KJSContext
*
ctx
,
void
*
object
,
static
KJSObject
appClearInterval
(
KJSContext
*
ctx
,
void
*
,
const
KJSArguments
&
arguments
)
{
KJSObject
timerObject
=
arguments
.
at
(
0
);
const
int
timerId
=
timerObject
.
property
(
ctx
,
QStringLiteral
(
"timerID"
).
toLatin1
().
toBase64
(
)
).
toInt32
(
ctx
);
const
int
timerId
=
timerObject
.
property
(
ctx
,
QStringLiteral
(
"okular_timerID"
)
).
toInt32
(
ctx
);
QTimer
*
timer
=
g_timerCache
->
value
(
timerId
);
if
(
timer
!=
nullptr
)
{
...
...
@@ -255,11 +255,11 @@ static KJSObject appSetTimeOut( KJSContext *ctx, void *object,
}
// app.clearTimeOut()
static
KJSObject
appClearTimeOut
(
KJSContext
*
ctx
,
void
*
object
,
static
KJSObject
appClearTimeOut
(
KJSContext
*
ctx
,
void
*
,
const
KJSArguments
&
arguments
)
{
KJSObject
timerObject
=
arguments
.
at
(
0
);
const
int
timerId
=
timerObject
.
property
(
ctx
,
QStringLiteral
(
"timerID"
).
toLatin1
().
toBase64
(
)
).
toInt32
(
ctx
);
const
int
timerId
=
timerObject
.
property
(
ctx
,
QStringLiteral
(
"okular_timerID"
)
).
toInt32
(
ctx
);
QTimer
*
timer
=
g_timerCache
->
value
(
timerId
);
if
(
timer
!=
nullptr
)
...
...
@@ -311,7 +311,7 @@ KJSObject JSApp::object( KJSContext *ctx, DocumentPrivate *doc )
KJSObject
JSApp
::
wrapTimer
(
KJSContext
*
ctx
,
QTimer
*
timer
)
{
KJSObject
timerObject
=
g_appProto
->
constructObject
(
ctx
,
timer
);
timerObject
.
setProperty
(
ctx
,
QStringLiteral
(
"
timerID"
).
toLatin1
().
toBase64
(
),
timer
->
timerId
()
);
timerObject
.
setProperty
(
ctx
,
QStringLiteral
(
"
okular_timerID"
),
timer
->
timerId
()
);
g_timerCache
->
insert
(
timer
->
timerId
(),
timer
);
...
...
core/script/kjs_display.cpp
View file @
da013338
...
...
@@ -19,7 +19,7 @@
using
namespace
Okular
;
st
d
::
unique_ptr
<
KJSPrototype
>
g_displayProto
;
st
atic
KJSPrototype
*
g_displayProto
;
// display.hidden
static
KJSObject
displayGetHidden
(
KJSContext
*
,
void
*
)
...
...
@@ -46,11 +46,13 @@ static KJSObject displayGetNoPrint( KJSContext *, void * )
}
void
JSDisplay
::
initType
(
KJSContext
*
ctx
)
{
if
(
g_displayProto
)
{
static
bool
initialized
=
false
;
if
(
initialized
)
return
;
initialized
=
true
;
g_displayProto
.
reset
(
new
KJSPrototype
);
g_displayProto
=
new
KJSPrototype
(
);
g_displayProto
->
defineProperty
(
ctx
,
QStringLiteral
(
"hidden"
),
displayGetHidden
);
g_displayProto
->
defineProperty
(
ctx
,
QStringLiteral
(
"visible"
),
displayGetVisible
);
...
...
core/script/kjs_document.cpp
View file @
da013338
...
...
@@ -290,7 +290,7 @@ static KJSObject docGetNthFieldName( KJSContext *ctx, void *object,
}
static
KJSObject
docGetOCGs
(
KJSContext
*
ctx
,
void
*
object
,
const
KJSArguments
&
arguments
)
const
KJSArguments
&
)
{
const
DocumentPrivate
*
doc
=
reinterpret_cast
<
DocumentPrivate
*
>
(
object
);
...
...
core/script/kjs_field.cpp
View file @
da013338
...
...
@@ -273,7 +273,7 @@ static KJSObject fieldButtonGetIcon( KJSContext *ctx, void *object,
FormField
*
field
=
reinterpret_cast
<
FormField
*
>
(
object
);
KJSObject
fieldObject
;
fieldObject
.
setProperty
(
ctx
,
QStringLiteral
(
"
name"
).
toLatin1
().
toBase64
(
),
field
->
name
()
);
fieldObject
.
setProperty
(
ctx
,
QStringLiteral
(
"
okular_name"
),
field
->
name
()
);
g_buttonCache
->
insert
(
field
->
name
(),
field
);
return
fieldObject
;
...
...
@@ -287,7 +287,7 @@ static KJSObject fieldButtonSetIcon( KJSContext *ctx, void *object,
{
FormField
*
field
=
reinterpret_cast
<
FormField
*
>
(
object
);
const
QString
fieldName
=
arguments
.
at
(
0
).
property
(
ctx
,
QStringLiteral
(
"
name"
).
toLatin1
().
toBase64
(
)
).
toString
(
ctx
);
const
QString
fieldName
=
arguments
.
at
(
0
).
property
(
ctx
,
QStringLiteral
(
"
okular_name"
)
).
toString
(
ctx
);
if
(
field
->
type
()
==
Okular
::
FormField
::
FormButton
)
{
...
...
core/script/kjs_ocg.cpp
View file @
da013338
...
...
@@ -22,7 +22,7 @@
using
namespace
Okular
;
st
d
::
unique_ptr
<
KJSPrototype
>
g_OCGProto
;
st
atic
KJSPrototype
*
g_OCGProto
;
typedef
QHash
<
QPair
<
int
,
int
>
*
,
QAbstractItemModel
*
>
OCGCache
;
Q_GLOBAL_STATIC
(
OCGCache
,
g_OCGCache
)
...
...
@@ -56,11 +56,13 @@ static void OCGSetState( KJSContext* ctx, void* object,
void
JSOCG
::
initType
(
KJSContext
*
ctx
)
{
if
(
g_OCGProto
)
{
static
bool
initialized
=
false
;
if
(
initialized
)
return
;
initialized
=
true
;
g_OCGProto
.
reset
(
new
KJSPrototype
);
g_OCGProto
=
new
KJSPrototype
(
);
g_OCGProto
->
defineProperty
(
ctx
,
QStringLiteral
(
"state"
),
OCGGetState
,
OCGSetState
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment