poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1773165 - in /poi/trunk/src: examples/src/org/apache/poi/hpsf/examples/ java/org/apache/poi/hpsf/ scratchpad/src/org/apache/poi/hslf/blip/ scratchpad/src/org/apache/poi/hslf/model/ scratchpad/src/org/apache/poi/hslf/model/textproperties/ s...
Date Wed, 07 Dec 2016 23:45:38 GMT
Author: kiwiwings
Date: Wed Dec  7 23:45:38 2016
New Revision: 1773165

URL: http://svn.apache.org/viewvc?rev=1773165&view=rev
Log:
SonarCube fix - make members private

Modified:
    poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java
    poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java
    poi/trunk/src/java/org/apache/poi/hpsf/Property.java
    poi/trunk/src/java/org/apache/poi/hpsf/VariantSupport.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPFont.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextProp.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExControl.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordContainer.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java

Modified: poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java Wed Dec  7 23:45:38
2016
@@ -288,9 +288,9 @@ public class CopyCompare
      * MutablePropertySet#MutablePropertySet(PropertySet)} constructor.</p>
      */
     static class CopyFile implements POIFSReaderListener {
-        String dstName;
-        OutputStream out;
-        POIFSFileSystem poiFs;
+        private String dstName;
+        private OutputStream out;
+        private POIFSFileSystem poiFs;
 
 
         /**

Modified: poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java Wed Dec
 7 23:45:38 2016
@@ -131,9 +131,9 @@ public class WriteAuthorAndTitle
      */
     static class ModifySICopyTheRest implements POIFSReaderListener
     {
-        String dstName;
-        OutputStream out;
-        POIFSFileSystem poiFs;
+        private String dstName;
+        private OutputStream out;
+        private POIFSFileSystem poiFs;
 
 
         /**

Modified: poi/trunk/src/java/org/apache/poi/hpsf/Property.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/Property.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/Property.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/Property.java Wed Dec  7 23:45:38 2016
@@ -65,7 +65,7 @@ public class Property {
     private long type;
 
     /** The property's value. */
-    protected Object value;
+    private Object value;
 
 
     /**

Modified: poi/trunk/src/java/org/apache/poi/hpsf/VariantSupport.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/VariantSupport.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/VariantSupport.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/VariantSupport.java Wed Dec  7 23:45:38 2016
@@ -62,7 +62,7 @@ public class VariantSupport extends Vari
      * Keeps a list of the variant types an "unsupported" message has already
      * been issued for.
      */
-    protected static List<Long> unsupportedMessage;
+    private static List<Long> unsupportedMessage;
 
     
     /**

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java Wed Dec  7 23:45:38 2016
@@ -65,11 +65,11 @@ public final class EMF extends Metafile
         ImageHeaderEMF nHeader = new ImageHeaderEMF(data, 0);
         
         Header header = new Header();
-        header.wmfsize = data.length;
-        header.bounds = nHeader.getBounds();
+        header.setWmfSize(data.length);
+        header.setBounds(nHeader.getBounds());
         Dimension nDim = nHeader.getSize();
-        header.size = new Dimension(Units.toEMU(nDim.getWidth()), Units.toEMU(nDim.getHeight()));
-        header.zipsize = compressed.length;
+        header.setDimension(new Dimension(Units.toEMU(nDim.getWidth()), Units.toEMU(nDim.getHeight())));
+        header.setZipSize(compressed.length);
 
         byte[] checksum = getChecksum(data);
         ByteArrayOutputStream out = new ByteArrayOutputStream();

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java Wed Dec  7 23:45:38
2016
@@ -46,32 +46,32 @@ public abstract class Metafile extends H
         /**
          * size of the original file
          */
-        public int wmfsize;
+        private int wmfsize;
 
         /**
          * Boundary of the metafile drawing commands
          */
-        public Rectangle bounds;
+        private final Rectangle bounds = new Rectangle();
 
         /**
          *  Size of the metafile in EMUs
          */
-        public Dimension size;
+        private final Dimension size = new Dimension();
 
         /**
          * size of the compressed metafile data
          */
-        public int zipsize;
+        private int zipsize;
 
         /**
          * Reserved. Always 0.
          */
-        public int compression = 0;
+        private int compression = 0;
 
         /**
          * Reserved. Always 254.
          */
-        public int filter = 254;
+        private int filter = 254;
 
         public void read(byte[] data, int offset){
             int pos = offset;
@@ -82,11 +82,11 @@ public abstract class Metafile extends H
             int right = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE;
             int bottom = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE;
 
-            bounds = new Rectangle(left, top, right-left, bottom-top);
+            bounds.setBounds(left, top, right-left, bottom-top);
             int width = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE;
             int height = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE;
 
-            size = new Dimension(width, height);
+            size.setSize(width, height);
 
             zipsize = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE;
 
@@ -120,6 +120,26 @@ public abstract class Metafile extends H
         public int getWmfSize() {
             return wmfsize;
         }
+        
+        protected void setWmfSize(int wmfSize) {
+            this.wmfsize = wmfSize;
+        }
+        
+        protected void setZipSize(int zipSize) {
+            this.zipsize = zipSize;
+        }
+
+        public Rectangle getBounds() {
+            return (Rectangle)bounds.clone();
+        }
+        
+        protected void setBounds(Rectangle bounds) {
+            this.bounds.setBounds(bounds);
+        }
+        
+        protected void setDimension(Dimension size) {
+            this.size.setSize(size);
+        }
     }
 
     protected static byte[] compress(byte[] bytes, int offset, int length) throws IOException
{

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java Wed Dec  7 23:45:38 2016
@@ -94,12 +94,13 @@ public final class PICT extends Metafile
         ImageHeaderPICT nHeader = new ImageHeaderPICT(data, nOffset);
         
         Header header = new Header();
-        header.wmfsize = data.length - nOffset;
-        byte[] compressed = compress(data, nOffset, header.wmfsize);
-        header.zipsize = compressed.length;
-        header.bounds = nHeader.getBounds();
+        int wmfSize = data.length - nOffset;
+        header.setWmfSize(wmfSize);
+        byte[] compressed = compress(data, nOffset, wmfSize);
+        header.setZipSize(compressed.length);
+        header.setBounds(nHeader.getBounds());
         Dimension nDim = nHeader.getSize();
-        header.size = new Dimension(Units.toEMU(nDim.getWidth()), Units.toEMU(nDim.getHeight()));
+        header.setDimension(new Dimension(Units.toEMU(nDim.getWidth()), Units.toEMU(nDim.getHeight())));
 
         byte[] checksum = getChecksum(data);
         ByteArrayOutputStream out = new ByteArrayOutputStream();

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java Wed Dec  7 23:45:38 2016
@@ -45,7 +45,7 @@ public final class WMF extends Metafile
             long len = is.skip(header.getSize() + CHECKSUM_SIZE*uidInstanceCount);
             assert(len == header.getSize() + CHECKSUM_SIZE*uidInstanceCount);
 
-            ImageHeaderWMF aldus = new ImageHeaderWMF(header.bounds);
+            ImageHeaderWMF aldus = new ImageHeaderWMF(header.getBounds());
             aldus.write(out);
 
             InflaterInputStream inflater = new InflaterInputStream( is );
@@ -70,11 +70,11 @@ public final class WMF extends Metafile
         byte[] compressed = compress(data, pos, data.length-pos);
 
         Header header = new Header();
-        header.wmfsize = data.length - nHeader.getLength();
-        header.bounds = nHeader.getBounds();
+        header.setWmfSize(data.length - nHeader.getLength());
+        header.setBounds(nHeader.getBounds());
         Dimension nDim = nHeader.getSize();
-        header.size = new Dimension(Units.toEMU(nDim.getWidth()), Units.toEMU(nDim.getHeight()));
-        header.zipsize = compressed.length;
+        header.setDimension(new Dimension(Units.toEMU(nDim.getWidth()), Units.toEMU(nDim.getHeight())));
+        header.setZipSize(compressed.length);
 
         byte[] checksum = getChecksum(data);
         ByteArrayOutputStream out = new ByteArrayOutputStream();

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java Wed Dec  7 23:45:38
2016
@@ -38,11 +38,9 @@ import org.apache.poi.util.POILogger;
 
 /**
  * A shape representing embedded OLE obejct.
- *
- * @author Yegor Kozlov
  */
 public final class OLEShape extends HSLFPictureShape {
-    protected ExEmbed _exEmbed;
+    private ExEmbed _exEmbed;
 
     /**
      * Create a new <code>OLEShape</code>

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPFont.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPFont.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPFont.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPFont.java Wed Dec  7 23:45:38
2016
@@ -80,11 +80,11 @@ public final class PPFont {
     public final static byte FF_DECORATIVE  = 80;
 
 
-    protected int charset;
-    protected int type;
-    protected int flags;
-    protected int pitch;
-    protected String name;
+    private int charset;
+    private int type;
+    private int flags;
+    private int pitch;
+    private String name;
 
     /**
      * Creates a new instance of PPFont

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java Wed Dec  7 23:45:38
2016
@@ -68,12 +68,10 @@ import org.apache.poi.util.SuppressForbi
 
 /**
  * Translates Graphics2D calls into PowerPoint.
- *
- * @author Yegor Kozlov
  */
 public final class PPGraphics2D extends Graphics2D implements Cloneable {
 
-    protected POILogger log = POILogFactory.getLogger(this.getClass());
+    private static final POILogger LOG = POILogFactory.getLogger(PPGraphics2D.class);
 
     //The ppt object to write into.
     private HSLFGroupShape _group;
@@ -392,8 +390,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public void clip(Shape s){
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
     }
 
@@ -415,8 +413,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public Shape getClip(){
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
         return null;
     }
@@ -686,8 +684,8 @@ public final class PPGraphics2D extends
     public boolean drawImage(Image img, int x, int y,
                              Color bgcolor,
                              ImageObserver observer){
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
 
         return false;
@@ -736,8 +734,8 @@ public final class PPGraphics2D extends
                              int width, int height,
                              Color bgcolor,
                              ImageObserver observer){
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
 
         return false;
@@ -796,8 +794,8 @@ public final class PPGraphics2D extends
                              int dx1, int dy1, int dx2, int dy2,
                              int sx1, int sy1, int sx2, int sy2,
                              ImageObserver observer){
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
         return false;
     }
@@ -861,8 +859,8 @@ public final class PPGraphics2D extends
                              int sx1, int sy1, int sx2, int sy2,
                              Color bgcolor,
                              ImageObserver observer){
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
         return false;
     }
@@ -902,8 +900,8 @@ public final class PPGraphics2D extends
     @NotImplemented
     public boolean drawImage(Image img, int x, int y,
                              ImageObserver observer) {
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
         return false;
     }
@@ -1089,8 +1087,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public void setClip(Shape clip) {
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
     }
 
@@ -1389,8 +1387,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public void setComposite(Composite comp){
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
     }
 
@@ -1403,8 +1401,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public Composite getComposite(){
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
         return null;
     }
@@ -1547,8 +1545,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public void drawString(AttributedCharacterIterator iterator, float x, float y) {
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
     }
 
@@ -1654,8 +1652,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) {
-         if (log.check(POILogger.WARN)) {
-             log.log(POILogger.WARN, "Not implemented");
+         if (LOG.check(POILogger.WARN)) {
+             LOG.log(POILogger.WARN, "Not implemented");
          }
         return false;
     }
@@ -1700,8 +1698,8 @@ public final class PPGraphics2D extends
     public boolean drawImage(Image img, int x, int y,
                              int width, int height,
                              ImageObserver observer) {
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
         return false;
     }
@@ -1751,8 +1749,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public void setXORMode(Color c1) {
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
     }
 
@@ -1765,8 +1763,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public void setPaintMode() {
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
     }
 
@@ -1803,8 +1801,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public void drawRenderedImage(RenderedImage img, AffineTransform xform) {
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
     }
 
@@ -1831,8 +1829,8 @@ public final class PPGraphics2D extends
      */
     @NotImplemented
     public void drawRenderableImage(RenderableImage img, AffineTransform xform) {
-        if (log.check(POILogger.WARN)) {
-            log.log(POILogger.WARN, "Not implemented");
+        if (LOG.check(POILogger.WARN)) {
+            LOG.log(POILogger.WARN, "Not implemented");
         }
     }
 

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java
(original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/BitMaskTextProp.java
Wed Dec  7 23:45:38 2016
@@ -40,9 +40,8 @@ public abstract class BitMaskTextProp ex
 	public boolean[] getSubPropMatches() { return subPropMatches; }
 
 	protected BitMaskTextProp(int sizeOfDataBlock, int maskInHeader, String overallName, String...
subPropNames) {
-		super(sizeOfDataBlock,maskInHeader,"bitmask");
+		super(sizeOfDataBlock,maskInHeader,overallName);
 		this.subPropNames = subPropNames;
-		this.propName = overallName;
 		subPropMasks = new int[subPropNames.length];
 		subPropMatches = new boolean[subPropNames.length];
 		
@@ -91,7 +90,7 @@ public abstract class BitMaskTextProp ex
 	 */
 	@Override
 	public int getValue() {
-	    return maskValue(dataValue);
+	    return maskValue(super.getValue());
 	}
 
 	private int maskValue(int pVal) {
@@ -111,7 +110,7 @@ public abstract class BitMaskTextProp ex
 	 */
 	@Override
 	public void setValue(int val) { 
-		dataValue = val;
+		super.setValue(val);
 
 		// Figure out the values of the sub properties
 		int i = 0;
@@ -128,8 +127,8 @@ public abstract class BitMaskTextProp ex
 	 */
 	public void setValueWithMask(int val, int writeMask) {
 	    setWriteMask(writeMask);
-	    dataValue = maskValue(val);
-	    if (val != dataValue) {
+	    super.setValue(maskValue(val));
+	    if (val != super.getValue()) {
 	        logger.log(POILogger.WARN, "Style properties of '"+getName()+"' don't match mask
- output will be sanitized");
 	        if (logger.check(POILogger.DEBUG)) {
 	            StringBuilder sb = new StringBuilder("The following style attributes of the
'"+getName()+"' property will be ignored:\n");
@@ -149,7 +148,7 @@ public abstract class BitMaskTextProp ex
 	 * Fetch the true/false status of the subproperty with the given index
 	 */
 	public boolean getSubValue(int idx) {
-		return subPropMatches[idx] && ((dataValue & subPropMasks[idx]) != 0);
+		return subPropMatches[idx] && ((super.getValue() & subPropMasks[idx]) != 0);
 	}
 
 	/**
@@ -157,11 +156,13 @@ public abstract class BitMaskTextProp ex
 	 */
 	public void setSubValue(boolean value, int idx) {
         subPropMatches[idx] = true;
+        int newVal = super.getValue();
         if (value) {
-            dataValue |= subPropMasks[idx];
+            newVal |= subPropMasks[idx];
         } else {
-            dataValue &= ~subPropMasks[idx];
+            newVal &= ~subPropMasks[idx];
         }
+        super.setValue(newVal);
 	}
 	
 	@Override

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextProp.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextProp.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextProp.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextProp.java Wed
Dec  7 23:45:38 2016
@@ -31,10 +31,10 @@ import java.util.Locale;
  *  TextProps is stored in the different record classes 
  */
 public class TextProp implements Cloneable {
-	protected int sizeOfDataBlock; // Number of bytes the data part uses
-	protected String propName;
-	protected int dataValue;
-	protected int maskInHeader;
+	private int sizeOfDataBlock; // Number of bytes the data part uses
+	private String propName;
+	private int dataValue;
+	private int maskInHeader;
 
 	/** 
 	 * Generate the definition of a given type of text property.

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java Wed Dec
 7 23:45:38 2016
@@ -26,13 +26,13 @@ import org.apache.poi.util.*;
  * the slide layout as specified in the SlideAtom record.
  */
 public class EscherPlaceholder extends EscherRecord {
-    public static final short RECORD_ID = (short)RecordTypes.OEPlaceholderAtom.typeID;
+    public static final short RECORD_ID = RecordTypes.OEPlaceholderAtom.typeID;
     public static final String RECORD_DESCRIPTION = "msofbtClientTextboxPlaceholder";
 
-    int position = -1;
-    byte placementId = 0;
-    byte size = 0;
-    short unused = 0;
+    private int position = -1;
+    private byte placementId = 0;
+    private byte size = 0;
+    private short unused = 0;
     
     public EscherPlaceholder() {}
     

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExControl.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExControl.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExControl.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExControl.java Wed Dec  7 23:45:38
2016
@@ -50,9 +50,7 @@ public final class ExControl extends ExE
      * Create a new ExEmbed, with blank fields
      */
     public ExControl() {
-        super();
-
-        _children[0] = embedAtom = new ExControlAtom();
+        super(new ExControlAtom());
     }
 
     /**

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java Wed Dec  7 23:45:38
2016
@@ -25,8 +25,6 @@ import org.apache.poi.util.POILogger;
 
 /**
  * This data represents an embedded object in the document.
- *
- * @author Daniel Noll
  */
 public class ExEmbed extends RecordContainer {
 
@@ -36,7 +34,7 @@ public class ExEmbed extends RecordConta
     private byte[] _header;
 
     // Links to our more interesting children
-    protected RecordAtom embedAtom;
+    private RecordAtom embedAtom;
     private ExOleObjAtom oleObjAtom;
     private CString menuName;
     private CString progId;
@@ -60,6 +58,18 @@ public class ExEmbed extends RecordConta
     }
 
     /**
+     * Constructor for derived classes
+     *
+     * @param embedAtom the new embedAtom
+     */
+    protected ExEmbed(RecordAtom embedAtom) {
+        this();
+        _children[0] = this.embedAtom = embedAtom;
+    }
+    
+    
+    
+    /**
      * Create a new ExEmbed, with blank fields
      */
     public ExEmbed() {
@@ -182,6 +192,7 @@ public class ExEmbed extends RecordConta
     {
         if(clipboardName != null) clipboardName.setText(s);
     }
+    
     /**
      * Returns the type (held as a little endian in bytes 3 and 4)
      * that this class handles.

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExOleObjStg.java Wed Dec  7 23:45:38
2016
@@ -31,10 +31,8 @@ import org.apache.poi.util.LittleEndian;
 
 /**
  * Storage for embedded OLE objects.
- *
- * @author Daniel Noll
  */
-public class ExOleObjStg extends RecordAtom implements PositionDependentRecord, PersistRecord
{
+public class ExOleObjStg extends PositionDependentRecordAtom implements PersistRecord {
 
     private int _persistId; // Found from PersistPtrHolder
 
@@ -47,7 +45,7 @@ public class ExOleObjStg extends RecordA
      * Record data.
      */
     private byte[] _data;
-
+    
     /**
      * Constructs a new empty storage container.
      */
@@ -179,22 +177,8 @@ public class ExOleObjStg extends RecordA
         _persistId = id;
     }
 
-    /** Our location on the disk, as of the last write out */
-    protected int myLastOnDiskOffset;
-
-    /** Fetch our location on the disk, as of the last write out */
-    public int getLastOnDiskOffset() { return myLastOnDiskOffset; }
-
-    /**
-     * Update the Record's idea of where on disk it lives, after a write out.
-     * Use with care...
-     */
-    public void setLastOnDiskOffset(int offset) {
-        myLastOnDiskOffset = offset;
-    }
-
     @Override
     public void updateOtherRecordReferences(Map<Integer,Integer> oldToNewReferencesLookup)
{
         // nothing to update
     }
-}
+}
\ No newline at end of file

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java
(original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java
Wed Dec  7 23:45:38 2016
@@ -22,14 +22,12 @@ import java.util.Map;
  * A special (and dangerous) kind of Record Atom that cares about where
  *  it lives on the disk, or who has other Atoms that care about where
  *  this is on the disk.
- *
- * @author Nick Burch
  */
 
 public abstract class PositionDependentRecordAtom extends RecordAtom implements PositionDependentRecord
 {
 	/** Our location on the disk, as of the last write out */
-	protected int myLastOnDiskOffset;
+	private int myLastOnDiskOffset;
 
 	/** Fetch our location on the disk, as of the last write out */
 	public int getLastOnDiskOffset() { return myLastOnDiskOffset; }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordContainer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordContainer.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordContainer.java
(original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordContainer.java
Wed Dec  7 23:45:38 2016
@@ -22,8 +22,6 @@ import java.util.Map;
  * A special (and dangerous) kind of Record Container, for which other
  *  Atoms care about where this one lives on disk.
  * Will track its position on disk.
- *
- * @author Nick Burch
  */
 
 public abstract class PositionDependentRecordContainer extends RecordContainer implements
PositionDependentRecord
@@ -43,7 +41,7 @@ public abstract class PositionDependentR
 
 
 	/** Our location on the disk, as of the last write out */
-	protected int myLastOnDiskOffset;
+	private int myLastOnDiskOffset;
 
 	/** Fetch our location on the disk, as of the last write out */
 	public int getLastOnDiskOffset() { return myLastOnDiskOffset; }
@@ -61,6 +59,5 @@ public abstract class PositionDependentR
 	 * If we're told they have, just return straight off.
 	 */
 	public void updateOtherRecordReferences(Map<Integer,Integer> oldToNewReferencesLookup)
{
-		return;
 	}
 }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java Wed Dec
 7 23:45:38 2016
@@ -155,7 +155,7 @@ public final class TextSpecInfoAtom exte
      */
     public int getCharactersCovered(){
         int covered = 0;
-        for (TextSpecInfoRun r : getTextSpecInfoRuns()) covered += r.length;
+        for (TextSpecInfoRun r : getTextSpecInfoRuns()) covered += r.getLength();
         return covered;
     }
 

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java?rev=1773165&r1=1773164&r2=1773165&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java Wed Dec 
7 23:45:38 2016
@@ -74,10 +74,10 @@ public class TextSpecInfoRun {
     private static final BitField grammarErrorFld = new BitField(0X80000000);
     
     //Length of special info run.
-    protected int length;
+    private int length;
 
     //Special info mask of this run;
-    protected int mask;
+    private int mask;
 
     // info fields as indicated by the mask.
     // -1 means the bit is not set
@@ -92,7 +92,7 @@ public class TextSpecInfoRun {
      * grammar (1 bit): A bit that specifies whether the text has a grammar error.<br>
      * reserved (13 bits): MUST be zero and MUST be ignored.
      */
-    protected short spellInfo = -1;
+    private short spellInfo = -1;
     
     /**
      * An optional TxLCID that specifies the language identifier of this text.
@@ -103,13 +103,13 @@ public class TextSpecInfoRun {
      * 0x0400 = No proofing is performed on the text.<br>
      * &gt; 0x0400 = A valid LCID as specified by [MS-LCID].
      */
-    protected short langId = -1;
+    private short langId = -1;
     
     /**
      * An optional TxLCID that specifies the alternate language identifier of this text.
      * It MUST exist if and only if altLang is TRUE.
      */
-    protected short altLangId = -1;
+    private short altLangId = -1;
     
     /**
      * An optional signed integer that specifies whether the text contains bidirectional
@@ -117,10 +117,10 @@ public class TextSpecInfoRun {
      * 0x0000 = Contains no bidirectional characters,
      * 0x0001 = Contains bidirectional characters.
      */
-    protected short bidi = -1;
+    private short bidi = -1;
     
-    protected int pp10extMask = -1;
-    protected byte[] smartTagsBytes = null;
+    private int pp10extMask = -1;
+    private byte[] smartTagsBytes = null;
 
     /**
      * Inits a TextSpecInfoRun with default values




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


Mime
View raw message