From: PJ Fanning Date: Mon, 1 Aug 2022 11:16:19 +0000 (+0000) Subject: update method name (has typo) X-Git-Tag: REL_5_2_3~98 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ee65a6655dbc9c68ab891b796c32113f38893696;p=poi.git update method name (has typo) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903161 13f79535-47bb-0310-9956-ffa450edef68 --- 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());