Skip to content

Commit

Permalink
Use low-level function for name objects "Bl" and "Fo"
Browse files Browse the repository at this point in the history
MuPDF does not yet have predefined name objects for "Bl" and "Fo", so we need to make them on the fly.
  • Loading branch information
JorjMcKie committed Aug 4, 2023
1 parent 318f773 commit 3781cd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fitz/helper-fields.i
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ void JM_get_widget_properties(fz_context *ctx, pdf_annot *annot, PyObject *Widge
JM_get_script(ctx, pdf_dict_getl(ctx, annot_obj, PDF_NAME(AA), pdf_new_name(ctx, "Bl"), NULL)));

SETATTR_DROP(Widget, "script_focus",
JM_get_script(ctx, pdf_dict_getl(ctx, annot_obj, PDF_NAME(AA), PDF_NAME(Fo), NULL)));
JM_get_script(ctx, pdf_dict_getl(ctx, annot_obj, PDF_NAME(AA), pdf_new_name(ctx, "Fo"), NULL)));
}
fz_always(ctx) PyErr_Clear();
fz_catch(ctx) fz_rethrow(ctx);
Expand Down Expand Up @@ -801,7 +801,7 @@ void JM_set_widget_properties(fz_context *ctx, pdf_annot *annot, PyObject *Widge

// script (/AA/Fo) ------------------------------------------------------
value = GETATTR("script_focus");
JM_put_script(ctx, annot_obj, PDF_NAME(AA), PDF_NAME(Fo), value);
JM_put_script(ctx, annot_obj, PDF_NAME(AA), pdf_new_name(ctx, "Fo"), value);
Py_CLEAR(value);

// field value ------------------------------------------------------------
Expand Down

0 comments on commit 3781cd9

Please sign in to comment.