]> source.dussan.org Git - poi.git/commitdiff
#58597: Remove setAccessible (more coming soon)
authorUwe Schindler <uschindler@apache.org>
Wed, 11 Nov 2015 07:41:54 +0000 (07:41 +0000)
committerUwe Schindler <uschindler@apache.org>
Wed, 11 Nov 2015 07:41:54 +0000 (07:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1713770 13f79535-47bb-0310-9956-ffa450edef68

22 files changed:
src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java
src/java/org/apache/poi/hssf/usermodel/HSSFComment.java
src/java/org/apache/poi/hssf/usermodel/HSSFObjectData.java
src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java
src/java/org/apache/poi/hssf/usermodel/HSSFPolygon.java
src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java
src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
src/java/org/apache/poi/hssf/usermodel/HSSFSimpleShape.java
src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java
src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
src/java/org/apache/poi/poifs/dev/POIFSDump.java
src/java/org/apache/poi/poifs/dev/POIFSHeaderDumper.java
src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java
src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java
src/java/org/apache/poi/poifs/storage/BlockListImpl.java
src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
src/testcases/org/apache/poi/hssf/usermodel/HSSFTestHelper.java
src/testcases/org/apache/poi/hssf/usermodel/TestCloneSheet.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java
src/testcases/org/apache/poi/hssf/usermodel/TestPatriarch.java

index 94ba90bed494bdb7a7d6eafa5d7b40fa5b1eb97f..4d6acf96273f286b9e62bf2efc067e26e8f4b538 100644 (file)
@@ -24,14 +24,12 @@ import java.io.FileOutputStream;
 import java.io.IOException;\r
 import java.io.InputStream;\r
 import java.io.OutputStream;\r
-import java.lang.reflect.Field;\r
 import java.util.ArrayList;\r
 import java.util.List;\r
 \r
 import org.apache.poi.ddf.EscherRecord;\r
 import org.apache.poi.hssf.model.InternalWorkbook;\r
 import org.apache.poi.hssf.record.DrawingGroupRecord;\r
-import org.apache.poi.hssf.record.EscherAggregate;\r
 import org.apache.poi.hssf.usermodel.HSSFPatriarch;\r
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;\r
 import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;\r
@@ -137,7 +135,7 @@ public class BiffDrawingToXml {
     public static void writeToFile(OutputStream fos, InputStream xlsWorkbook, boolean excludeWorkbookRecords, String[] params) throws IOException {\r
         NPOIFSFileSystem fs = new NPOIFSFileSystem(xlsWorkbook);\r
         HSSFWorkbook workbook = new HSSFWorkbook(fs);\r
-        InternalWorkbook internalWorkbook = getInternalWorkbook(workbook);\r
+        InternalWorkbook internalWorkbook = workbook.getInternalWorkbook();\r
         DrawingGroupRecord r = (DrawingGroupRecord) internalWorkbook.findFirstRecordBySid(DrawingGroupRecord.sid);\r
         r.decode();\r
 \r
@@ -155,7 +153,7 @@ public class BiffDrawingToXml {
             HSSFPatriarch p = workbook.getSheetAt(i).getDrawingPatriarch();\r
             if(p != null ) {\r
                 builder.append(tab).append("<sheet").append(i).append(">\n");\r
-                builder.append(getHSSFPatriarchBoundAggregate(p).toXml(tab + "\t"));\r
+                builder.append(p.getBoundAggregate().toXml(tab + "\t"));\r
                 builder.append(tab).append("</sheet").append(i).append(">\n");\r
             }\r
         }\r
@@ -164,31 +162,4 @@ public class BiffDrawingToXml {
         fos.close();\r
     }\r
 \r
-    private static EscherAggregate getHSSFPatriarchBoundAggregate(HSSFPatriarch patriarch) {\r
-        Field boundAggregateField = null;\r
-        try {\r
-            boundAggregateField = patriarch.getClass().getDeclaredField("_boundAggregate");\r
-            boundAggregateField.setAccessible(true);\r
-            return (EscherAggregate) boundAggregateField.get(patriarch);\r
-        } catch (NoSuchFieldException e) {\r
-            e.printStackTrace();\r
-        } catch (IllegalAccessException e) {\r
-            e.printStackTrace();\r
-        }\r
-        return null;\r
-    }\r
-\r
-    private static InternalWorkbook getInternalWorkbook(HSSFWorkbook workbook) {\r
-        Field internalSheetField = null;\r
-        try {\r
-            internalSheetField = workbook.getClass().getDeclaredField("workbook");\r
-            internalSheetField.setAccessible(true);\r
-            return (InternalWorkbook) internalSheetField.get(workbook);\r
-        } catch (NoSuchFieldException e) {\r
-            e.printStackTrace();\r
-        } catch (IllegalAccessException e) {\r
-            e.printStackTrace();\r
-        }\r
-        return null;\r
-    }\r
 }\r
index 4e71ac2b83e6037342bce00e1561d8c9b4910e60..1b8176b3ce789299d23e95e5099b42b02b6979d3 100644 (file)
@@ -87,7 +87,7 @@ public class HSSFComment extends HSSFTextbox implements Comment {
     @Override
     void afterInsert(HSSFPatriarch patriarch) {
         super.afterInsert(patriarch);
-        patriarch._getBoundAggregate().addTailRecord(getNoteRecord());
+        patriarch.getBoundAggregate().addTailRecord(getNoteRecord());
     }
 
     @Override
@@ -253,7 +253,7 @@ public class HSSFComment extends HSSFTextbox implements Comment {
 
     public void afterRemove(HSSFPatriarch patriarch){
         super.afterRemove(patriarch);
-        patriarch._getBoundAggregate().removeTailRecord(getNoteRecord());
+        patriarch.getBoundAggregate().removeTailRecord(getNoteRecord());
     }
 
     @Override
index ef1f2d9f730f5e1c9264c8100fd73078a4cfffb6..d92f216ab114da1d4cebd70f56ce64ae9d095aa4 100644 (file)
@@ -126,7 +126,7 @@ public final class HSSFObjectData extends HSSFPicture {
 
     @Override
     void afterInsert(HSSFPatriarch patriarch) {
-        EscherAggregate agg = patriarch._getBoundAggregate();
+        EscherAggregate agg = patriarch.getBoundAggregate();
         agg.associateShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID), getObjRecord());
         EscherBSERecord bse =
                 patriarch.getSheet().getWorkbook().getWorkbook().getBSERecord(getPictureIndex());
index 04f57b493111a0b7cc1cd8f4bd84932316dbdfac..b431687459999f6d8136af59517936281c483169 100644 (file)
@@ -495,7 +495,8 @@ public final class HSSFPatriarch implements HSSFShapeContainer, Drawing {
      * Returns the aggregate escher record we're bound to
      * @return - low level representation of sheet drawing data
      */
-    protected EscherAggregate _getBoundAggregate() {
+    @Internal
+    public EscherAggregate getBoundAggregate() {
         return _boundAggregate;
     }
 
index 4de4a40f22557a2b80f5761e7538da9763b30900..7ee9a0693649788b4fc7ac1accd448a883210a5e 100644 (file)
@@ -211,7 +211,7 @@ public class HSSFPicture extends HSSFSimpleShape implements Picture {
 
     @Override
     void afterInsert(HSSFPatriarch patriarch) {
-        EscherAggregate agg = patriarch._getBoundAggregate();
+        EscherAggregate agg = patriarch.getBoundAggregate();
         agg.associateShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID), getObjRecord());
         EscherBSERecord bse =
                 patriarch.getSheet().getWorkbook().getWorkbook().getBSERecord(getPictureIndex());
index df1b765c748bef288fa1d630ce3165975d89efb6..8403a81c4b5791f83a954199304d11b8caffdce4 100644 (file)
@@ -116,7 +116,7 @@ public class HSSFPolygon  extends HSSFSimpleShape {
 
     @Override
     protected void afterRemove(HSSFPatriarch patriarch) {
-        patriarch._getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID));
+        patriarch.getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID));
     }
 
     /**
index 66440005b26d059ce24f472049c8c746f6967395..f97b23a8c0ed392f5a65c5c289e9f844ea38edda 100644 (file)
@@ -122,7 +122,7 @@ public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer {
 
     @Override
     protected void afterRemove(HSSFPatriarch patriarch) {
-        patriarch._getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildContainers().get(0)
+        patriarch.getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildContainers().get(0)
                 .getChildById(EscherClientDataRecord.RECORD_ID));
         for ( int i=0; i<shapes.size(); i++ ) {
             HSSFShape shape = shapes.get(i);
@@ -314,7 +314,7 @@ public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer {
 
     @Override
     void afterInsert(HSSFPatriarch patriarch){
-        EscherAggregate agg = patriarch._getBoundAggregate();
+        EscherAggregate agg = patriarch.getBoundAggregate();
         EscherContainerRecord containerRecord = getEscherContainer().getChildById(EscherContainerRecord.SP_CONTAINER);
         agg.associateShapeToObjRecord(containerRecord.getChildById(EscherClientDataRecord.RECORD_ID), getObjRecord());
     }
index 8f8756ed9637c1fc30d8140646a42d22cc8f57f5..e0694f240379ceb825022471db2855d320bfbb4a 100644 (file)
@@ -148,7 +148,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet {
         }
         if (getDrawingPatriarch() != null) {
             HSSFPatriarch patr = HSSFPatriarch.createPatriarch(this.getDrawingPatriarch(), sheet);
-            sheet._sheet.getRecords().add(pos, patr._getBoundAggregate());
+            sheet._sheet.getRecords().add(pos, patr.getBoundAggregate());
             sheet._patriarch = patr;
         }
         return sheet;
index 2e8b64d8445704607d6f03039105d40aa3fffff0..ec5293bbee26b186c09a1add2ea116f40a18db84 100644 (file)
@@ -144,9 +144,9 @@ public class HSSFSimpleShape extends HSSFShape
 
     @Override
     protected void afterRemove(HSSFPatriarch patriarch) {
-        patriarch._getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID));
+        patriarch.getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID));
         if (null != getEscherContainer().getChildById(EscherTextboxRecord.RECORD_ID)){
-            patriarch._getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherTextboxRecord.RECORD_ID));
+            patriarch.getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherTextboxRecord.RECORD_ID));
         }
     }
 
@@ -177,7 +177,7 @@ public class HSSFSimpleShape extends HSSFShape
 
     @Override
     void afterInsert(HSSFPatriarch patriarch){
-        EscherAggregate agg = patriarch._getBoundAggregate();
+        EscherAggregate agg = patriarch.getBoundAggregate();
         agg.associateShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID), getObjRecord());
 
         if (null != getTextObjectRecord()){
@@ -244,7 +244,7 @@ public class HSSFSimpleShape extends HSSFShape
             escherTextbox.setRecordId(EscherTextboxRecord.RECORD_ID);
             escherTextbox.setOptions((short) 0x0000);
             getEscherContainer().addChildRecord(escherTextbox);
-            getPatriarch()._getBoundAggregate().associateShapeToObjRecord(escherTextbox, _textObjectRecord);
+            getPatriarch().getBoundAggregate().associateShapeToObjRecord(escherTextbox, _textObjectRecord);
         }
         return _textObjectRecord;
     }
index 28dc60a478332f71e3f6b48282f9b92ac2a131b6..f8f81c1f066b83a6cd529cc241dd158a843a169a 100644 (file)
@@ -128,7 +128,7 @@ public class HSSFTextbox extends HSSFSimpleShape {
 
     @Override
     void afterInsert(HSSFPatriarch patriarch) {
-        EscherAggregate agg = patriarch._getBoundAggregate();
+        EscherAggregate agg = patriarch.getBoundAggregate();
         agg.associateShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID), getObjRecord());
         if (getTextObjectRecord() != null){
             agg.associateShapeToObjRecord(getEscherContainer().getChildById(EscherTextboxRecord.RECORD_ID), getTextObjectRecord());
@@ -240,7 +240,7 @@ public class HSSFTextbox extends HSSFSimpleShape {
 
     @Override
     protected void afterRemove(HSSFPatriarch patriarch) {
-        patriarch._getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID));
-        patriarch._getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherTextboxRecord.RECORD_ID));
+        patriarch.getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID));
+        patriarch.getBoundAggregate().removeShapeToObjRecord(getEscherContainer().getChildById(EscherTextboxRecord.RECORD_ID));
     }
 }
index fe1eb26d1a965cc9d68ba3758e0800fa378ba904..2192fa3dcd686f3c3e63e79468b922eea34d2112 100644 (file)
@@ -89,6 +89,7 @@ import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.WorkbookUtil;
 import org.apache.poi.util.Configurator;
 import org.apache.poi.util.HexDump;
+import org.apache.poi.util.Internal;
 import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
@@ -2147,4 +2148,9 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
     public DirectoryNode getRootDirectory(){
         return directory;
     }
+    
+    @Internal
+    public InternalWorkbook getInternalWorkbook() {
+        return workbook;
+    }
 }
index ce7d9e441af06f8b4883ab5940d0d666ff1d7644..be57446c4885ecf4854f63194ba61e1a0cec7708 100644 (file)
@@ -21,7 +21,6 @@ import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.lang.reflect.Field;
 import java.nio.ByteBuffer;
 import java.util.Iterator;
 
@@ -73,11 +72,11 @@ public class POIFSDump {
             dump(root, file);
             
             if (dumpProps) {
-                HeaderBlock header = getHeaderBlock(fs);
+                HeaderBlock header = fs.getHeaderBlock();
                 dump(fs, header.getPropertyStart(), "properties", file);
             }
             if (dumpMini) {
-                NPropertyTable props = getPropertyTable(fs);
+                NPropertyTable props = fs.getPropertyTable();
                 int startBlock = props.getRoot().getStartBlock(); 
                 if (startBlock == POIFSConstants.END_OF_CHAIN) {
                     System.err.println("No Mini Stream in file");
@@ -86,21 +85,8 @@ public class POIFSDump {
                 }
             }
         }
-   }
-    
-    protected static HeaderBlock getHeaderBlock(NPOIFSFileSystem fs) throws Exception {
-        Field headerF = NPOIFSFileSystem.class.getDeclaredField("_header");
-        headerF.setAccessible(true);
-        HeaderBlock header = (HeaderBlock)headerF.get(fs);
-        return header;
-    }
-    protected static NPropertyTable getPropertyTable(NPOIFSFileSystem fs) throws Exception {
-        Field ptF = NPOIFSFileSystem.class.getDeclaredField("_property_table");
-        ptF.setAccessible(true);
-        NPropertyTable table = (NPropertyTable)ptF.get(fs);
-        return table;
     }
-
+    
     public static void dump(DirectoryEntry root, File parent) throws IOException {
         for(Iterator<Entry> it = root.getEntries(); it.hasNext();){
             Entry entry = it.next();
index e321c8b9b70a65afe3ab5d1415d327e3c0ca8dd7..642ffa0f98b8c39e6d0fc987715b396f9249aaa1 100644 (file)
@@ -19,8 +19,6 @@ package org.apache.poi.poifs.dev;
 
 import java.io.FileInputStream;
 import java.io.InputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
 
 import org.apache.poi.poifs.common.POIFSBigBlockSize;
 import org.apache.poi.poifs.common.POIFSConstants;
@@ -118,11 +116,8 @@ public class POIFSHeaderDumper {
         System.out.println("Raw Blocks Details:");
         System.out.println(" Number of blocks: " + data_blocks.blockCount());
 
-        Method gbm = data_blocks.getClass().getSuperclass().getDeclaredMethod("get", int.class);
-        gbm.setAccessible(true);
-
         for(int i=0; i<Math.min(16, data_blocks.blockCount()); i++) {
-            ListManagedBlock block = (ListManagedBlock)gbm.invoke(data_blocks, Integer.valueOf(i));
+            ListManagedBlock block = data_blocks.get(i);
             byte[] data = new byte[Math.min(48, block.getData().length)];
             System.arraycopy(block.getData(), 0, data, 0, data.length);
 
@@ -135,9 +130,7 @@ public class POIFSHeaderDumper {
 
     public static void displayBATReader(String type, BlockAllocationTableReader batReader) throws Exception {
         System.out.println("Sectors, as referenced from the "+type+" FAT:");
-        Field entriesF = batReader.getClass().getDeclaredField("_entries");
-        entriesF.setAccessible(true);
-        IntList entries = (IntList)entriesF.get(batReader);
+        IntList entries = batReader.getEntries();
 
         for(int i=0; i<entries.size(); i++) {
             int bn = entries.get(i);
index 0bac7e1c7408b84faa9bab9d0fb8814708a2cf7b..5fa7fb3aaef1f53e7244e0c55f6b843ff7bb70b3 100644 (file)
@@ -55,6 +55,7 @@ import org.apache.poi.poifs.storage.HeaderBlockConstants;
 import org.apache.poi.poifs.storage.HeaderBlockWriter;
 import org.apache.poi.util.CloseIgnoringInputStream;
 import org.apache.poi.util.IOUtils;
+import org.apache.poi.util.Internal;
 import org.apache.poi.util.LongField;
 
 /**
@@ -970,5 +971,15 @@ public class NPOIFSFileSystem extends BlockStore
     protected int getBlockStoreBlockSize() {
        return getBigBlockSize();
     }
+
+    @Internal
+    public NPropertyTable getPropertyTable() {
+        return _property_table;
+    }
+
+    @Internal
+    public HeaderBlock getHeaderBlock() {
+        return _header;
+    }
 }
 
index 5de62855755285de712efc454ef7b715098e41b9..df872b3a7054895829637f92d2ab09bb4cf5ad21 100644 (file)
@@ -312,4 +312,9 @@ public final class BlockAllocationTableReader {
         }
         raw_blocks.setBAT(this);
     }
+
+    @Internal
+    public IntList getEntries() {
+        return _entries;
+    }
 }
index 7a05aae227dd11e954471bf9e5cb1316373be791..f3d459e38932f61c4f5d9d7254055dfef61b8194 100644 (file)
@@ -19,6 +19,8 @@ package org.apache.poi.poifs.storage;
 
 import java.io.IOException;
 
+import org.apache.poi.util.Internal;
+
 /**
  * A simple implementation of BlockList
  *
@@ -59,10 +61,11 @@ abstract class BlockListImpl implements BlockList {
     }
 
     /**
-     * Unit testing method. Gets, without sanity checks or
+     * Internal method. Gets, without sanity checks or
      *  removing.
      */
-    protected ListManagedBlock get(final int index) {
+    @Internal
+    public ListManagedBlock get(final int index) {
         return _blocks[index];
     }
 
index 21228f49f68dde1cc59c85a9b9ca9d19c58a9989..842c37b6a5b48f2c159ce7ebe7bbdf0cbe57e45c 100644 (file)
@@ -38,6 +38,7 @@ import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
 import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
 import org.apache.poi.openxml4j.opc.PackagingURIHelper;
 import org.apache.poi.openxml4j.opc.TargetMode;
+import org.apache.poi.util.Internal;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
 import org.apache.xmlbeans.XmlOptions;
@@ -510,4 +511,15 @@ public class POIXMLDocumentPart {
     protected void onDocumentRemove() throws IOException {
 
     }
+
+    /**
+     * Internal method, do not use!
+     * <p>
+     * This method only exists to allow access to protected {@link POIXMLDocumentPart#onDocumentRead()}
+     * from {@link org.apache.poi.xwpf.usermodel.XWPFDocument} without reflection. It should be removed.
+     */
+    @Internal @Deprecated
+    public static void _invokeOnDocumentRead(POIXMLDocumentPart part) throws IOException {
+        part.onDocumentRead();
+    }
 }
index 9855e2fda2325e4ceea3216ce2aa99ac84b8e720..da99997215bdfe83f343971ed69ccf60473b1e9f 100644 (file)
@@ -20,7 +20,6 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -48,7 +47,6 @@ import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
 import org.apache.poi.openxml4j.opc.PackagingURIHelper;
 import org.apache.poi.openxml4j.opc.TargetMode;
 import org.apache.poi.poifs.crypt.HashAlgorithm;
-import org.apache.poi.util.DocumentHelper;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.IdentifierManager;
 import org.apache.poi.util.Internal;
@@ -153,6 +151,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
         }
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     protected void onDocumentRead() throws IOException {
         try {
@@ -224,13 +223,9 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
                     for (POIXMLDocumentPart gp : p.getRelations()) {
                         // Trigger the onDocumentRead for all the child parts
                         // Otherwise we'll hit issues on Styles, Settings etc on save
-                        try {
-                            Method onDocumentRead = gp.getClass().getDeclaredMethod("onDocumentRead");
-                            onDocumentRead.setAccessible(true);
-                            onDocumentRead.invoke(gp);
-                        } catch (Exception e) {
-                            throw new POIXMLException(e);
-                        }
+                        // TODO: Refactor this to not need to access protected method
+                        // from other package! Remove the static helper method once fixed!!!
+                        POIXMLDocumentPart._invokeOnDocumentRead(gp);
                     }
                 }
             }
index d6b2657858c4f25625f525299a175156d0e3676b..4abebc866a0f12d6de40c80bb8b8db54b85f820a 100644 (file)
@@ -72,7 +72,7 @@ public class HSSFTestHelper {
     }
 
     public static EscherAggregate getEscherAggregate(HSSFPatriarch patriarch){
-        return patriarch._getBoundAggregate();
+        return patriarch.getBoundAggregate();
     }
 
     public static int allocateNewShapeId(HSSFPatriarch patriarch){
index 6813baaa9f4e08a45859ddc8e62c57391e120aa0..3bcd66bd476ac127734ff78b7a9eb9cd5b544b74 100644 (file)
@@ -85,13 +85,13 @@ public final class TestCloneSheet extends TestCase {
         HSSFSheet s = b.createSheet("Test");
         HSSFPatriarch patriarch = s.createDrawingPatriarch();
 
-        EscherAggregate agg1 = patriarch._getBoundAggregate();
+        EscherAggregate agg1 = patriarch.getBoundAggregate();
 
         HSSFSheet s2 = s.cloneSheet(b);
 
         patriarch = s2.getDrawingPatriarch();
 
-        EscherAggregate agg2 = patriarch._getBoundAggregate();
+        EscherAggregate agg2 = patriarch.getBoundAggregate();
 
         EscherSpRecord sp1 = (EscherSpRecord) agg1.getEscherContainer().getChild(1).getChild(0).getChild(1);
         EscherSpRecord sp2 = (EscherSpRecord) agg2.getEscherContainer().getChild(1).getChild(0).getChild(1);
index 4fa9865a612eb90bb270b0a85564584fbf6b0ed0..c60823ee8eb02d7074fc535b8106abb3f8f18331 100644 (file)
@@ -940,8 +940,8 @@ public final class TestHSSFSheet extends BaseTestSheet {
         HSSFSheet sheet2 = wb2.getSheetAt(1);
 
         //check that id of the drawing group was updated
-        EscherDgRecord dg1 = (EscherDgRecord)sheet1.getDrawingPatriarch()._getBoundAggregate().findFirstWithId(EscherDgRecord.RECORD_ID);
-        EscherDgRecord dg2 = (EscherDgRecord)sheet2.getDrawingPatriarch()._getBoundAggregate().findFirstWithId(EscherDgRecord.RECORD_ID);
+        EscherDgRecord dg1 = (EscherDgRecord)sheet1.getDrawingPatriarch().getBoundAggregate().findFirstWithId(EscherDgRecord.RECORD_ID);
+        EscherDgRecord dg2 = (EscherDgRecord)sheet2.getDrawingPatriarch().getBoundAggregate().findFirstWithId(EscherDgRecord.RECORD_ID);
         int dg_id_1 = dg1.getOptions() >> 4;
         int dg_id_2 = dg2.getOptions() >> 4;
         assertEquals(dg_id_1 + 1, dg_id_2);
index d9eba84bd711a24901174f3be0dfe3f21c175301..49cbaeec02a1312269fac6dfb4c301c891f0e32f 100644 (file)
@@ -40,7 +40,7 @@ public class TestPatriarch extends TestCase {
 \r
         assertSame(patriarch, sh.getDrawingPatriarch());\r
 \r
-        EscherAggregate agg = patriarch._getBoundAggregate();\r
+        EscherAggregate agg = patriarch.getBoundAggregate();\r
 \r
         EscherDgRecord dg = agg.getEscherContainer().getChildById(EscherDgRecord.RECORD_ID);\r
         int lastId = dg.getLastMSOSPID();\r
@@ -50,7 +50,7 @@ public class TestPatriarch extends TestCase {
         wb = HSSFTestDataSamples.writeOutAndReadBack(wb);\r
         sh = wb.getSheetAt(0);\r
         patriarch = sh.createDrawingPatriarch();\r
-        dg = patriarch._getBoundAggregate().getEscherContainer().getChildById(EscherDgRecord.RECORD_ID);\r
+        dg = patriarch.getBoundAggregate().getEscherContainer().getChildById(EscherDgRecord.RECORD_ID);\r
 \r
         assertEquals(lastId, dg.getLastMSOSPID());\r
     }\r