When the folder can't be opened or `FS_IOC_GETFLAGS` fails, `casefolded`
returned false, so `imageCapture` treated names that differ only in their
normalization form as two files and could write over a source document.
It now returns false only when the flags are read and the flag is clear.
A refused rename that falls back to copying into the target no longer
creates a missing target before the final authorization check. The
target is created only after that check, on every platform, so a
refusal at the final check leaves the path absent. An existing target
is still opened with O_CREAT, so Linux's fs.protected_regular applies.
imageCapture no longer treats an empty Linux folder as ignoring the
Unicode normalization form. It reads the folder's casefold inode flag
(FS_IOC_GETFLAGS) instead, so a missing linked cafe\u{301}.png no longer
matches cafe\u{e9}.png in an ordinary folder, and a casefolded folder
still matches both spellings.
On Windows the Unix block in same_folder is compiled out, which left
`if a == b { return true; } false` and failed clippy's needless_bool
lint with -D warnings in the Windows CI run. The early return now sits
inside the Unix block and the other platforms compare the paths.
Behavior is unchanged on every platform.
textFrames.removeAll() and the removeAll() of a group's pageItems,
groupItems and compoundPathItems checked only clip groups whose mask
they release. Deleting the type or art below an image in an ordinary
group named Image Trace left the image first, so the group was read as
a tracing and the image dropped out of pageItems. Both now throw
"Only Image Trace can make a tracing" and delete nothing, checking the
whole set being deleted at once.
- object.rasterize and Document.rasterize refuse clipBounds that reach
none of the selected objects' own bounds, including a rectangle in the
gap between two of them, instead of replacing the art with a
background-only image.
- imageCapture checks its destination again on every write the export
makes and as the file is committed, so a destination that becomes a
link to an open document or a linked file while the art renders is
refused.
- imageCapture refuses a destination whose real path is not valid UTF-8
instead of writing under a name with its bytes replaced.
- A missing linked file's name in the other Unicode normalization form
counts as the linked file in folders that ignore the form (macOS, and
casefolded folders on Linux).
- The hard-link tests skip on volumes without hard links.
- docs/mcp.md: imageCapture rounds clip dimensions to the nearest pixel;
rasterize rounds fractional dimensions up.
remove(), the document's pageItems.removeAll() and textFrames.removeAll()
release the mask of a clip group whose clipping path they delete. A clip
group named Image Trace with an image next above its clipping path then
became an ordinary group named as a tracing with an image first, which
reads as a tracing. They now throw "Only Image Trace can make a tracing"
and delete nothing in that case.
docs/mcp.md names the removeAll() collections that release a mask and
the ones that refuse to delete a clipping path instead.
- object.rasterize with ids refuses objects whose nearest clip group or
clipped layer differs, before rendering: the image goes where the last
object is, so mixed sources would be clipped by another object's path.
- Document.rasterize reads the image id from the command's result inside
the run's savepoint, so an id above 2^53 binds the new RasterItem and a
missing id undoes the edit.
- Document.imageCapture refuses a destination that is another name of an
open document's file or a linked file (same device and inode, or same
volume and file index), and on Unix any file with other hard links,
which an in-place write would change under every name.
- Docs: gaps.md and target-app-parity.md list what rasterizing and
capturing still lack; mcp.md states the clipping rule, the hard-link
rule and that a later OS write failure can leave some files written.
- Layer.zOrderPosition reads the sibling list through the cached layer
lists, so reading it for every layer of a loop lists the layers once.
Each read is still charged for the search through the list.
- TextFrames.removeAll releases the mask of a group or layer whose
clipping path is one of the type objects it deletes, as
PageItems.removeAll and remove() do, so the object above the type is
not made the clipping path.
- GroupItems.createFromFile checks that its collection is still there
first, so a collection whose group was deleted throws "Stale page item"
instead of the not-available message. docs/mcp.md says so.
Assigning `clipped = true` to a GroupItem checked only that the group and
its layer were editable, so a hidden or locked topmost object lost its fill
and stroke and became the clipping path. The setter now refuses that object
before running the command, with no undo step. The setter came from #9048.
A run whose first step is an exact document.open still reads the open
documents' linked files then, so a link retargeted while the run is paused
gives a later command no read access to the new target. The open itself
still gets no linked-file access.
- A multi-file export checks every destination before writing and refuses an
existing read-only file, as save does, so no file is written.
- object.rasterize and Document.rasterize refuse an id that is hidden or in a
hidden layer or group, as they refuse locked ones.
- imageCapture compares open documents and linked files that only a write root
covers, so it no longer replaces such a document's file.
- The blank-capture test also checks the pixel count, as test-lint asks.
`PathItems.index()` with a number went straight to `items_doc`, which
refuses every compound-path-scoped `PathItems` so that creating paths
there stays unavailable. Its siblings (`[n]`, `getByName`, `length`,
`removeAll`) already dispatch scoped collections to the layer handlers
first, but `index` did not, so `compoundPathItems[0].pathItems.index(0)`
threw "creating paths in a compound path is not available yet". Route a
scoped `index` to `scoped_index` like the other lookups; the guard now
only stops real creation.