Bug 705620: Start journal operation instead of pushing local xref.
authorSebastian Rasmussen <[email protected]>
Wed, 29 Jun 2022 01:53:56 +0000 (03:53 +0200)
committerSebastian Rasmussen <[email protected]>
Thu, 30 Jun 2022 10:37:27 +0000 (12:37 +0200)
Previously two API functions accidentally mixed up pushing a local xref
(necessary when accessing annotation properties) with starting journal
operations (necessary when changing/setting annotation properties).

This meant that e.g. when clearing an annotation inklist the underlying
object was never actually modified, only the transient one in the local
xref.

source/pdf/pdf-annot.c

index fa1b8c0662b71666d16263ac89f09f9bbf518bea..e9ab1233edb3ac0a61c7576fb50caabb09956de0 100644 (file)
@@ -1900,7 +1900,7 @@ pdf_set_annot_vertices(fz_context *ctx, pdf_annot *annot, int n, const fz_point
 
 void pdf_clear_annot_vertices(fz_context *ctx, pdf_annot *annot)
 {
-       pdf_annot_push_local_xref(ctx, annot);
+       begin_annot_op(ctx, annot, "Clear vertices");
 
        fz_try(ctx)
        {
@@ -1908,7 +1908,7 @@ void pdf_clear_annot_vertices(fz_context *ctx, pdf_annot *annot)
                pdf_dict_del(ctx, annot->obj, PDF_NAME(Vertices));
        }
        fz_always(ctx)
-               pdf_annot_pop_local_xref(ctx, annot);
+               end_annot_op(ctx, annot);
        fz_catch(ctx)
                fz_rethrow(ctx);
 
@@ -2295,12 +2295,12 @@ pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int *coun
 void
 pdf_clear_annot_ink_list(fz_context *ctx, pdf_annot *annot)
 {
-       pdf_annot_push_local_xref(ctx, annot);
+       begin_annot_op(ctx, annot, "Clear ink list");
 
        fz_try(ctx)
                pdf_dict_del(ctx, annot->obj, PDF_NAME(InkList));
        fz_always(ctx)
-               pdf_annot_pop_local_xref(ctx, annot);
+               end_annot_op(ctx, annot);
        fz_catch(ctx)
                fz_rethrow(ctx);