Matus Uzak committed changes in [calligra] /:

PPTX: inheritance Kung Fu



* DEFAULTS: Only a common shape (not a placeholder) starts the inheritance

sequence from defaults defined in the presentation.xml file. That kind of

shape does not provide a reference to a placeholder or a style in the ph

element (Placeholder Shape - ECMA-376 Part 1, 19.3.1.36 ).



List Styles:

------------



* DO NOT overwrite the primary styles defined in a MasterSlide while reading

the placeholder shapes therein or in the SlideLayout. Save the corresponding

modification under the placeholder-ID. The only allowed case is a shape with

the ph element having ONLY the type attribute. That kind of a placeholder

modifies the primary style. Of course if a placeholder with a type attribute

not already in the map is found in the MasterSlide, then save it.



* When inheritance goes on, DO check if the map contains the nested map of

levels and corresponding ParagraphBulletProperties, else the constructor gets

called and you will get EMPTY ParagraphBulletProperties full of "UNUSED"

values.



* When inheritance goes on, DO NOT overwrite the already inherited

currentBulletProperties by "UNUSED" values when you find an EMPTY

ParagraphBulletProperties entry. Only valid values therein have to be

inherited. In means of ParagraphBulletProperties, EMPTY means it's not

directly related to a specific list-level-style-{number/bullet/picture}.

However it might define margin-*, text-indent, padding-*, etc.



* Do not inherit from already processed shapes on the same presentation slide.

Is there any use case for this? Also disabled that kind of inheritance for

Notes.



Placeholder Position:

---------------------



* DO NOT overwrite the primary styles defined in a MasterSlide while reading

the placeholder shapes therein or in the SlideLayout. Save the corresponding

modification under the placeholder-ID. The only allowed case is a shape with

the ph element having ONLY the type attribute. That kind of a placeholder

modifies the primary style. Of course if a placeholder with a type attribute

not already in the map is found in the MasterSlide, then save it.



* When inheritance goes on, DO check if the shapes map contains the key to the

corresponding PptxShapeProperties.



Text Styles:

----------------------



* Changed the inheritance order, first inherit by type and then by ID like at

other places. The different order was probably some workaround.



* DO NOT overwrite the primary styles defined in a MasterSlide while reading

the placeholder shapes therein or in the SlideLayout. Save the corresponding

modification under the placeholder-ID. The only allowed case is a shape with

the ph element having ONLY the type attribute. That kind of a placeholder

modifies the primary style. Of course if a placeholder with a type attribute

not already in the map is found in the MasterSlide, then save it.



* When inheritance goes on, DO check if the map contains the key to the nested

map of levels and the corresponding KoGenStyle. Also check if the nested map

contains the key to the KoGenStyle.



* Do not inherit from already processed shapes on the same presentation slide.

Is there any use case for this? Also disabled that kind of inheritance for

Notes.



* It seems that IF processing SlideLayout shapes of type="Body", THEN the

formatting of the corresponding placeholder of the MasterSlide has to be

reset first, because the SlideLayout defines a new placeholder of type="Body"

(new ID or redefines the MasterSlide placeholder with the ID).



* It seems that IF some of the properties for text chunks are not provided for

the specific type of text, THEN we should inherit from type="Other". Testing

with font-size at the moment.



TESTING:



* It seems that IF some of the properties are missing for "title" or "body"

text, THEN inherit from "other" text (instead of the defaults of course).



* Text of type "subTitle" should inherit from "body" instead of "other".

Doesn't work with "title" of course.



Paragraph Styles:

----------------------

TODO, The logic differs a bit from text styles.



NOTE: Took a lot of cstester runs. Reused a lot of the ppt filter logic.