]> source.dussan.org Git - poi.git/commitdiff
converted non-ascii characters to unicode to keep compilers on UTF-8 systems quiet
authorYegor Kozlov <yegor@apache.org>
Sun, 9 Nov 2008 19:45:45 +0000 (19:45 +0000)
committerYegor Kozlov <yegor@apache.org>
Sun, 9 Nov 2008 19:45:45 +0000 (19:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@712543 13f79535-47bb-0310-9956-ffa450edef68

14 files changed:
src/examples/src/org/apache/poi/hpsf/examples/ModifyDocumentSummaryInformation.java
src/java/org/apache/poi/hssf/record/CRNCountRecord.java
src/java/org/apache/poi/hssf/util/RKUtil.java
src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFColor.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFactory.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPrintSetup.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFDocument.java
src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java
src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java

index d3fdfa2969f2e59144452ca7b64dba9f3a218710..43edebe26d834325006d8c57d5f9123d9c66c4e3 100644 (file)
@@ -173,7 +173,7 @@ public class ModifyDocumentSummaryInformation
         
         /* Insert some custom properties into the container. */
         customProperties.put("Key 1", "Value 1");
-        customProperties.put("Schlüssel 2", "Wert 2");
+        customProperties.put("Schl\u00fcssel 2", "Wert 2");
         customProperties.put("Sample Number", new Integer(12345));
         customProperties.put("Sample Boolean", new Boolean(true));
         customProperties.put("Sample Date", new Date());
index e04deb79de6ce16e4a339c3d6c5e0415adaefea4..f1560deb1b5914f781edf16463e0d12ff3753749 100755 (executable)
@@ -19,7 +19,7 @@ package org.apache.poi.hssf.record;
 
 import org.apache.poi.util.LittleEndian;
 /**
- * XCT \96 CRN Count <P>
+ * XCT - CRN Count <P>
  *
  * REFERENCE:  5.114<P>
  *
index 9129d6ad45c13a1ca22097a613c1279430e3eb5e..27aecb06b385e0d24a75edd700cc1e568ff8345b 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.poi.hssf.util;
  *
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Glen Stampoultzis (glens at apache.org)
- * @author Rolf-Jürgen Moll
+ * @author Rolf-J\u00f6rgen Moll
  *
  * @see org.apache.poi.hssf.record.MulRKRecord
  * @see org.apache.poi.hssf.record.RKRecord
index 3eed794c0bdc989611c7219ed091fabc066f8246..406a3145e971dda7cb8f5d99315832dd99f4c8b5 100644 (file)
@@ -100,7 +100,7 @@ public class ExtractorFactory {
                if(corePart.getContentType().equals(XSSFRelation.WORKBOOK.getContentType())) {
                        return new XSSFExcelExtractor(pkg);
                }
-               if(corePart.getContentType().equals(XWPFRelation.MAIN_CONTENT_TYPE)) {
+               if(corePart.getContentType().equals(XWPFRelation.DOCUMENT.getContentType())) {
                        return new XWPFWordExtractor(pkg);
                }
                if(corePart.getContentType().equals(XSLFSlideShow.MAIN_CONTENT_TYPE)) {
index 9bd38c019f7290d36461c2a7e61fd1002632ee8b..4a2c63f03bef4af3b3f9ed384fdadd5388045cc4 100644 (file)
@@ -121,23 +121,23 @@ public class XSSFColor {
      * <blockquote>
      * <pre>
      * If (tint &lt; 0)
-     * Lum\92 = Lum * (1.0 + tint)
+     * Lum' = Lum * (1.0 + tint)
      *
      * For example: Lum = 200; tint = -0.5; Darken 50%
-     * Lum\91 = 200 * (0.5) =&gt; 100
+     * Lum' = 200 * (0.5) =&gt; 100
      * For example: Lum = 200; tint = -1.0; Darken 100% (make black)
-     * Lum\91 = 200 * (1.0-1.0) =&gt; 0
+     * Lum' = 200 * (1.0-1.0) =&gt; 0
      * If (tint &gt; 0)
-     * Lum\91 = Lum * (1.0-tint) + (HLSMAX \96 HLSMAX * (1.0-tint))
+     * Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint))
      * For example: Lum = 100; tint = 0.75; Lighten 75%
      *
-     * Lum\91 = 100 * (1-.75) + (HLSMAX \96 HLSMAX*(1-.75))
-     * = 100 * .25 + (255 \96 255 * .25)
-     * = 25 + (255 \96 63) = 25 + 192 = 217
+     * Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75))
+     * = 100 * .25 + (255 - 255 * .25)
+     * = 25 + (255 - 63) = 25 + 192 = 217
      * For example: Lum = 100; tint = 1.0; Lighten 100% (make white)
-     * Lum\91 = 100 * (1-1) + (HLSMAX \96 HLSMAX*(1-1))
-     * = 100 * 0 + (255 \96 255 * 0)
-     * = 0 + (255 \96 0) = 255
+     * Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1))
+     * = 100 * 0 + (255 - 255 * 0)
+     * = 0 + (255 - 0) = 255
      * </pre>
      * </blockquote>
      *
@@ -166,23 +166,23 @@ public class XSSFColor {
      * <blockquote>
      * <pre>
      * If (tint &lt; 0)
-     * Lum\92 = Lum * (1.0 + tint)
+     * Lum' = Lum * (1.0 + tint)
      *
      * For example: Lum = 200; tint = -0.5; Darken 50%
-     * Lum\91 = 200 * (0.5) =&gt; 100
+     * Lum' = 200 * (0.5) =&gt; 100
      * For example: Lum = 200; tint = -1.0; Darken 100% (make black)
-     * Lum\91 = 200 * (1.0-1.0) =&gt; 0
+     * Lum' = 200 * (1.0-1.0) =&gt; 0
      * If (tint &gt; 0)
-     * Lum\91 = Lum * (1.0-tint) + (HLSMAX \96 HLSMAX * (1.0-tint))
+     * Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint))
      * For example: Lum = 100; tint = 0.75; Lighten 75%
      *
-     * Lum\91 = 100 * (1-.75) + (HLSMAX \96 HLSMAX*(1-.75))
-     * = 100 * .25 + (255 \96 255 * .25)
-     * = 25 + (255 \96 63) = 25 + 192 = 217
+     * Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75))
+     * = 100 * .25 + (255 - 255 * .25)
+     * = 25 + (255 - 63) = 25 + 192 = 217
      * For example: Lum = 100; tint = 1.0; Lighten 100% (make white)
-     * Lum\91 = 100 * (1-1) + (HLSMAX \96 HLSMAX*(1-1))
-     * = 100 * 0 + (255 \96 255 * 0)
-     * = 0 + (255 \96 0) = 255
+     * Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1))
+     * = 100 * 0 + (255 - 255 * 0)
+     * = 0 + (255 - 0) = 255
      * </pre>
      * </blockquote>
      *
index 40d55f2eab8c75393af5e213a0f112c30dd3c88f..9317d39520e581e86d1323050d44d4b1a8846628 100755 (executable)
@@ -46,7 +46,7 @@ public class XSSFFactory extends POIXMLFactory  {
     }\r
 \r
     public POIXMLDocumentPart createDocumentPart(PackageRelationship rel, PackagePart part){\r
-        XSSFRelation descriptor = XSSFRelation.getInstance(rel.getRelationshipType());\r
+        POIXMLRelation descriptor = XSSFRelation.getInstance(rel.getRelationshipType());\r
         if(descriptor == null || descriptor.getRelationClass() == null){\r
             logger.log(POILogger.DEBUG, "using default POIXMLDocumentPart for " + rel.getRelationshipType());\r
             return new POIXMLDocumentPart(part, rel);\r
index 0e70db605176d4808d8fecea99377cc48942de5e..2905228204e76f421e9a963014ded7390a16dd2f 100755 (executable)
@@ -344,7 +344,7 @@ public class XSSFPrintSetup implements PrintSetup {
     }
 
     /**
-     * Use the printerÕs defaults settings for page setup values and don't use the default values
+     * Use the printer's defaults settings for page setup values and don't use the default values
      * specified in the schema. For example, if dpi is not present or specified in the XML, the
      * application shall not assume 600dpi as specified in the schema as a default and instead
      * shall let the printer specify the default dpi.
index c72241a72937bbecd9e78c19e8bea93669652b90..24a3f252f0ed58f17677be532a60e48cb5a1bf4a 100644 (file)
@@ -1360,9 +1360,9 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
      * <pre>
      * 10 - 10%
      * 20 - 20%
-     * \85
+     * ...
      * 100 - 100%
-     * \85
+     * ...
      * 400 - 400%
      * </pre>
      *
index f8ff5c84b045da23e409b21fe42d2d9ce239a11f..fdf6c9797677f856f476e6fc2dbd6106a8880830 100644 (file)
@@ -110,7 +110,7 @@ public class XWPFDocument extends POIXMLDocument {
 
             for(POIXMLDocumentPart p : getRelations()){
                 String relation = p.getPackageRelationship().getRelationshipType();
-                if(relation.equals(XWPFRelation.COMMENT_RELATION_TYPE)){
+                if(relation.equals(XWPFRelation.COMMENT.getRelation())){
                     CommentsDocument cmntdoc = CommentsDocument.Factory.parse(p.getPackagePart().getInputStream());
                     for(CTComment ctcomment : cmntdoc.getComments().getCommentArray()) {
                         comments.add(new XWPFComment(ctcomment));
@@ -130,7 +130,7 @@ public class XWPFDocument extends POIXMLDocument {
         // TODO: make me optional/separated in private function
         try    {
             Iterator <PackageRelationship> relIter =
-                getPackagePart().getRelationshipsByType(XWPFRelation.HYPERLINK_RELATION_TYPE).iterator();
+                getPackagePart().getRelationshipsByType(XWPFRelation.HYPERLINK.getRelation()).iterator();
             while(relIter.hasNext()) {
                 PackageRelationship rel = relIter.next();
                 hyperlinks.add(new XWPFHyperlink(rel.getId(), rel.getTargetURI().toString()));
@@ -257,7 +257,7 @@ public class XWPFDocument extends POIXMLDocument {
     public CTStyles getStyle() throws XmlException, IOException {
         PackagePart[] parts;
         try {
-            parts = getRelatedByType(XWPFRelation.STYLES_RELATION_TYPE);
+            parts = getRelatedByType(XWPFRelation.STYLES.getRelation());
         } catch(InvalidFormatException e) {
             throw new IllegalStateException(e);
         }
index 7b44e841ac6edbe92fde0f841f449399f2b46001..b58db4a75fcdad58dbf1fc74763aa615017e861e 100755 (executable)
@@ -26,15 +26,6 @@ import java.util.HashMap;
  * @author Yegor Kozlov\r
  */\r
 public class XWPFRelation extends POIXMLRelation {\r
-    public static final String MAIN_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";\r
-    public static final String HEADER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";\r
-    public static final String HEADER_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";\r
-    public static final String FOOTER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";\r
-    public static final String FOOTER_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";\r
-    public static final String STYLES_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";\r
-    public static final String STYLES_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";\r
-    public static final String HYPERLINK_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";\r
-    public static final String COMMENT_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";\r
 \r
     /**\r
      * A map to lookup POIXMLRelation by its relation type\r
@@ -72,6 +63,30 @@ public class XWPFRelation extends POIXMLRelation {
             "/word/webSettings.xml",\r
             null\r
     );\r
+    public static final XWPFRelation HEADER = new XWPFRelation(\r
+            "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",\r
+            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",\r
+            "/word/header#.xml",\r
+            null\r
+    );\r
+    public static final XWPFRelation FOOTER = new XWPFRelation(\r
+            "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",\r
+            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",\r
+            "/word/footer#.xml",\r
+            null\r
+    );\r
+    public static final XWPFRelation HYPERLINK = new XWPFRelation(\r
+            null,\r
+            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",\r
+            null,\r
+            null\r
+    );\r
+    public static final XWPFRelation COMMENT = new XWPFRelation(\r
+            null,\r
+            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",\r
+            null,\r
+            null\r
+    );\r
 \r
 \r
     private XWPFRelation(String type, String rel, String defaultName, Class<? extends POIXMLDocumentPart> cls) {\r
index 0db7a8a65e5f9492b972ad438904ebaa16224fa7..570f6faa14b32ff98ee254f8f820928b29c740f5 100755 (executable)
@@ -22,7 +22,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STOnOff;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;\r
 \r
 /**\r
- * XWPFRun object  defines a region of text with a common set of properties\r
+ * XWPFRun object defines a region of text with a common set of properties\r
  *\r
  * @author Yegor Kozlov\r
  */\r
index c76df4691067ef796d01ca7b767e45e3fdc0179d..321048fd11545f5306476f7c3280c80e80b51993 100644 (file)
@@ -51,7 +51,7 @@ public class TestXWPFDocument extends TestCase {
                
                boolean found = false;
                for(PackagePart part : pack.getParts()) {
-                       if(part.getContentType().equals(XWPFRelation.MAIN_CONTENT_TYPE)) {
+                       if(part.getContentType().equals(XWPFRelation.DOCUMENT.getContentType())) {
                                found = true;
                        }
                        System.out.println(part);
index fe29efe2eacfbec260bf5c519f82673b5e488d0f..fa7a093c0e063a638c08aedbd2fd1c8eb04964bb 100644 (file)
@@ -44,7 +44,7 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  * Basing on: src/examples/src/org/apache/poi/hpsf/examples/ModifyDocumentSummaryInformation.java
  * This class tests reading and writing of meta data. No actual document is created. All information
  * is stored in a virtal document in a ByteArrayOutputStream
- * @author Matthias Günter
+ * @author Matthias G\u00fcnter
  * @since 2006-03-03
  * @version $Id: TestEmptyProperties.java 353563 2004-06-22 16:16:33Z klute $
  */
@@ -286,7 +286,7 @@ public class TestMetaDataIPI extends TestCase{
      
      /* Insert some custom properties into the container. */
      customProperties.put("Key1", "Value1");
-     customProperties.put("Schlüssel2", "Wert2");
+     customProperties.put("Schlssel2", "Wert2");
      customProperties.put("Sample Integer", new Integer(12345));
      customProperties.put("Sample Boolean", new Boolean(true));
      Date date=new Date();
@@ -325,8 +325,8 @@ public class TestMetaDataIPI extends TestCase{
      /* Insert some custom properties into the container. */
      String a1=(String) customProperties.get("Key1");
      assertEquals("Key1","Value1",a1);
-     String a2=(String) customProperties.get("Schlüssel2");
-     assertEquals("Schlüssel2","Wert2",a2);
+     String a2=(String) customProperties.get("Schlssel2");
+     assertEquals("Schlssel2","Wert2",a2);
      Integer a3=(Integer) customProperties.get("Sample Integer");
      assertEquals("Sample Number",new Integer(12345),a3);
      Boolean a4=(Boolean) customProperties.get("Sample Boolean");
@@ -431,7 +431,7 @@ public void testTwo(){
     String a1=(String) customProperties.get(k1);
     assertEquals("Key1",p1,a1);
     String a2=(String) customProperties.get(k2);
-    assertEquals("Schlüssel2",p2,a2);
+    assertEquals("Schlssel2",p2,a2);
     Integer a3=(Integer) customProperties.get("Sample Number");
     assertEquals("Sample Number",new Integer(12345),a3);
     Boolean a4=(Boolean) customProperties.get("Sample Boolean");
@@ -450,7 +450,7 @@ public void testTwo(){
  */
 public String strangize(String s){
         StringBuffer sb=new StringBuffer();
-        String[] umlaute= {"ä","ü","ö","Ü","$","Ö","Ü","É","Ö","@","ç","&"};
+        String[] umlaute= {"�","�","�","�","$","�","�","�","�","@","�","&"};
         char j=0;
         Random rand=new Random();
         for (int i=0;i<5;i++){
@@ -544,7 +544,7 @@ public void testThree(){
    String a1=(String) customProperties.get(k1);
    assertEquals("Key1",p1,a1);
    String a2=(String) customProperties.get(k2);
-   assertEquals("Schlüssel2",p2,a2);
+   assertEquals("Schlssel2",p2,a2);
    Integer a3=(Integer) customProperties.get("Sample Number");
    assertEquals("Sample Number",new Integer(12345),a3);
    Boolean a4=(Boolean) customProperties.get("Sample Boolean");
@@ -577,7 +577,7 @@ public void testThree(){
    public String strangizeU(String s){
          
         StringBuffer sb=new StringBuffer();
-        String[] umlaute= {"ä","ü","ö","Ü","$","Ö","Ü","É","Ö","@","ç","&"};
+        String[] umlaute= {"�","�","�","�","$","�","�","�","�","@","�","&"};
         char j=0;
         Random rand=new Random();
         for (int i=0;i<5;i++){
@@ -592,7 +592,7 @@ public void testThree(){
                 sb.append(umlaute[rand.nextInt(umlaute.length)]);
                 sb.append("<");
         }
-        sb.append("äöü\uD840\uDC00");
+        sb.append("���\uD840\uDC00");
         return sb.toString();
    }
    /**
@@ -668,7 +668,7 @@ public void testThree(){
           String a1=(String) customProperties.get(k1);
           assertEquals("Key1",p1,a1);
           String a2=(String) customProperties.get(k2);
-          assertEquals("Schlüssel2",p2,a2);
+          assertEquals("Schlssel2",p2,a2);
        Integer a3=(Integer) customProperties.get("Sample Number");
           assertEquals("Sample Number",new Integer(12345),a3);
           Boolean a4=(Boolean) customProperties.get("Sample Boolean");
index a499c083e03cecc75e0026e13807a6d23e77d5f9..8d22157a98559b5ff26b9c7fc9446a80063abb53 100644 (file)
@@ -351,10 +351,10 @@ public class TestWriteWellKnown extends TestCase
         CustomProperties customProperties = dsi.getCustomProperties();
         if (customProperties == null)
             customProperties = new CustomProperties();
-        customProperties.put("Schlüssel ä",    "Wert ä");
-        customProperties.put("Schlüssel äö",   "Wert äö");
-        customProperties.put("Schlüssel äöü",  "Wert äöü");
-        customProperties.put("Schlüssel äöüß", "Wert äöüß");
+        customProperties.put("Schl\u00fcssel �",    "Wert �");
+        customProperties.put("Schl\u00fcssel ��",   "Wert ��");
+        customProperties.put("Schl\u00fcssel ���",  "Wert ���");
+        customProperties.put("Schl\u00fcssel ����", "Wert ����");
         customProperties.put("positive_Integer", POSITIVE_INTEGER);
         customProperties.put("positive_Long", POSITIVE_LONG);
         customProperties.put("positive_Double", POSITIVE_DOUBLE);
@@ -440,10 +440,10 @@ public class TestWriteWellKnown extends TestCase
         final CustomProperties cps = dsi.getCustomProperties();
         assertEquals(customProperties, cps);
         assertNull(cps.get("No value available"));
-        assertEquals("Wert ä", cps.get("Schlüssel ä"));
-        assertEquals("Wert äö", cps.get("Schlüssel äö"));
-        assertEquals("Wert äöü", cps.get("Schlüssel äöü"));
-        assertEquals("Wert äöüß", cps.get("Schlüssel äöüß"));
+        assertEquals("Wert �", cps.get("Schl\u00fcssel �"));
+        assertEquals("Wert ��", cps.get("Schl\u00fcssel ��"));
+        assertEquals("Wert ���", cps.get("Schl\u00fcssel ���"));
+        assertEquals("Wert ����", cps.get("Schl\u00fcssel ����"));
         assertEquals(POSITIVE_INTEGER, cps.get("positive_Integer"));
         assertEquals(POSITIVE_LONG, cps.get("positive_Long"));
         assertEquals(POSITIVE_DOUBLE, cps.get("positive_Double"));
@@ -665,7 +665,7 @@ public class TestWriteWellKnown extends TestCase
      */
     public void testCustomerProperties()
     {
-        final String KEY = "Schlüssel ä";
+        final String KEY = "Schl\u00fcssel �";
         final String VALUE_1 = "Wert 1";
         final String VALUE_2 = "Wert 2";
 
@@ -705,7 +705,7 @@ public class TestWriteWellKnown extends TestCase
     {
         final int ID_1 = 2;
         final int ID_2 = 3;
-        final String NAME_1 = "Schlüssel ä";
+        final String NAME_1 = "Schl\u00fcssel �";
         final String VALUE_1 = "Wert 1";
         final Map dictionary = new HashMap();