Fix leaks in the Export dialog
This MR plugs some memory leaks in the Export Dialog reported to me by @nathanal. The memory management in the dialog and associated classes is refactored and redesigned.
Owning pointers are replaced by std::unique_ptr, so BatchItems no longer leak.
Additionally, some small fixes and refactors are made:
- class
ExportPreviewis shrunk by 24 bytes of padding; - declaration of the
BatchItemclass is moved to the corresponding header file; - unused function arguments are removed;
- code is reformatted in a few places to better follow the recommended style.