Hi all, Regina,
So the issue seems to be that the original proposal is quite a few years old, and that meanwhile the Writer implementation has already been extended. - the Writer implementation already supports rotation, and double-precision bounding box calculations is prepared (so can be used but is of course not adapted) - has the bounding box updates done when properties change - support for drawinglayer fill attributes - and (that's the strongest argument) has all the interactions plugged into Writer's view code It doesn't make too much sense to use an SdrObject then instead. We could 'artificially' do so, reference it from SW frames & render it.
The problems are manifold:
- The Items involved are just in different places in the models
- The Item hierarchy in SW for frames is different (there is some 'parent' fame, additionally)
- The adaption of the frame's dimensions to the rotation, it's reaction to that and e.g. text floating around *has* to be done at he SW frame anyways
- A potential SdrGrafObj would have to be rendered by Frame's Paint (artificially) and not by SW's DrawingLayer paint (has own Z-Order, heaven/hell does not fit to frames, etc...)
So I would not propose to use a SdrGrafObj/SdrObject directly. What makes sense indeed is to use the same render pipeline. This is already mainly done, the rendering of an SdrGrafObj/GraphicObject in SW is already using common code in SW and elsewhere - by using primitives. In SW currently by making a small 'excursion' to Primitives and PrimitiveRenderer when a GraphicObject has to be painted, as part of the regular 'Paint' (due to SW repaint still not being adapted to Primitive rendering). That guarantees also same output to e.g. PDF export when recording the Primitive paint as metafile actions.
That means the access to the attribution, creation of Primitives is slightly different (there are helper classes AFAIR e.g. for crop stuff), but the Primitives used are the same and get rendered uniformly.
What is missing is directly adding e.g. FrameBorder attributes to Primitives to create for that what is needed. This can be done, FrameBorder stuff is implemented as Primitives and decompositions already (and used for all three Table-Implementations we have, despite different models).
It should *not* be done in general for SdrGrafObj - that brings us in the situation that you might have a FrameStyle AND a dashed line at the same time - that might be technically solvable, but would combine the already tricky FrameStyle decompositions with doing it additionally dashed - nothing we should try to achieve from my POV. Does that combination even have a used case in reality..?
It is better and technically no problem to stick the needed Primitives together like Lego - that's what they are designed for.
Still, the actual rendering code in drawinglayer should be expanded to support Writer borders, and then be used from the Writer image implementation, too. What is then technically desirable I guess, is to continue with nominally two image *core* implementations for Writer and the rest (due to gui interactions), but consolidate the attributes (so we're supporting the same features everywhere - dashes for Writer borders, double/multi-line borders for draw/impress), use the same rendering code for fills and borders, and keep the Writer frame / SdrGrafObj as gutted façade. Which would be essentially a modified option A.
Just my 2ct, HTH!
Regards,
Armin