/**\r
* Converts points to EMUs\r
* @param points points\r
- * @return emus\r
+ * @return EMUs\r
*/\r
public static int toEMU(double points){\r
return (int)Math.rint(EMU_PER_POINT*points);\r
}\r
+ \r
+ /**\r
+ * Converts pixels to EMUs\r
+ * @param pixels pixels\r
+ * @return EMUs\r
+ */\r
+ public static int pixelToEMU(int pixels) {\r
+ return pixels*EMU_PER_PIXEL;\r
+ }\r
\r
/**\r
* Converts EMUs to points\r
*/
@Override
public XWPFTable getTableArray(int pos) {
- if (pos > 0 && pos < tables.size()) {
+ if (pos >= 0 && pos < tables.size()) {
return tables.get(pos);
}
return null;
}
public XWPFFooter getFooterArray(int pos) {
- return footers.get(pos);
+ if(pos >=0 && pos < footers.size()) {
+ return footers.get(pos);
+ }
+ return null;
}
/**
}
public XWPFHeader getHeaderArray(int pos) {
- return headers.get(pos);
+ if(pos >=0 && pos < headers.size()) {
+ return headers.get(pos);
+ }
+ return null;
}
public String getTblStyle(XWPFTable table) {
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-package org.apache.poi.xwpf.usermodel;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.poi.POIXMLDocumentPart;
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtBlock;
+/* ====================================================================\r
+/* ====================================================================\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+==================================================================== */\r
+package org.apache.poi.xwpf.usermodel;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+\r
+import org.apache.poi.POIXMLDocumentPart;\r
+import org.apache.xmlbeans.XmlCursor;\r
+import org.apache.xmlbeans.XmlObject;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtBlock;\r
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl;\r
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc;\r
\r
private List<XWPFPictureData> pictures = new ArrayList<XWPFPictureData>();\r
private List<IBodyElement> bodyElements = new ArrayList<IBodyElement>();\r
\r
- private CTFtnEdn ctFtnEdn;
- private XWPFFootnotes footnotes;
+ private CTFtnEdn ctFtnEdn;\r
+ private XWPFFootnotes footnotes;\r
private XWPFDocument document;\r
\r
public XWPFFootnote(CTFtnEdn note, XWPFFootnotes xFootnotes) {\r
return paragraphs.iterator();\r
}\r
\r
- public List<XWPFTable> getTables() {
- return tables;
- }
-
- public List<XWPFPictureData> getPictures() {
- return pictures;
- }
-
- public List<IBodyElement> getBodyElements() {
- return bodyElements;
+ public List<XWPFTable> getTables() {\r
+ return tables;\r
+ }\r
+\r
+ public List<XWPFPictureData> getPictures() {\r
+ return pictures;\r
+ }\r
+\r
+ public List<IBodyElement> getBodyElements() {\r
+ return bodyElements;\r
}\r
\r
public CTFtnEdn getCTFtnEdn() {\r
}\r
\r
/**\r
- * @param pos in table array
- * @return The table at position pos
+ * @param pos in table array\r
+ * @return The table at position pos\r
* @see org.apache.poi.xwpf.usermodel.IBody#getTableArray(int)\r
*/\r
public XWPFTable getTableArray(int pos) {\r
- if (pos > 0 && pos < tables.size()) {\r
+ if (pos >= 0 && pos < tables.size()) {\r
return tables.get(pos);\r
}\r
return null;\r
- }
+ }\r
\r
/**\r
* inserts an existing XWPFTable to the arrays bodyElements and tables\r
* @param pos\r
* @param table\r
* @see org.apache.poi.xwpf.usermodel.IBody#insertTable(int pos, XWPFTable table)\r
- */
- public void insertTable(int pos, XWPFTable table) {
+ */\r
+ public void insertTable(int pos, XWPFTable table) {\r
bodyElements.add(pos, table);\r
int i = 0;\r
for (CTTbl tbl : ctFtnEdn.getTblArray()) {\r
break;\r
}\r
i++;\r
- }
- tables.add(i, table);
-
- }
-
+ }\r
+ tables.add(i, table);\r
+\r
+ }\r
+\r
/**\r
* if there is a corresponding {@link XWPFTable} of the parameter ctTable in the tableList of this header\r
* the method will return this table\r
return table;\r
}\r
return null;\r
- }
-
+ }\r
+\r
/**\r
* if there is a corresponding {@link XWPFParagraph} of the parameter ctTable in the paragraphList of this header or footer\r
* the method will return this paragraph\r
return paragraph;\r
}\r
return null;\r
- }
+ }\r
\r
/**\r
* Returns the paragraph that holds\r
* @see org.apache.poi.xwpf.usermodel.IBody#getParagraphArray(int pos)\r
*/\r
public XWPFParagraph getParagraphArray(int pos) {\r
-
- return paragraphs.get(pos);
- }
+ if(pos >=0 && pos < paragraphs.size()) {\r
+ return paragraphs.get(pos);\r
+ }\r
+ return null;\r
+ }\r
\r
/**\r
* get the TableCell which belongs to the TableCell\r
* @param cell\r
* @see org.apache.poi.xwpf.usermodel.IBody#getTableCell(CTTc cell)\r
*/\r
- public XWPFTableCell getTableCell(CTTc cell) {
+ public XWPFTableCell getTableCell(CTTc cell) {\r
XmlCursor cursor = cell.newCursor();\r
cursor.toParent();\r
XmlObject o = cursor.getObject();\r
return null;\r
}\r
XWPFTableRow tableRow = table.getRow(row);\r
+ if(tableRow == null){\r
+ return null;\r
+ }\r
return tableRow.getTableCell(cell);\r
- }
+ }\r
\r
/**\r
* verifies that cursor is on the right position\r
i++;\r
}\r
bodyElements.add(i, newT);\r
- cursor = t.newCursor();
- cursor.toEndToken();
- return newT;
- }
- return null;
- }
+ cursor = t.newCursor();\r
+ cursor.toEndToken();\r
+ return newT;\r
+ }\r
+ return null;\r
+ }\r
\r
/**\r
* add a new paragraph at position of the cursor\r
i++;\r
}\r
bodyElements.add(i, newP);\r
- cursor.toCursor(p.newCursor());
- cursor.toEndToken();
- return newP;
- }
- return null;
- }
+ cursor.toCursor(p.newCursor());\r
+ cursor.toEndToken();\r
+ return newP;\r
+ }\r
+ return null;\r
+ }\r
\r
/**\r
* add a new table to the end of the footnote\r
* @param table\r
* @return the added XWPFTable\r
*/\r
- public XWPFTable addNewTbl(CTTbl table) {
- CTTbl newTable = ctFtnEdn.addNewTbl();
- newTable.set(table);
- XWPFTable xTable = new XWPFTable(newTable, this);
- tables.add(xTable);
- return xTable;
- }
+ public XWPFTable addNewTbl(CTTbl table) {\r
+ CTTbl newTable = ctFtnEdn.addNewTbl();\r
+ newTable.set(table);\r
+ XWPFTable xTable = new XWPFTable(newTable, this);\r
+ tables.add(xTable);\r
+ return xTable;\r
+ }\r
\r
/**\r
* add a new paragraph to the end of the footnote\r
* @param paragraph\r
* @return the added XWPFParagraph\r
*/\r
- public XWPFParagraph addNewParagraph(CTP paragraph) {
- CTP newPara = ctFtnEdn.addNewP();
- newPara.set(paragraph);
- XWPFParagraph xPara = new XWPFParagraph(newPara, this);
- paragraphs.add(xPara);
- return xPara;
- }
-
+ public XWPFParagraph addNewParagraph(CTP paragraph) {\r
+ CTP newPara = ctFtnEdn.addNewP();\r
+ newPara.set(paragraph);\r
+ XWPFParagraph xPara = new XWPFParagraph(newPara, this);\r
+ paragraphs.add(xPara);\r
+ return xPara;\r
+ }\r
+\r
/**\r
* @see org.apache.poi.xwpf.usermodel.IBody#getXWPFDocument()\r
*/\r
* @see org.apache.poi.xwpf.usermodel.IBody#getPart()\r
*/\r
public POIXMLDocumentPart getPart() {\r
- return footnotes;
- }
+ return footnotes;\r
+ }\r
\r
/**\r
* get the PartType of the body\r
* @see org.apache.poi.xwpf.usermodel.IBody#getPartType()\r
*/\r
public BodyType getPartType() {\r
- return BodyType.FOOTNOTE;
- }
-}
+ return BodyType.FOOTNOTE;\r
+ }\r
+}\r
* the text of the header or footer.
*/
public XWPFParagraph getParagraphArray(int pos) {
-
- return paragraphs.get(pos);
+ if(pos >= 0 && pos<paragraphs.size()){
+ return paragraphs.get(pos);
+ }
+ return null;
}
/**
* @see org.apache.poi.xwpf.usermodel.IBody#getTableArray(int)
*/
public XWPFTable getTableArray(int pos) {
-
- if (pos > 0 && pos < tables.size()) {
+ if (pos >= 0 && pos < tables.size()) {
return tables.get(pos);
}
return null;
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-package org.apache.poi.xwpf.usermodel;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.List;
-
-import org.apache.poi.POIXMLDocumentPart;
-import org.apache.poi.util.Internal;
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtBlock;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtRun;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTShd;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVerticalJc;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STShd;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc;
+/* ====================================================================\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+==================================================================== */\r
+package org.apache.poi.xwpf.usermodel;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.EnumMap;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+\r
+import org.apache.poi.POIXMLDocumentPart;\r
+import org.apache.poi.util.Internal;\r
+import org.apache.xmlbeans.XmlCursor;\r
+import org.apache.xmlbeans.XmlObject;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtBlock;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtRun;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTShd;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVerticalJc;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STShd;\r
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc;\r
\r
/**\r
* Represents a Cell within a {@link XWPFTable}. The\r
private static EnumMap<XWPFVertAlign, STVerticalJc.Enum> alignMap;\r
// Create a map from the STVerticalJc.Enum values to the XWPF-level enums\r
private static HashMap<Integer, XWPFVertAlign> stVertAlignTypeMap;\r
-
- static {
- // populate enum maps
- alignMap = new EnumMap<XWPFVertAlign, STVerticalJc.Enum>(XWPFVertAlign.class);
- alignMap.put(XWPFVertAlign.TOP, STVerticalJc.Enum.forInt(STVerticalJc.INT_TOP));
- alignMap.put(XWPFVertAlign.CENTER, STVerticalJc.Enum.forInt(STVerticalJc.INT_CENTER));
- alignMap.put(XWPFVertAlign.BOTH, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTH));
- alignMap.put(XWPFVertAlign.BOTTOM, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTTOM));
-
- stVertAlignTypeMap = new HashMap<Integer, XWPFVertAlign>();
- stVertAlignTypeMap.put(STVerticalJc.INT_TOP, XWPFVertAlign.TOP);
- stVertAlignTypeMap.put(STVerticalJc.INT_CENTER, XWPFVertAlign.CENTER);
- stVertAlignTypeMap.put(STVerticalJc.INT_BOTH, XWPFVertAlign.BOTH);
- stVertAlignTypeMap.put(STVerticalJc.INT_BOTTOM, XWPFVertAlign.BOTTOM);
+\r
+ static {\r
+ // populate enum maps\r
+ alignMap = new EnumMap<XWPFVertAlign, STVerticalJc.Enum>(XWPFVertAlign.class);\r
+ alignMap.put(XWPFVertAlign.TOP, STVerticalJc.Enum.forInt(STVerticalJc.INT_TOP));\r
+ alignMap.put(XWPFVertAlign.CENTER, STVerticalJc.Enum.forInt(STVerticalJc.INT_CENTER));\r
+ alignMap.put(XWPFVertAlign.BOTH, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTH));\r
+ alignMap.put(XWPFVertAlign.BOTTOM, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTTOM));\r
+\r
+ stVertAlignTypeMap = new HashMap<Integer, XWPFVertAlign>();\r
+ stVertAlignTypeMap.put(STVerticalJc.INT_TOP, XWPFVertAlign.TOP);\r
+ stVertAlignTypeMap.put(STVerticalJc.INT_CENTER, XWPFVertAlign.CENTER);\r
+ stVertAlignTypeMap.put(STVerticalJc.INT_BOTH, XWPFVertAlign.BOTH);\r
+ stVertAlignTypeMap.put(STVerticalJc.INT_BOTTOM, XWPFVertAlign.BOTTOM);\r
\r
}\r
\r
/**\r
* If a table cell does not include at least one block-level element, then this document shall be considered corrupt\r
*/\r
- public XWPFTableCell(CTTc cell, XWPFTableRow tableRow, IBody part) {
- this.ctTc = cell;
+ public XWPFTableCell(CTTc cell, XWPFTableRow tableRow, IBody part) {\r
+ this.ctTc = cell;\r
this.part = part;\r
this.tableRow = tableRow;\r
// NB: If a table cell does not include at least one block-level element, then this document shall be considered corrupt.\r
cell.addNewP();\r
bodyElements = new ArrayList<IBodyElement>();\r
paragraphs = new ArrayList<XWPFParagraph>();\r
- tables = new ArrayList<XWPFTable>();
-
- XmlCursor cursor = ctTc.newCursor();
- cursor.selectPath("./*");
+ tables = new ArrayList<XWPFTable>();\r
+\r
+ XmlCursor cursor = ctTc.newCursor();\r
+ cursor.selectPath("./*");\r
while (cursor.toNextSelection()) {\r
XmlObject o = cursor.getObject();\r
if (o instanceof CTP) {\r
@Internal\r
public CTTc getCTTc() {\r
return ctTc;\r
- }
+ }\r
\r
/**\r
* returns an Iterator with paragraphs and tables\r
public void setParagraph(XWPFParagraph p) {\r
if (ctTc.sizeOfPArray() == 0) {\r
ctTc.addNewP();\r
- }
- ctTc.setPArray(0, p.getCTP());
- }
-
+ }\r
+ ctTc.setPArray(0, p.getCTP());\r
+ }\r
+\r
/**\r
* returns a list of paragraphs\r
*/\r
ctshd.setFill(rgbStr);\r
}\r
\r
- /**
- * Get the vertical alignment of the cell.
- *
- * @return the cell alignment enum value or <code>null</code>
- * if no vertical alignment is set.
- */
- public XWPFVertAlign getVerticalAlignment() {
- XWPFVertAlign vAlign = null;
- CTTcPr tcpr = ctTc.getTcPr();
- if (tcpr != null) {
- CTVerticalJc va = tcpr.getVAlign();
- if (va != null && va.getVal() != null) {
- vAlign = stVertAlignTypeMap.get(va.getVal().intValue());
- }
- }
- return vAlign;
- }
+ /**\r
+ * Get the vertical alignment of the cell.\r
+ *\r
+ * @return the cell alignment enum value or <code>null</code>\r
+ * if no vertical alignment is set.\r
+ */\r
+ public XWPFVertAlign getVerticalAlignment() {\r
+ XWPFVertAlign vAlign = null;\r
+ CTTcPr tcpr = ctTc.getTcPr();\r
+ if (tcpr != null) {\r
+ CTVerticalJc va = tcpr.getVAlign();\r
+ if (va != null && va.getVal() != null) {\r
+ vAlign = stVertAlignTypeMap.get(va.getVal().intValue());\r
+ }\r
+ }\r
+ return vAlign;\r
+ }\r
\r
/**\r
* Set the vertical alignment of the cell.\r
* @see org.apache.poi.xwpf.usermodel.IBody#getParagraphArray(int)\r
*/\r
public XWPFParagraph getParagraphArray(int pos) {\r
- if (pos > 0 && pos < paragraphs.size()) {\r
+ if (pos >= 0 && pos < paragraphs.size()) {\r
return paragraphs.get(pos);\r
}\r
return null;\r
* @see org.apache.poi.xwpf.usermodel.IBody#getTableArray(int)\r
*/\r
public XWPFTable getTableArray(int pos) {\r
- if (pos > 0 && pos < tables.size()) {\r
+ if(pos >= 0 && pos < tables.size()) {\r
return tables.get(pos);\r
}\r
return null;\r
*\r
* @see org.apache.poi.xwpf.usermodel.IBody#insertTable(int, org.apache.poi.xwpf.usermodel.XWPFTable)\r
*/\r
- public void insertTable(int pos, XWPFTable table) {
- bodyElements.add(pos, table);
- int i = 0;
- for (CTTbl tbl : ctTc.getTblArray()) {
- if (tbl == table.getCTTbl()) {
- break;
- }
- i++;
- }
+ public void insertTable(int pos, XWPFTable table) {\r
+ bodyElements.add(pos, table);\r
+ int i = 0;\r
+ for (CTTbl tbl : ctTc.getTblArray()) {\r
+ if (tbl == table.getCTTbl()) {\r
+ break;\r
+ }\r
+ i++;\r
+ }\r
tables.add(i, table);\r
}\r
\r
text.append('\t');\r
}\r
}\r
- }
-
- /**
+ }\r
+\r
+ /**\r
* get the TableCell which belongs to the TableCell\r
*/\r
public XWPFTableCell getTableCell(CTTc cell) {\r
import java.io.IOException;
+import org.apache.poi.util.Units;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.xwpf.XWPFTestDataSamples;
import org.apache.poi.xwpf.usermodel.XWPFRun.FontCharRange;
doc.close();
}
-
@Test
public void bug57312_NullPointException() throws IOException {
XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("57312.docx");
}
}
+ @Test
+ public void bug57495_getTableArrayInDoc() {
+ XWPFDocument doc =new XWPFDocument();
+ //let's create a few tables for the test
+ for(int i=0;i<3;i++) {
+ doc.createTable(2, 2);
+ }
+ XWPFTable table = doc.getTableArray(0);
+ assertNotNull(table);
+ //let's check also that returns the correct table
+ XWPFTable same = doc.getTables().get(0);
+ assertEquals(table, same);
+ }
+
+ @Test
+ public void bug57495_getParagraphArrayInTableCell() {
+ XWPFDocument doc =new XWPFDocument();
+ //let's create a table for the test
+ XWPFTable table = doc.createTable(2, 2);
+ assertNotNull(table);
+ XWPFParagraph p = table.getRow(0).getCell(0).getParagraphArray(0);
+ assertNotNull(p);
+ //let's check also that returns the correct paragraph
+ XWPFParagraph same = table.getRow(0).getCell(0).getParagraphs().get(0);
+ assertEquals(p, same);
+ }
+
+ @Test
+ public void bug57495_convertPixelsToEMUs() {
+ int pixels = 100;
+ int expectedEMU = 952500;
+ int result = Units.pixelToEMU(pixels);
+ assertEquals(expectedEMU, result);
+ }
@Test
public void test56392() throws IOException, OpenXML4JException {