Bug 58878

Summary: Calling getName() on an instance of StyleDescription from paragraph returns the localized style name
Product: POI Reporter: Tim Koers <tim.koers>
Component: HWPFAssignee: POI Developers List <dev>
Status: NEEDINFO ---    
Severity: minor CC: tim.koers
Priority: P2    
Version: 3.13-FINAL   
Target Milestone: ---   
Hardware: Other   
OS: All   

Description Tim Koers 2016-01-16 19:06:02 UTC
Today I found a POI sample which showed how to get the styles for each paragraph.

I quickly implemented in my Android app, which worked great, but the value that getName() returns is the name of the style that should be used in the UI as described here: http://www.ecma-international.org/news/TC45_current_work/Office%20Open%20XML%20Part%204%20-%20Markup%20Language%20Reference_final.docx 

In section name (Primary Style Name)

From the research that I did, I concluded the following:

The Word XML document (exported as XML) has got these attributes:

<w:style w:type="paragraph" w:styleId="Kop1">
			<w:name w:val="heading 1"/>
			<wx:uiName wx:val="Kop 1"/>
			<w:basedOn w:val="Standaard"/>
			<w:next w:val="Standaard"/>
			<w:link w:val="Kop1Char"/>
			<w:rsid w:val="00287DCB"/>
				<w:spacing w:before="240" w:after="0"/>
				<w:outlineLvl w:val="0"/>
				<w:rFonts w:ascii="Calibri Light" w:fareast="Times New Roman" w:h-ansi="Calibri Light"/>
				<wx:font wx:val="Calibri Light"/>
				<w:color w:val="2E74B5"/>
				<w:sz w:val="32"/>
				<w:sz-cs w:val="32"/>

I think that the <wx:uiName> attribute is returned when calling getName()

I tried reverse engineering the TableStream and found out that only the <wx:uiNames> where in the stream. 

Is there something I am not seeing, or is this a bug?
Comment 1 Dominik Stadler 2016-02-12 07:37:55 UTC
Can you attach a sample document to make it easier to look at this? Also some sample-code which shows how you access the data in your app would be good.