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
bb6bee53
Commit
bb6bee53
authored
Aug 06, 2019
by
Joao Oliveira
Committed by
Albert Astals Cid
Aug 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for the full name of fields, which is used in the JavaScript
parent
238fa979
Pipeline
#6342
passed with stage
in 20 minutes and 54 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
5 deletions
+37
-5
core/form.h
core/form.h
+8
-0
core/script/kjs_document.cpp
core/script/kjs_document.cpp
+2
-2
core/script/kjs_field.cpp
core/script/kjs_field.cpp
+3
-3
generators/poppler/formfields.cpp
generators/poppler/formfields.cpp
+20
-0
generators/poppler/formfields.h
generators/poppler/formfields.h
+4
-0
No files found.
core/form.h
View file @
bb6bee53
...
...
@@ -86,6 +86,14 @@ class OKULARCORE_EXPORT FormField
*/
virtual
QString
uiName
()
const
=
0
;
/**
* The fully qualified name of the field, is used in the JavaScript
* scripts.
*
* @since 1.9
*/
virtual
QString
fullyQualifiedName
()
const
=
0
;
/**
* Whether the field is read-only.
*/
...
...
core/script/kjs_document.cpp
View file @
bb6bee53
...
...
@@ -211,7 +211,7 @@ static KJSObject docGetField( KJSContext *context, void *object,
QLinkedList
<
Okular
::
FormField
*
>::
const_iterator
ffIt
=
pageFields
.
constBegin
(),
ffEnd
=
pageFields
.
constEnd
();
for
(
;
ffIt
!=
ffEnd
;
++
ffIt
)
{
if
(
(
*
ffIt
)
->
n
ame
()
==
cName
)
if
(
(
*
ffIt
)
->
fullyQualifiedN
ame
()
==
cName
)
{
return
JSField
::
wrapField
(
context
,
*
ffIt
,
*
pIt
);
}
...
...
@@ -280,7 +280,7 @@ static KJSObject docGetNthFieldName( KJSContext *ctx, void *object,
{
const
auto
ffIt
=
pageFields
.
begin
()
+
numField
;
return
KJSString
(
(
*
ffIt
)
->
n
ame
()
);
return
KJSString
(
(
*
ffIt
)
->
fullyQualifiedN
ame
()
);
}
numField
-=
pageFields
.
size
();
...
...
core/script/kjs_field.cpp
View file @
bb6bee53
...
...
@@ -63,7 +63,7 @@ static KJSObject fieldGetDoc( KJSContext *context, void * )
static
KJSObject
fieldGetName
(
KJSContext
*
,
void
*
object
)
{
const
FormField
*
field
=
reinterpret_cast
<
FormField
*
>
(
object
);
return
KJSString
(
field
->
n
ame
()
);
return
KJSString
(
field
->
fullyQualifiedN
ame
()
);
}
// Field.readonly (getter)
...
...
@@ -275,8 +275,8 @@ static KJSObject fieldButtonGetIcon( KJSContext *ctx, void *object,
FormField
*
field
=
reinterpret_cast
<
FormField
*
>
(
object
);
KJSObject
fieldObject
;
fieldObject
.
setProperty
(
ctx
,
OKULAR_NAME
,
field
->
n
ame
()
);
g_buttonCache
->
insert
(
field
->
n
ame
(),
field
);
fieldObject
.
setProperty
(
ctx
,
OKULAR_NAME
,
field
->
fullyQualifiedN
ame
()
);
g_buttonCache
->
insert
(
field
->
fullyQualifiedN
ame
(),
field
);
return
fieldObject
;
}
...
...
generators/poppler/formfields.cpp
View file @
bb6bee53
...
...
@@ -77,6 +77,11 @@ QString PopplerFormFieldButton::uiName() const
return
m_field
->
uiName
();
}
QString
PopplerFormFieldButton
::
fullyQualifiedName
()
const
{
return
m_field
->
fullyQualifiedName
();
}
bool
PopplerFormFieldButton
::
isReadOnly
()
const
{
return
m_field
->
isReadOnly
();
...
...
@@ -211,6 +216,11 @@ QString PopplerFormFieldText::uiName() const
return
m_field
->
uiName
();
}
QString
PopplerFormFieldText
::
fullyQualifiedName
()
const
{
return
m_field
->
fullyQualifiedName
();
}
bool
PopplerFormFieldText
::
isReadOnly
()
const
{
return
m_field
->
isReadOnly
();
...
...
@@ -341,6 +351,11 @@ QString PopplerFormFieldChoice::uiName() const
return
m_field
->
uiName
();
}
QString
PopplerFormFieldChoice
::
fullyQualifiedName
()
const
{
return
m_field
->
fullyQualifiedName
();
}
bool
PopplerFormFieldChoice
::
isReadOnly
()
const
{
return
m_field
->
isReadOnly
();
...
...
@@ -492,6 +507,11 @@ QString PopplerFormFieldSignature::uiName() const
return
m_field
->
uiName
();
}
QString
PopplerFormFieldSignature
::
fullyQualifiedName
()
const
{
return
m_field
->
fullyQualifiedName
();
}
bool
PopplerFormFieldSignature
::
isReadOnly
()
const
{
return
m_field
->
isReadOnly
();
...
...
generators/poppler/formfields.h
View file @
bb6bee53
...
...
@@ -25,6 +25,7 @@ class PopplerFormFieldButton : public Okular::FormFieldButton
int
id
()
const
override
;
QString
name
()
const
override
;
QString
uiName
()
const
override
;
QString
fullyQualifiedName
()
const
override
;
bool
isReadOnly
()
const
override
;
void
setReadOnly
(
bool
value
)
override
;
bool
isVisible
()
const
override
;
...
...
@@ -66,6 +67,7 @@ class PopplerFormFieldText : public Okular::FormFieldText
int
id
()
const
override
;
QString
name
()
const
override
;
QString
uiName
()
const
override
;
QString
fullyQualifiedName
()
const
override
;
bool
isReadOnly
()
const
override
;
void
setReadOnly
(
bool
value
)
override
;
bool
isVisible
()
const
override
;
...
...
@@ -101,6 +103,7 @@ class PopplerFormFieldChoice : public Okular::FormFieldChoice
int
id
()
const
override
;
QString
name
()
const
override
;
QString
uiName
()
const
override
;
QString
fullyQualifiedName
()
const
override
;
bool
isReadOnly
()
const
override
;
void
setReadOnly
(
bool
value
)
override
;
bool
isVisible
()
const
override
;
...
...
@@ -138,6 +141,7 @@ class PopplerFormFieldSignature : public Okular::FormFieldSignature
int
id
()
const
override
;
QString
name
()
const
override
;
QString
uiName
()
const
override
;
QString
fullyQualifiedName
()
const
override
;
bool
isReadOnly
()
const
override
;
bool
isVisible
()
const
override
;
...
...
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