Bug 66347 - Add theme support to XWPF
Summary: Add theme support to XWPF
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: unspecified
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-14 08:20 UTC by stephan.schwiebert
Modified: 2022-11-23 10:42 UTC (History)
0 users



Attachments
Adding XWPFTheme (11.12 KB, text/plain)
2022-11-14 08:20 UTC, stephan.schwiebert
Details
Basic test for XWPF themes (2.90 KB, text/plain)
2022-11-18 05:24 UTC, stephan.schwiebert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stephan.schwiebert 2022-11-14 08:20:30 UTC
Created attachment 38433 [details]
Adding XWPFTheme

While XSLF already has support for 'themes' via XSLFTheme, there is no counterpart for XWPF yet. The patch on this tickets adds XWPFTheme (the implementation is mostly copied from XSLFTheme, since there's not much difference between them).

Please let me know what you're thinking!
Comment 1 PJ Fanning 2022-11-16 22:11:12 UTC
thanks - added with r1905344

Would it be possible to add more test coverage - for regression purposes?
Comment 2 stephan.schwiebert 2022-11-17 05:51:42 UTC
Sure, I'll add some tests. Thanks!
Comment 3 stephan.schwiebert 2022-11-18 05:24:06 UTC
Created attachment 38435 [details]
Basic test for XWPF themes

Added a small test case to verify that a theme can be read.
Comment 4 PJ Fanning 2022-11-18 10:11:34 UTC
thanks - added with r1905374

Would it be possible to add a test where a new themes file is created in a docx file?
Comment 5 stephan.schwiebert 2022-11-21 20:16:04 UTC
Sorry, I should have mentioned that in the previous comment. 

I was considering a test for modifying a theme, but the "XWPFTheme" implementation is based on/aligned with the existing "XSLFTheme", which doesn't provide methods to modify the theme (besides going through "getXmlObject()", but that seems to be an internal method).

I agree that it would be nice to be able to modify themes (for XSLF and XWPF), but it seemed to me like that's out of scope of this patch. Or do you think differently?