You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/07/10 14:56:36 UTC
svn commit: r1144852 - in
/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model:
OldCHPBinTable.java OldPAPBinTable.java OldSectionTable.java
Author: sergey
Date: Sun Jul 10 12:56:36 2011
New Revision: 1144852
URL: http://svn.apache.org/viewvc?rev=1144852&view=rev
Log:
more WARNs in log
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java?rev=1144852&r1=1144851&r2=1144852&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java Sun Jul 10 12:56:36 2011
@@ -21,6 +21,8 @@ import java.util.Collections;
import org.apache.poi.poifs.common.POIFSConstants;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
/**
* This class holds all of the character formatting
@@ -32,6 +34,9 @@ import org.apache.poi.util.LittleEndian;
*/
public final class OldCHPBinTable extends CHPBinTable
{
+ private static final POILogger logger = POILogFactory
+ .getLogger( OldCHPBinTable.class );
+
/**
* Constructor used to read an old-style binTable
* in from a Word document.
@@ -62,8 +67,14 @@ public final class OldCHPBinTable extend
for (int y = 0; y < fkpSize; y++)
{
CHPX chpx = cfkp.getCHPX(y);
- if (chpx != null && tpt.isIndexInTable( chpx.getStartBytes(), chpx.getEndBytes() ))
+ if (chpx != null && tpt.isIndexInTable( chpx.getStartBytes(), chpx.getEndBytes() )) {
_textRuns.add(chpx);
+ } else {
+ logger.log( POILogger.WARN, "CHPX [",
+ chpx.getStartBytes(), "; ", chpx.getEndBytes(),
+ ") (bytes) doesn't have corresponding text pieces "
+ + "and will be skipped" );
+ }
}
}
Collections.sort( _textRuns, PropertyNode.StartComparator.instance );
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java?rev=1144852&r1=1144851&r2=1144852&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java Sun Jul 10 12:56:36 2011
@@ -21,6 +21,8 @@ import java.util.Collections;
import org.apache.poi.poifs.common.POIFSConstants;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
/**
* This class holds all of the paragraph formatting
@@ -32,6 +34,9 @@ import org.apache.poi.util.LittleEndian;
*/
public final class OldPAPBinTable extends PAPBinTable
{
+ private static final POILogger logger = POILogFactory
+ .getLogger( OldPAPBinTable.class );
+
public OldPAPBinTable(byte[] documentStream, int offset,
int size, int fcMin, TextPieceTable tpt)
{
@@ -53,8 +58,14 @@ public final class OldPAPBinTable extend
for (int y = 0; y < fkpSize; y++)
{
PAPX papx = pfkp.getPAPX(y);
- if (papx != null && tpt.isIndexInTable( papx.getStartBytes(), papx.getEndBytes() ))
+ if (papx != null && tpt.isIndexInTable( papx.getStartBytes(), papx.getEndBytes() )) {
_paragraphs.add(papx);
+ } else {
+ logger.log( POILogger.WARN, "PAPX [", papx.getStartBytes(),
+ "; ", papx.getEndBytes(),
+ ") (bytes) doesn't have corresponding text pieces "
+ + "and will be skipped" );
+ }
}
}
Collections.sort( _paragraphs, PropertyNode.StartComparator.instance );
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java?rev=1144852&r1=1144851&r2=1144852&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java Sun Jul 10 12:56:36 2011
@@ -20,6 +20,8 @@ package org.apache.poi.hwpf.model;
import java.util.Collections;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
/**
* This class holds all of the section formatting
@@ -31,6 +33,9 @@ import org.apache.poi.util.LittleEndian;
*/
public final class OldSectionTable extends SectionTable
{
+ private static final POILogger logger = POILogFactory
+ .getLogger( OldSectionTable.class );
+
public OldSectionTable(byte[] documentStream, int offset,
int size, int fcMin,
TextPieceTable tpt)
@@ -69,8 +74,17 @@ public final class OldSectionTable exten
sepx = new SEPX(sed, startAt, endAt, charConv, buf);
}
- if (tpt.isIndexInTable( sepx.getStartBytes(), sepx.getEndBytes() ))
- _sections.add(sepx);
+ if ( tpt.isIndexInTable( sepx.getStartBytes(), sepx.getEndBytes() ) )
+ {
+ _sections.add( sepx );
+ }
+ else
+ {
+ logger.log( POILogger.WARN, "Section [", sepx.getStartBytes(),
+ "; ", sepx.getEndBytes(),
+ ") (bytes) doesn't have corresponding text pieces "
+ + "and will be skipped" );
+ }
}
Collections.sort( _sections, PropertyNode.StartComparator.instance );
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org