Hi,
I've looked into the cause of pattern spam with text (adjusting a pattern fill inside text creates lots of new pattern entities, each transforming the previous one). I've found a problem that I don't know how to fix. Here is a "trace" of what is happening:
When a pattern is adjusted:
PatternKnotHolderEntityScale::knot_set() calls sp_item_adjust_pattern() which calls sp_pattern_clone_if_necessary()
This routine looks at the hrefcount for the pattern. If it is greater than 1 then a new pattern is created. For shapes hrefcount is always 1 but for text it is 3.
One problem I found here is that if a new pattern is needed, sp_repr_css_change_recursive() is called. This adds an unnecessary style attribute to tspans. Bingo, I thought. But changing this to sp_repr_css_change() didn't fix the problem. The hrefcount still ends up at 3.
Sometime after returning from PatternKnotHolderEntityScale..., sp_object_href() is called 3 times, setting the hrefcount to 4 (2 in the case of a shape). Somehow this gets reduced by 1 before the next time sp_pattern_clone_if_necessary() is called leaving the hrefcount at 3 (1 in the case of a shape). Can anybody give me a clue as to what is happening? Thanks.
Tav