Pptxgenjs: Does anybody know why this number is used here - "4294967295"? Why not a simple value like "1"?

Created on 31 Aug 2020  路  4Comments  路  Source: gitbrent/PptxGenJS

Most helpful comment

@gitbrent I've understood how to get this value in PP. For example, you have an inheritance chain: master slide placeholder with idx='1', slide layout placeholder with idx='1', and slide placeholder with idx='1'. if you remove the slide layout's placeholder the inheritance chain between the slide and the slide layout will be broken, but PP still has to inherit properties from parent entities in this case from the master slide, and it marks slide placeholder with idx='4294967295'. It's like a mark. If PP reads this value it inherits properties directly from the master slide, excludes the slide layout and it understands that placeholder which belongs to the slide layout has been removed.
How does it find the required placeholder if the slide placeholder changes from idx='1' to idx='4294967295'? I think MS PP does it by placeholder type, but I am not sure.

it's not a just upper bound value for unsigned int. It's part of MS PowerPoint behavior, but unfortunately this part under the hood and doesn't describe in OXML Standard. I've found a related article

Maybe it will be useful to someone.

All 4 comments

My guess would be, that this is the last possible index.

Why the last?
It seems the index here is an unsigned 32bit number, starting at 0 and 4294967295 (= 2鲁虏-1) is the highest (last) representable number here.

Probably this is used to ensure, that no previous index is re-used or overwritten.

Just my 2 cents.

Thanks, @koddistortion, I know about the upper bound of unsigned int type, but I've checked it on real pptx files and behavior a bit different with idx='4294967295' than, for example with idx='1' etc, and I'm trying to understand how does it work...

I鈥檓 unable to recall where the value is derived from off-hand. I may have simply mimicked what PowerPoint produced.

@gitbrent I've understood how to get this value in PP. For example, you have an inheritance chain: master slide placeholder with idx='1', slide layout placeholder with idx='1', and slide placeholder with idx='1'. if you remove the slide layout's placeholder the inheritance chain between the slide and the slide layout will be broken, but PP still has to inherit properties from parent entities in this case from the master slide, and it marks slide placeholder with idx='4294967295'. It's like a mark. If PP reads this value it inherits properties directly from the master slide, excludes the slide layout and it understands that placeholder which belongs to the slide layout has been removed.
How does it find the required placeholder if the slide placeholder changes from idx='1' to idx='4294967295'? I think MS PP does it by placeholder type, but I am not sure.

it's not a just upper bound value for unsigned int. It's part of MS PowerPoint behavior, but unfortunately this part under the hood and doesn't describe in OXML Standard. I've found a related article

Maybe it will be useful to someone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevinresol picture kevinresol  路  3Comments

DSheffield picture DSheffield  路  3Comments

alperendurmus picture alperendurmus  路  3Comments

colmben picture colmben  路  6Comments

LeoFC97 picture LeoFC97  路  3Comments