Handle OBJECT placeholder types with ObjectPlaceholder.#171
Handle OBJECT placeholder types with ObjectPlaceholder.#171brotchie wants to merge 1 commit intoscanny:masterfrom
Conversation
Added ObjectPlacholder class which acts as a union of SlidePlacholder, ChartPlaceholder, PicturePlaceholder, and TablePlaceholder.
|
Looks like some tests failed. I'll fix them up, and write some new tests for the added functionality. |
|
Say James, what did you have in mind for the ObjectPlaceholder class? I'm not immediately seeing what the intended use is. |
|
Hi Steve, The default Powerpoint template liberally uses object placeholders (as opposed to table / picture / etc placeholder). Maybe I missed the functionality of some other class, but I couldn't find an obvious means of populating an object placeholder with a picture (having heavily used the Powerpoint COM interface, this is a common usage pattern). By default python-pptx assigns an object of SlidePlaceholder type to placeholders it doesn't currently support. However, this SlidePlaceholder doesn't seem to have any functionality to replace itself with a picture / table / etc. Cheers, |
|
Ah, ok, got it; now I see your intent I think. Definitely will need the tests if you want a commit. I haven't had my head in the code recently, but I vaguely recall the generic placeholder not being quite so simple as just inheriting functionality from the various "specialized" placeholder objects; something to do with (bulleted) list specifications or something. It's probably worth drafting up an analysis page and working through the schema and PowerPoint behaviors to make sure the full scope is understood. Minimally the proper delete behavior ought to be in there, that it remembers it was originally an object placeholder. |
Added ObjectPlacholder class which acts as a union of SlidePlacholder, ChartPlaceholder, PicturePlaceholder, and TablePlaceholder.