diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-08-28 14:16:01 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-08-28 14:16:01 +0000 |
commit | 913d1eecf52382f706d5903b2fbd0ae9c8770494 (patch) | |
tree | 5315db4ecafbb785de58796ab75ed33433377de8 /poi-scratchpad/src/main | |
parent | 25f00ba7c2db9bd897cffa67d12b1cfa31583516 (diff) | |
download | poi-913d1eecf52382f706d5903b2fbd0ae9c8770494.tar.gz poi-913d1eecf52382f706d5903b2fbd0ae9c8770494.zip |
[bug-63576] support capitalized text in WordExtractor (HWPF)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903738 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src/main')
-rw-r--r-- | poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java index 01c4bed4fe..d6f410d286 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java @@ -52,6 +52,7 @@ import org.apache.poi.hwpf.usermodel.TableRow; import org.apache.poi.poifs.filesystem.Entry; import org.apache.poi.util.Beta; import org.apache.poi.util.Internal; +import org.apache.poi.util.LocaleUtil; import org.apache.poi.util.StringUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -445,6 +446,10 @@ public abstract class AbstractWordConverter { continue; } + if (characterRun.isCapitalized() || characterRun.isSmallCaps()) { + text = text.toUpperCase(LocaleUtil.getUserLocale()); + } + if (characterRun.isSpecialCharacter()) { if (text.charAt(0) == SPECCHAR_AUTONUMBERED_FOOTNOTE_REFERENCE && (wordDocument instanceof HWPFDocument)) { |