Bug 54099

Summary: CTHMerge & CTTcBorders classes missing in poi-ooxml-schemas-3.8
Product: POI Reporter: gabe pisce <gabriel.goic>
Component: XWPFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: minor CC: samuel.langlois
Priority: P2    
Version: 3.8-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   

Description gabe pisce 2012-11-05 10:25:40 UTC
Hello,

When using XWPF to create a docx file, the following code will trigger a compilation error, due to missing classes in poi-ooxml-schemas-3.8. This is worked around by excluding poi-ooxml-schemas from my dependencies and replacing it with ooxml-schemas-1.1. Of course this is annoying since this jar is so huge.

1)
XWPFTableCell cell;
CTTc ctTc = cell.getCTTc();
CTTcPr tcPr = ctTc.addNewTcPr();
CTHMerge hMerge = tcPr.addNewHMerge(); => missing CTHMerge class

2)
XWPFTableCell cell;
CTTc ctTc = cell.getCTTc();
CTTcPr tcPr = ctTc.addNewTcPr();
CTTcBorders tblBorders = tcPr.addNewTcBorders(); => missing CTTcBorders class


Cheers,
Comment 1 Yegor Kozlov 2012-11-05 13:02:43 UTC
Please check with the latest build from trunk, the link to daily builds is on http://poi.apache.org/
Comment 2 gabe pisce 2012-11-05 13:56:05 UTC
I checked with poi-bin-3.9-beta1-20121102 but none of these classes are included
in the org.openxmlformats.schemas.wordprocessingml.x2006.main package, causing the bug to appear.
Comment 3 Yegor Kozlov 2012-11-07 12:42:05 UTC
check your classpath. I've just re-checked with the latest build from trunk and  CTHMerge and CTTcBorders are in poi-ooxml

Yegor
Comment 4 gabe pisce 2012-11-08 14:42:55 UTC
I must admit I am a bit confused right now.

I am looking for the following classes:

org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHMerge
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcBorders

The only jar in the POI release that contains a org.openxmlformats package is poi-ooxml-schemas.jar (correct me if I am wrong)

So I checked the latest build from trunk: poi-bin-3.9-beta1-20121108

And poi-ooxml-schemas-3.9-beta1-20121108.jar does not contain those classes.

Are they located elsewhere? maybe in a different package?
Comment 5 Yegor Kozlov 2012-11-08 19:55:29 UTC
Sorry for confusion, I was actually checking against the full ooxml-schemas-1.1.jar.


Can you please try once more? I added junit tests that ensure that CTHMerge and CTTcBorders go in poi-ooxml-schemas jar.

Yegor
Comment 6 gabe pisce 2012-11-12 16:00:32 UTC
Thanks for the partial fix. However, this only unveiled some other mising classes which allow the same function (to merge cells in a docx).

1)
XWPFTableCell cell = ...;
CTTc ctTc = cell.getCTTc();
CTTcPr tcPr = ctTc.addNewTcPr();
CTHMerge hMerge = tcPr.addNewHMerge();
hMerge.setVal(STMerge.RESTART);

=> org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge is missing


2)
XWPFTableCell cell = ...;
CTTc ctTc = cell.getCTTc();
CTTcPr tcPr = ctTc.addNewTcPr();
CTVMerge vMerge = tcPr.addNewVMerge();

=> org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVMerge is missing


May I suggest to include everything aroung "Merge"?
Comment 7 Yegor Kozlov 2012-11-12 16:13:06 UTC
 "around merge" is a fuzzy definition. please submit sample code that sets bordes and references all classes you need and I will include.
Comment 8 Yegor Kozlov 2012-11-12 16:13:59 UTC
"around merge" is a fuzzy definition. please submit sample code that sets
 bordes and references all classes you need and I will include them in poi-ooxml-schemas.jar.
Comment 9 gabe pisce 2012-11-12 16:25:02 UTC
Got it, STMerge & CTVMerge will be enough for now :)
Comment 10 gabe pisce 2012-11-13 16:30:04 UTC
Needed classes:

1)
XWPFTableCell cell = ...;
CTTc ctTc = cell.getCTTc();
CTTcPr tcPr = ctTc.addNewTcPr();
CTHMerge hMerge = tcPr.addNewHMerge();
hMerge.setVal(STMerge.RESTART);

=> org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge is missing


2)
XWPFTableCell cell = ...;
CTTc ctTc = cell.getCTTc();
CTTcPr tcPr = ctTc.addNewTcPr();
CTVMerge vMerge = tcPr.addNewVMerge();

=> org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVMerge is missing
Comment 11 Yegor Kozlov 2012-11-15 07:47:54 UTC
Fixed in r1409676, now STMerge & CTVMerge are in poi-ooxml-schemas

Yegor

(In reply to comment #10)
> Needed classes:
> 
> 1)
> XWPFTableCell cell = ...;
> CTTc ctTc = cell.getCTTc();
> CTTcPr tcPr = ctTc.addNewTcPr();
> CTHMerge hMerge = tcPr.addNewHMerge();
> hMerge.setVal(STMerge.RESTART);
> 
> => org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge is missing
> 
> 
> 2)
> XWPFTableCell cell = ...;
> CTTc ctTc = cell.getCTTc();
> CTTcPr tcPr = ctTc.addNewTcPr();
> CTVMerge vMerge = tcPr.addNewVMerge();
> 
> => org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVMerge is missing