Fix Export batch dialog crash / misbehavior with multiple documents open
Fixes the issue that switching between (nonempty) documents causes the export-batch dialog to show too many objects, more and more with every switch (see inbox#11496 (comment 2281807605) for instructions). The internal state became inconsistent in one edge case that was not triggered before.
As a lucky coincidence, it also fixes a crash when closing the export dialog (not sure why):
Fixes inbox#11496 (closed)
Edited by Max Gaukler