From ee65a6655dbc9c68ab891b796c32113f38893696 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 1 Aug 2022 11:16:19 +0000 Subject: [PATCH] update method name (has typo) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903161 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/xwpf/usermodel/XWPFRun.java | 13 +++++++++++++ .../org/apache/poi/xwpf/usermodel/TestXWPFRun.java | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java index d90c78e3ab..fd0d29cb59 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java @@ -1495,8 +1495,21 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { * * @return {@link STHighlightColor} for the run. * @since 4.0.0 + * @deprecated use {@link #getTextHighlightColor()} instead */ + @Deprecated + @Removal(version = "7.0.0") public STHighlightColor.Enum getTextHightlightColor() { + return getTextHighlightColor(); + } + + /** + * Gets the highlight color for the run + * + * @return {@link STHighlightColor} for the run. + * @since 5.2.3 + */ + public STHighlightColor.Enum getTextHighlightColor() { CTRPr pr = getRunProperties(true); CTHighlight highlight = pr.sizeOfHighlightArray() > 0 ? pr.getHighlightArray(0) : pr.addNewHighlight(); STHighlightColor color = highlight.xgetVal(); diff --git a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFRun.java b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFRun.java index 84219acee6..dcdfa4c3b9 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFRun.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFRun.java @@ -678,10 +678,10 @@ class TestXWPFRun { void testSetGetTextHighlightColor() throws IOException { try (XWPFDocument document = new XWPFDocument()) { final XWPFRun run = document.createParagraph().createRun(); - assertSame(STHighlightColor.NONE, run.getTextHightlightColor()); + assertSame(STHighlightColor.NONE, run.getTextHighlightColor()); assertFalse(run.isHighlighted()); run.setTextHighlightColor("darkGreen"); // See 17.18.40 ST_HighlightColor (Text Highlight Colors) - assertSame(STHighlightColor.DARK_GREEN, run.getTextHightlightColor()); + assertSame(STHighlightColor.DARK_GREEN, run.getTextHighlightColor()); assertTrue(run.isHighlighted()); run.setTextHighlightColor("none"); assertFalse(run.isHighlighted());