Unable to purge pattern if there are 'clones' involved
Summary:
I created a pattern in a document, and I'm unable to purge it, even when I have enabled the "Remove unused swatches when doing a document cleanup" option in the Preferences. I've tested this as far back as 1.0.2-2, and the issue still happens, so, not a recent regression.
I've attached a super simple document to prove this issue. All it has is the pattern I created in it. I striped everything else from the file to make it as minimal as possible.
The issue is due to there being clones inside of the group pattern. There's 1 path, and 3 clones of the original path as part of the group pattern. There should be a way for Inkscape to check the clones to see if they are children of any path in the defs, and if so, allow to be purged with the original path in the defs.
This was all tested with fresh profiles on each version of Inkscape listed below.
Steps to reproduce:
- Open attached file. pattern_issue.svg
- Enable "Remove unused swatches when doing a document cleanup" option in Preferences (Behavior > Cleanup).
- File -> Clean up document
What happened?
The pattern isn't purged from the document, as Inkscape claims there's "No unused definitions in 'defs'", even though, there's 0 items in the document that could be even be remotely using the pattern.
What should have happened?
The pattern is purged from the document.
Sample attachments:
Version info
Inkscape 1.0.2-2 (e86c870879, 2021-01-15) x64
Inkscape 1.1.2 (b8e25be833, 2022-02-05) x64
Inkscape 1.3 (0e150ed6c4, 2023-07-21) x64
Windows x64