Difference: ChangeDetection (1 vs. 2)

Revision 22019-12-06 - RobinWatts

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Detecting Changes between Incremental Saves

Line: 6 to 6
 

Proposal

Changed:
<
<
  • Update xref table with a 'change' bitfield per object.
  • Have an internal function to set all xref change values 0.
>
>
All changes in the document will take place within objects. Fields can change various different ways within an object. Therefore, we need to compare "parts" of old and new objects to see if they have changed legally or illegally. We only need to keep records at the object level though; i.e. it's enough to know "this object has changed in an illegal way" or "a legal way".

  • Hold a 'change' bitfield per object (either as part of the xref or separately).
  • Have an internal function to set all the change values 0.
 
  • Have an internal function to OR a change value into a bit.
  • We can 'easily' find all objects that change between 2 xref versions and set bit 1 for those.
Deleted:
<
<
  • Write code to compare Object Trees and Number Trees. Recursively walk the document to find such trees. If different, compare old/new. If they point to different object numbers, set bit 2. This will cause us to detect cases where pages change object number as being different. I don't think that is a bad thing.
  • Walk the fields. Any fields that are changed illegally, set bit 3. Any fields that are changed legally set bit 4.
 
Changed:
<
<
Thus any field with only bit 1 set, is a problem. Any field with bit 1, and 2 set is a problem. Anything else is fine.
>
>
So, we now have all the objects changed. Now we just need to figure out which ones are OK, and which aren't.

  • Write code to compare Name Trees and Number Trees. Recursively walk the document to find such trees. If different, compare old/new. If they point to the same object numbers, set bit 2. This makes us cope with pagetrees etc being rewritten into (for example) balanced tree form, without the actual leaves changing. This will cause us to detect cases where pages change object number as being different. I don't think that is a bad thing.
  • For each field in the file, walk the field contents in a similar way to Paul's change-analysis branch. Any fields that are changed illegally, set bit 3. Any fields that are changed legally set bit 4.

Thus any field with only bit 1 set, is a problem. Any field with bit 1 and bit 3 set is an illegal field change. Anything else is fine.

 

-- Robin Watts - 2019-12-06

Revision 12019-12-06 - RobinWatts

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"

Detecting Changes between Incremental Saves

This is required so we can verify that the changes between different signings conform to the permissions.

Proposal

  • Update xref table with a 'change' bitfield per object.
  • Have an internal function to set all xref change values 0.
  • Have an internal function to OR a change value into a bit.
  • We can 'easily' find all objects that change between 2 xref versions and set bit 1 for those.
  • Write code to compare Object Trees and Number Trees. Recursively walk the document to find such trees. If different, compare old/new. If they point to different object numbers, set bit 2. This will cause us to detect cases where pages change object number as being different. I don't think that is a bad thing.
  • Walk the fields. Any fields that are changed illegally, set bit 3. Any fields that are changed legally set bit 4.

Thus any field with only bit 1 set, is a problem. Any field with bit 1, and 2 set is a problem. Anything else is fine.

-- Robin Watts - 2019-12-06

Comments


<--/commentPlugin-->
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2014 Artifex Software Inc