poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1713319 - in /poi/trunk/src/ooxml/java/org/apache/poi: poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java xssf/usermodel/helpers/XSSFXmlColumnPr.java xwpf/model/XWPFHeaderFooterPolicy.java xwpf/usermodel/XWPFTableCell.java
Date Sun, 08 Nov 2015 23:14:50 GMT
Author: kiwiwings
Date: Sun Nov  8 23:14:50 2015
New Revision: 1713319

URL: http://svn.apache.org/viewvc?rev=1713319&view=rev
Log:
sonar fixes

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java?rev=1713319&r1=1713318&r2=1713319&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java
Sun Nov  8 23:14:50 2015
@@ -125,7 +125,9 @@ public class KeyInfoSignatureFacet exten
         };
 
         Element n = document.getDocumentElement();
-        DOMSignContext domSignContext = new DOMSignContext(key, n, nextSibling);
+        DOMSignContext domSignContext = (nextSibling == null)
+            ? new DOMSignContext(key, n)
+            : new DOMSignContext(key, n, nextSibling);
         for (Map.Entry<String,String> me : signatureConfig.getNamespacePrefixes().entrySet())
{
             domSignContext.putNamespacePrefix(me.getKey(), me.getValue());
         }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java?rev=1713319&r1=1713318&r2=1713319&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java Sun
Nov  8 23:14:50 2015
@@ -65,14 +65,14 @@ public class XSSFXmlColumnPr {
 	 * @return the local XPath 
 	 */
 	public String getLocalXPath(){
-		String localXPath = "";
+		StringBuilder localXPath = new StringBuilder();
 		int numberOfCommonXPathAxis = table.getCommonXpath().split("/").length-1;
 		
 		String[] xPathTokens = ctXmlColumnPr.getXpath().split("/");
 		for(int i=numberOfCommonXPathAxis; i<xPathTokens.length;i++){
-			localXPath += "/" +xPathTokens[i];
+			localXPath.append("/" +xPathTokens[i]);
 		}
-		return localXPath;
+		return localXPath.toString();
 	}
 
 	public Enum getXmlDataType() {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java?rev=1713319&r1=1713318&r2=1713319&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java Sun Nov
 8 23:14:50 2015
@@ -247,26 +247,6 @@ public class XWPFHeaderFooterPolicy {
         return hdr;
     }
 
-    private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs) {
-        CTHdrFtr ftr = CTHdrFtr.Factory.newInstance();
-        if (paragraphs != null) {
-            for (int i = 0; i < paragraphs.length; i++) {
-                CTP p = ftr.addNewP();
-                //ftr.setPArray(0, paragraphs[i].getCTP());		// MB 23 May 2010
-                ftr.setPArray(i, paragraphs[i].getCTP());    // MB 23 May 2010
-            }
-        } else {
-            CTP p = ftr.addNewP();
-            byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
-            byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
-            p.setRsidP(rsidr);
-            p.setRsidRDefault(rsidrdefault);
-            CTPPr pPr = p.addNewPPr();
-            pPr.addNewPStyle().setVal(pStyle);
-        }
-        return ftr;
-    }
-
     /**
      * MB 24 May 2010. Created this overloaded buildHdrFtr() method because testing demonstrated
      * that the XWPFFooter or XWPFHeader object returned by calls to the createHeader(int,
XWPFParagraph[])

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java?rev=1713319&r1=1713318&r2=1713319&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java Sun Nov  8 23:14:50
2015
@@ -232,7 +232,7 @@ public class XWPFTableCell implements IB
     public XWPFVertAlign getVerticalAlignment() {
         XWPFVertAlign vAlign = null;
         CTTcPr tcpr = ctTc.getTcPr();
-        if (ctTc != null) {
+        if (tcpr != null) {
             CTVerticalJc va = tcpr.getVAlign();
             vAlign = stVertAlignTypeMap.get(va.getVal().intValue());
         }
@@ -488,11 +488,11 @@ public class XWPFTableCell implements IB
         if (table == null) {
             return null;
         }
-        XWPFTableRow tableRow = table.getRow(row);
-        if (tableRow == null) {
+        XWPFTableRow tr = table.getRow(row);
+        if (tr == null) {
             return null;
         }
-        return tableRow.getTableCell(cell);
+        return tr.getTableCell(cell);
     }
 
     public XWPFDocument getXWPFDocument() {



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


Mime
View raw message