Open raymrdc opened 2 years ago
Thanks for this. Do you happen to have a sample doc I can use for testing?
Also,
I may move this bug to the Serialize.OpenXml.CodeGen project as that is the project responsible for creating the source code. That being said, i would be interested in seeing whether or not the latest version of the openxml sdk would use classes from the A16 namespace instead of the unknown element class. Regardless, the code being generated should use the OpenXmlUnknownElement.CreateOpenXmlUnknownElement
method to create unknown elements instead of using the standard ctor.
I couldn't upload the powerpoint file in a public site.
If you can, give it another try with the latest source. I updated the Serialize.OpenXml.CodeGen
library it uses to generate the correct create method for OpenXmlUnknownElement
objects
I tried using the latest codes. But the result is still the same as the previously generated version. Just checking if I got the correct version Serialize.OpenXml.CodeGen-bbbb75c586bcc8e633d9ee91627854d6d9fa1cf7.zip
Also, I'm only checking this portion ExtensionList in Table->TableGrid->GridColumn
The error was recreated using the latest DocxToSource (Nov 14, 2022) and CodeGen (Dec 18, 2022) from Github. The OpenXML is version 2.20.0.
The error in Visual Studio is
Severity Code Description Error CS0619 'OpenXmlUnknownElement.CreateOpenXmlUnknownElement(string)' is obsolete: 'Use extension method CreateUnknownElement off of a part container'
Attached is a simple test file that reproduce the same issue on Slide 3. Test powerpoint file.pptx
Using generated code for Table in Powerpoint, the generated powerpoint will encounter "Powerpoint found a problem with content. Powerpoint can attempt to repair the presentation"
Root cause: code for ExtensionList in Table->TableGrid->GridColumn is incorrect
Generated by DocxToSource
But when using code generated by SDK Productivity Tool, the generated powerpoint opens correctly.
Generated by SDK Productivity Tool