summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2015-10-12 11:35:56 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2015-10-14 08:02:10 -0700
commit74dac977aedf60e1fdd0ce4165828cf24c52c1d7 (patch)
tree8b91f4bc182baf79de51fc83bcbfc304068d52f1 /platform
parenta4e5c65145e5cbf2b89fd77e93acbc208b8a43a1 (diff)
downloadmupdf-74dac977aedf60e1fdd0ce4165828cf24c52c1d7.tar.xz
Add proper support for when a combobox widget has options that are 2-element arrays
The list box and combo box can have values that are 2-element arrays. The first element is the "export" value and the second element is the value that should be shown in the list box UI. This fix ensures that we get the proper value to show in the UI. Also, it adds the option to get the export values. These are needed if you wish to update the field dictionary's V (value) entry, which is the currently selected values(s). This fix works well with gsview. The other viewers will now display the proper content in their UI, (unlike before this fix) but may need a bit more work to ensure that the proper V (value) is updated with changes in the selections. In addition, we add selection rectangles to the selected list box items.
Diffstat (limited to 'platform')
-rw-r--r--platform/android/jni/mupdf.c4
-rw-r--r--platform/ios/Classes/MuPageViewNormal.m4
-rw-r--r--platform/x11/pdfapp.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/platform/android/jni/mupdf.c b/platform/android/jni/mupdf.c
index 20026e81..72214597 100644
--- a/platform/android/jni/mupdf.c
+++ b/platform/android/jni/mupdf.c
@@ -2151,9 +2151,9 @@ JNI_FN(MuPDFCore_getFocusedWidgetChoiceOptions)(JNIEnv * env, jobject thiz)
fz_var(opts);
fz_try(ctx)
{
- nopts = pdf_choice_widget_options(ctx, idoc, focus, NULL);
+ nopts = pdf_choice_widget_options(ctx, idoc, focus, 0, NULL);
opts = fz_malloc(ctx, nopts * sizeof(*opts));
- (void)pdf_choice_widget_options(ctx, idoc, focus, opts);
+ (void)pdf_choice_widget_options(ctx, idoc, focus, 0, opts);
}
fz_catch(ctx)
{
diff --git a/platform/ios/Classes/MuPageViewNormal.m b/platform/ios/Classes/MuPageViewNormal.m
index 671702fe..429785fe 100644
--- a/platform/ios/Classes/MuPageViewNormal.m
+++ b/platform/ios/Classes/MuPageViewNormal.m
@@ -1301,9 +1301,9 @@ static void updatePixmap(fz_document *doc, fz_display_list *page_list, fz_displa
case PDF_WIDGET_TYPE_LISTBOX:
case PDF_WIDGET_TYPE_COMBOBOX:
{
- int nopts = pdf_choice_widget_options(ctx, idoc, focus, NULL);
+ int nopts = pdf_choice_widget_options(ctx, idoc, focus, 0, NULL);
opts = fz_malloc(ctx, nopts * sizeof(*opts));
- (void)pdf_choice_widget_options(ctx, idoc, focus, opts);
+ (void)pdf_choice_widget_options(ctx, idoc, focus, 0, opts);
NSMutableArray *arr = [[NSMutableArray arrayWithCapacity:nopts] retain];
for (int i = 0; i < nopts; i++)
{
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c
index 006cba1b..5a036d04 100644
--- a/platform/x11/pdfapp.c
+++ b/platform/x11/pdfapp.c
@@ -1665,9 +1665,9 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta
fz_try(ctx)
{
- nopts = pdf_choice_widget_options(ctx, idoc, widget, NULL);
+ nopts = pdf_choice_widget_options(ctx, idoc, widget, 0, NULL);
opts = fz_malloc(ctx, nopts * sizeof(*opts));
- (void)pdf_choice_widget_options(ctx, idoc, widget, opts);
+ (void)pdf_choice_widget_options(ctx, idoc, widget, 0, opts);
nvals = pdf_choice_widget_value(ctx, idoc, widget, NULL);
vals = fz_malloc(ctx, MAX(nvals,nopts) * sizeof(*vals));