Refactor export jobs
~~Closes~~ related to #4150.
~~Work in Progress.~~
EDIT:
Refactoring of the Pdf- & ImageExport.
The reason for the refactoring is described in #4150.
Does not close #4150, because #4150 mentions many export related issues which are not fixed with this PR, and the ExportJobs (BaseExportJob, CustomExportJob, PdfExportJob) have not been refactored yet (will be done in other PR to reduce this PR's size)
Below you can find an illustration of the current state of the refactoring. An illustration of the previous state can be found in #4150.
I tried to reduce code/logic duplication as much as possible by grouping shared code/logic in the abstract superclass ExportTemplate.
Furthermore, I tried to improve readability by splitting up methods.
Overall the previous behavior is kept, with one exception: When exporting multiple pages as PNG/SVG (ImageExport), the added filename identifier is now based on the exported page number with leading zeros instead of an identifier starting from 1.
Thanks for already having a look at!
I will update the code according to your comments. There's still a lot of work to be done. Once I consider it ready for review, I'll also update the PR's description with an illustration of the refactoring.
It took me a while, but now I think the PR is ready for a first review.
I didn't manage to pack everything in a concise commit history. However, I hope to give you a good idea of the refactoring with the included illustration in the PR description.
Things where especially a closer look might be needed:
- Constructors & Deconstructors
- When to lock the document (s. 36f0ac35fe15c0c0c5242545651565eb68e774cb)
Hey,
thanks for your review. I'll address your comments soon. Furthermore, I'll try to split up the classes more. I think cohesion & coupling need to be improved. ExportTemplate seems still too large and complex, and ImageExport may better be split up into PNG & SVG export classes.