mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
code refactor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1925646 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
62b351cbeb
commit
b76bbc866e
@ -59,7 +59,7 @@ public final class Word2Forrest
|
||||
{
|
||||
Paragraph p = r.getParagraph (x);
|
||||
String text = p.text ();
|
||||
if (text.trim ().length () == 0)
|
||||
if (text.trim().isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -608,7 +608,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
|
||||
}
|
||||
|
||||
// remove any remaining illegal references in _rows.cArray
|
||||
while(_row.getCArray().length > _cells.size()) {
|
||||
while(_row.sizeOfCArray() > _cells.size()) {
|
||||
_row.removeC(_cells.size());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1155,7 +1155,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
|
||||
* @return the LastParagraph of the document
|
||||
*/
|
||||
public XWPFParagraph getLastParagraph() {
|
||||
int lastPos = paragraphs.toArray().length - 1;
|
||||
final int lastPos = paragraphs.size() - 1;
|
||||
return paragraphs.get(lastPos);
|
||||
}
|
||||
|
||||
|
||||
@ -203,7 +203,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
|
||||
if (run instanceof XWPFRun) {
|
||||
XWPFRun xRun = (XWPFRun) run;
|
||||
// don't include the text if reviewing is enabled and this is a deleted run
|
||||
if (xRun.getCTR().getDelTextArray().length == 0) {
|
||||
if (xRun.getCTR().sizeOfDelTextArray() == 0) {
|
||||
out.append(xRun);
|
||||
}
|
||||
} else if (run instanceof XWPFSDT) {
|
||||
|
||||
@ -83,11 +83,14 @@ public final class PropertyTable implements BATManaged {
|
||||
|
||||
for (ByteBuffer bb : dataSource) {
|
||||
// Turn it into an array
|
||||
byte[] data;
|
||||
if (bb.hasArray() && bb.arrayOffset() == 0 &&
|
||||
bb.array().length == _bigBigBlockSize.getBigBlockSize()) {
|
||||
data = bb.array();
|
||||
} else {
|
||||
byte[] data = null;
|
||||
if (bb.hasArray() && bb.arrayOffset() == 0) {
|
||||
final byte[] array = bb.array();
|
||||
if (array.length == _bigBigBlockSize.getBigBlockSize()) {
|
||||
data = array;
|
||||
}
|
||||
}
|
||||
if (data == null) {
|
||||
data = IOUtils.safelyAllocate(_bigBigBlockSize.getBigBlockSize(), POIFSFileSystem.getMaxRecordLength());
|
||||
|
||||
int toRead = data.length;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user