mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-30 05:06:48 -06:00
M6: refuse an export only for a choice it could have applied
The refusal guard asked whether any item still had the layer fields, while the export walks also require a graphic whose asset is a PDF. Relinking a placed PDF to an image keeps those fields on the item (links.relink replaces the asset in place), so a stale field blocked IDML and PDF/A-2b exports that used to work. The guard, and the package report, now ask the same question the walks ask: has_applicable_pdf_layer_overrides requires the PDF asset too, so a stale choice is simply ignored and the tripwire still fires if a future construct ever puts a real choice where the walk cannot reach it. Regression: a_stale_choice_on_a_relinked_image_does_not_block_exports places a layered PDF, hides a layer, relinks that asset to a PNG and exports IDML, PDF/A-2b and plain PDF - all succeed, and the document reports the stale field while the applicable helper does not.
This commit is contained in:
@@ -437,7 +437,7 @@ fn package(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let opts = designcraft_idml::ExportOptions { embed_images: false };
|
||||
root.write(&path, &designcraft_idml::export_idml_with(&packed, &opts))?;
|
||||
files.push(path);
|
||||
if packed.has_pdf_layer_overrides() {
|
||||
if super::interchange::has_applicable_pdf_layer_overrides(&packed) {
|
||||
idml_layer_note = "\nPlaced PDF layers\nThe IDML copy links the placed PDFs, so it shows their file defaults. The DesignCraft document keeps each placement's Object Layer Options choice.\n";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user