]> source.dussan.org Git - poi.git/commitdiff
update method name (has typo)
authorPJ Fanning <fanningpj@apache.org>
Mon, 1 Aug 2022 11:16:19 +0000 (11:16 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 1 Aug 2022 11:16:19 +0000 (11:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903161 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFRun.java

index d90c78e3aba22161a7076f03d122d8a0d5a5ec20..fd0d29cb59b70042ab3e748dd3682065563b89c1 100644 (file)
@@ -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();
index 84219acee6e9a86a2b46309f67f8a61b140a99d5..dcdfa4c3b97017e2661d35e9f48fd39ef8438425 100644 (file)
@@ -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());