poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1875859 [2/3] - in /poi/trunk/src: examples/src/org/apache/poi/hssf/usermodel/examples/ examples/src/org/apache/poi/xslf/usermodel/ examples/src/org/apache/poi/xssf/usermodel/examples/ examples/src/org/apache/poi/xwpf/usermodel/examples/ j...
Date Sun, 29 Mar 2020 14:39:12 GMT
Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java?rev=1875859&r1=1875858&r2=1875859&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java Sun Mar
29 14:39:11 2020
@@ -18,14 +18,17 @@
  */
 package org.apache.poi.xssf.usermodel;
 
-import org.apache.poi.ss.usermodel.*;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues;
+import org.apache.poi.ss.usermodel.Color;
+import org.apache.poi.ss.usermodel.Font;
+import org.apache.poi.ss.usermodel.FontFormatting;
+import org.apache.poi.ss.usermodel.FontUnderline;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBooleanProperty;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontProperty;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.STVerticalAlignRun;
 
 
@@ -45,13 +48,13 @@ public class XSSFFontFormatting implemen
      * get the type of super or subscript for the font
      *
      * @return super or subscript option
-     * @see #SS_NONE
-     * @see #SS_SUPER
-     * @see #SS_SUB
+     * @see org.apache.poi.ss.usermodel.Font#SS_NONE
+     * @see org.apache.poi.ss.usermodel.Font#SS_SUPER
+     * @see org.apache.poi.ss.usermodel.Font#SS_SUB
      */
     @Override
     public short getEscapementType(){
-        if(_font.sizeOfVertAlignArray() == 0) return SS_NONE;
+        if(_font.sizeOfVertAlignArray() == 0) return org.apache.poi.ss.usermodel.Font.SS_NONE;
 
         CTVerticalAlignFontProperty prop = _font.getVertAlignArray(0);
         return (short)(prop.getVal().intValue() - 1);
@@ -61,14 +64,14 @@ public class XSSFFontFormatting implemen
      * set the escapement type for the font
      *
      * @param escapementType  super or subscript option
-     * @see #SS_NONE
-     * @see #SS_SUPER
-     * @see #SS_SUB
+     * @see org.apache.poi.ss.usermodel.Font#SS_NONE
+     * @see org.apache.poi.ss.usermodel.Font#SS_SUPER
+     * @see org.apache.poi.ss.usermodel.Font#SS_SUB
      */
     @Override
     public void setEscapementType(short escapementType){
         _font.setVertAlignArray(null);
-        if(escapementType != SS_NONE){
+        if(escapementType != org.apache.poi.ss.usermodel.Font.SS_NONE){
             _font.addNewVertAlign().setVal(STVerticalAlignRun.Enum.forInt(escapementType
+ 1));
         }
     }
@@ -76,13 +79,13 @@ public class XSSFFontFormatting implemen
     /**
      * XMLBeans and the XSD make this look like it can have multiple values, but it is maxOccurrs=1.
      * Use get*Array(), it is much faster than get*List().
-     * 
+     *
      * @see org.apache.poi.ss.usermodel.FontFormatting#isStruckout()
      */
     @Override
     public boolean isStruckout() {
         for (CTBooleanProperty bProp : _font.getStrikeArray()) return bProp.getVal();
-        return false; 
+        return false;
     }
 
     /**
@@ -159,22 +162,22 @@ public class XSSFFontFormatting implemen
      *
      * @return font underlining type
      *
-     * @see #U_NONE
-     * @see #U_SINGLE
-     * @see #U_DOUBLE
-     * @see #U_SINGLE_ACCOUNTING
-     * @see #U_DOUBLE_ACCOUNTING
+     * @see Font#U_NONE
+     * @see Font#U_SINGLE
+     * @see Font#U_DOUBLE
+     * @see Font#U_SINGLE_ACCOUNTING
+     * @see Font#U_DOUBLE_ACCOUNTING
      */
     @Override
     public short getUnderlineType(){
-        if(_font.sizeOfUArray() == 0) return U_NONE;
+        if(_font.sizeOfUArray() == 0) return Font.U_NONE;
         CTUnderlineProperty u = _font.getUArray(0);
         switch(u.getVal().intValue()){
-            case STUnderlineValues.INT_SINGLE: return U_SINGLE;
-            case STUnderlineValues.INT_DOUBLE: return U_DOUBLE;
-            case STUnderlineValues.INT_SINGLE_ACCOUNTING: return U_SINGLE_ACCOUNTING;
-            case STUnderlineValues.INT_DOUBLE_ACCOUNTING: return U_DOUBLE_ACCOUNTING;
-            default: return U_NONE;
+            case STUnderlineValues.INT_SINGLE: return Font.U_SINGLE;
+            case STUnderlineValues.INT_DOUBLE: return Font.U_DOUBLE;
+            case STUnderlineValues.INT_SINGLE_ACCOUNTING: return Font.U_SINGLE_ACCOUNTING;
+            case STUnderlineValues.INT_DOUBLE_ACCOUNTING: return Font.U_DOUBLE_ACCOUNTING;
+            default: return Font.U_NONE;
         }
     }
 
@@ -183,16 +186,16 @@ public class XSSFFontFormatting implemen
      *
      * @param underlineType  super or subscript option
      *
-     * @see #U_NONE
-     * @see #U_SINGLE
-     * @see #U_DOUBLE
-     * @see #U_SINGLE_ACCOUNTING
-     * @see #U_DOUBLE_ACCOUNTING
+     * @see Font#U_NONE
+     * @see Font#U_SINGLE
+     * @see Font#U_DOUBLE
+     * @see Font#U_SINGLE_ACCOUNTING
+     * @see Font#U_DOUBLE_ACCOUNTING
      */
     @Override
     public void setUnderlineType(short underlineType){
         _font.setUArray(null);
-        if(underlineType != U_NONE){
+        if(underlineType != Font.U_NONE){
             FontUnderline fenum = FontUnderline.valueOf(underlineType);
             STUnderlineValues.Enum val = STUnderlineValues.Enum.forInt(fenum.getValue());
             _font.addNewU().setVal(val);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java?rev=1875859&r1=1875858&r2=1875859&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java Sun
Mar 29 14:39:11 2020
@@ -269,7 +269,7 @@ public class WordToTextConverter extends
 
         currentBlock.appendChild( textDocumentFacade.createText( " ("
                 + UNICODECHAR_ZERO_WIDTH_SPACE
-                + hyperlink.replaceAll( "/", UNICODECHAR_ZERO_WIDTH_SPACE
+                + hyperlink.replace( "/", UNICODECHAR_ZERO_WIDTH_SPACE
                         + "\\/" + UNICODECHAR_ZERO_WIDTH_SPACE )
                 + UNICODECHAR_ZERO_WIDTH_SPACE + ")" ) );
     }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java?rev=1875859&r1=1875858&r2=1875859&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java Sun Mar 29 14:39:11
2020
@@ -301,12 +301,12 @@ public final class TestCFRuleRecord {
         fontFormatting.setBold(false);
         assertFalse(fontFormatting.isBold());
 
-        fontFormatting.setEscapementType(FontFormatting.SS_SUB);
-        assertEquals(FontFormatting.SS_SUB, fontFormatting.getEscapementType());
-        fontFormatting.setEscapementType(FontFormatting.SS_SUPER);
-        assertEquals(FontFormatting.SS_SUPER, fontFormatting.getEscapementType());
-        fontFormatting.setEscapementType(FontFormatting.SS_NONE);
-        assertEquals(FontFormatting.SS_NONE, fontFormatting.getEscapementType());
+        fontFormatting.setEscapementType(org.apache.poi.ss.usermodel.Font.SS_SUB);
+        assertEquals(org.apache.poi.ss.usermodel.Font.SS_SUB, fontFormatting.getEscapementType());
+        fontFormatting.setEscapementType(org.apache.poi.ss.usermodel.Font.SS_SUPER);
+        assertEquals(org.apache.poi.ss.usermodel.Font.SS_SUPER, fontFormatting.getEscapementType());
+        fontFormatting.setEscapementType(org.apache.poi.ss.usermodel.Font.SS_NONE);
+        assertEquals(org.apache.poi.ss.usermodel.Font.SS_NONE, fontFormatting.getEscapementType());
 
         fontFormatting.setEscapementTypeModified(false);
         assertFalse(fontFormatting.isEscapementTypeModified());
@@ -364,8 +364,8 @@ public final class TestCFRuleRecord {
         fontFormatting.setStrikeout(true);
         assertTrue(fontFormatting.isStruckout());
 
-        fontFormatting.setUnderlineType(FontFormatting.U_DOUBLE_ACCOUNTING);
-        assertEquals(FontFormatting.U_DOUBLE_ACCOUNTING, fontFormatting.getUnderlineType());
+        fontFormatting.setUnderlineType(org.apache.poi.ss.usermodel.Font.U_DOUBLE_ACCOUNTING);
+        assertEquals(org.apache.poi.ss.usermodel.Font.U_DOUBLE_ACCOUNTING, fontFormatting.getUnderlineType());
 
         fontFormatting.setUnderlineTypeModified(false);
         assertFalse(fontFormatting.isUnderlineTypeModified());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message