Bug 58878 - Calling getName() on an instance of StyleDescription from paragraph returns the localized style name
Summary: Calling getName() on an instance of StyleDescription from paragraph returns t...
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: 3.13-FINAL
Hardware: Other All
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-16 19:06 UTC by Tim Koers
Modified: 2016-02-12 07:37 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 2.7.3.9 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:pPr>
				<w:keepNext/>
				<w:keepLines/>
				<w:spacing w:before="240" w:after="0"/>
				<w:outlineLvl w:val="0"/>
			</w:pPr>
			<w:rPr>
				<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"/>
			</w:rPr>
		</w:style>

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.