Conditional check for logging to avoid creating too many temporary objects.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353559 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Glen Stampoultzis 2004-06-20 10:18:50 +00:00
parent 7b38e0ceb0
commit 307d2ddc32
5 changed files with 170 additions and 95 deletions

View File

@ -135,17 +135,20 @@ public class Sheet implements Model
if (rec.getSid() == LabelRecord.sid) if (rec.getSid() == LabelRecord.sid)
{ {
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "Hit label record."); log.log(POILogger.DEBUG, "Hit label record.");
retval.containsLabels = true; retval.containsLabels = true;
} }
else if (rec.getSid() == BOFRecord.sid) else if (rec.getSid() == BOFRecord.sid)
{ {
bofEofNestingLevel++; bofEofNestingLevel++;
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "Hit BOF record. Nesting increased to " + bofEofNestingLevel); log.log(POILogger.DEBUG, "Hit BOF record. Nesting increased to " + bofEofNestingLevel);
} }
else if (rec.getSid() == EOFRecord.sid) else if (rec.getSid() == EOFRecord.sid)
{ {
--bofEofNestingLevel; --bofEofNestingLevel;
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "Hit EOF record. Nesting decreased to " + bofEofNestingLevel); log.log(POILogger.DEBUG, "Hit EOF record. Nesting decreased to " + bofEofNestingLevel);
if (bofEofNestingLevel == 0) { if (bofEofNestingLevel == 0) {
records.add(rec); records.add(rec);
@ -285,6 +288,7 @@ public class Sheet implements Model
{ {
retval.cells = new ValueRecordsAggregate(); retval.cells = new ValueRecordsAggregate();
} }
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "sheet createSheet (existing file) exited"); log.log(POILogger.DEBUG, "sheet createSheet (existing file) exited");
return retval; return retval;
} }
@ -344,6 +348,7 @@ public class Sheet implements Model
public static Sheet createSheet(List records, int sheetnum) public static Sheet createSheet(List records, int sheetnum)
{ {
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, log.log(POILogger.DEBUG,
"Sheet createSheet (exisiting file) assumed offset 0"); "Sheet createSheet (exisiting file) assumed offset 0");
return createSheet(records, sheetnum, 0); return createSheet(records, sheetnum, 0);
@ -359,6 +364,7 @@ public class Sheet implements Model
public static Sheet createSheet() public static Sheet createSheet()
{ {
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "Sheet createsheet from scratch called"); log.log(POILogger.DEBUG, "Sheet createsheet from scratch called");
Sheet retval = new Sheet(); Sheet retval = new Sheet();
ArrayList records = new ArrayList(30); ArrayList records = new ArrayList(30);
@ -409,6 +415,7 @@ public class Sheet implements Model
records.add(retval.protect); records.add(retval.protect);
records.add(retval.createEOF()); records.add(retval.createEOF());
retval.records = records; retval.records = records;
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "Sheet createsheet from scratch exit"); log.log(POILogger.DEBUG, "Sheet createsheet from scratch exit");
return retval; return retval;
} }
@ -553,6 +560,7 @@ public class Sheet implements Model
public void convertLabelRecords(Workbook wb) public void convertLabelRecords(Workbook wb)
{ {
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "convertLabelRecords called"); log.log(POILogger.DEBUG, "convertLabelRecords called");
if (containsLabels) if (containsLabels)
{ {
@ -577,6 +585,7 @@ public class Sheet implements Model
} }
} }
} }
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "convertLabelRecords exit"); log.log(POILogger.DEBUG, "convertLabelRecords exit");
} }
@ -591,6 +600,8 @@ public class Sheet implements Model
{ {
checkCells(); checkCells();
checkRows(); checkRows();
if (log.check( POILogger.DEBUG ))
{
log.log(POILogger.DEBUG, "Sheet.getNumRecords"); log.log(POILogger.DEBUG, "Sheet.getNumRecords");
log.logFormatted(POILogger.DEBUG, "returning % + % + % - 2 = %", new int[] log.logFormatted(POILogger.DEBUG, "returning % + % + % - 2 = %", new int[]
{ {
@ -599,6 +610,7 @@ public class Sheet implements Model
records.size() + cells.getPhysicalNumberOfCells() records.size() + cells.getPhysicalNumberOfCells()
+ rows.getPhysicalNumberOfRows() - 2 + rows.getPhysicalNumberOfRows() - 2
}); });
}
return records.size() + cells.getPhysicalNumberOfCells() return records.size() + cells.getPhysicalNumberOfCells()
+ rows.getPhysicalNumberOfRows() - 2; + rows.getPhysicalNumberOfRows() - 2;
} }
@ -614,6 +626,8 @@ public class Sheet implements Model
//public void setDimensions(short firstrow, short firstcol, short lastrow, //public void setDimensions(short firstrow, short firstcol, short lastrow,
public void setDimensions(int firstrow, short firstcol, int lastrow, public void setDimensions(int firstrow, short firstcol, int lastrow,
short lastcol) short lastcol)
{
if (log.check( POILogger.DEBUG ))
{ {
log.log(POILogger.DEBUG, "Sheet.setDimensions"); log.log(POILogger.DEBUG, "Sheet.setDimensions");
log.log(POILogger.DEBUG, log.log(POILogger.DEBUG,
@ -621,11 +635,15 @@ public class Sheet implements Model
.append("firstcol").append(firstcol).append("lastrow") .append("firstcol").append(firstcol).append("lastrow")
.append(lastrow).append("lastcol").append(lastcol) .append(lastrow).append("lastcol").append(lastcol)
.toString()); .toString());
}
dims.setFirstCol(firstcol); dims.setFirstCol(firstcol);
dims.setFirstRow(firstrow); dims.setFirstRow(firstrow);
dims.setLastCol(lastcol); dims.setLastCol(lastcol);
dims.setLastRow(lastrow); dims.setLastRow(lastrow);
log.log(log.DEBUG, "Sheet.setDimensions exiting"); if (log.check( POILogger.DEBUG ))
{
log.log(POILogger.DEBUG, "Sheet.setDimensions exiting");
}
} }
/** /**
@ -647,7 +665,8 @@ public class Sheet implements Model
public void setLoc(int loc) public void setLoc(int loc)
{ {
valueRecIterator = null; valueRecIterator = null;
log.log(log.DEBUG, "sheet.setLoc(): " + loc); if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "sheet.setLoc(): " + loc);
this.loc = loc; this.loc = loc;
} }
@ -658,7 +677,8 @@ public class Sheet implements Model
public int getLoc() public int getLoc()
{ {
log.log(log.DEBUG, "sheet.getLoc():" + loc); if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "sheet.getLoc():" + loc);
return loc; return loc;
} }
@ -697,6 +717,7 @@ public class Sheet implements Model
public int serialize(int offset, byte [] data) public int serialize(int offset, byte [] data)
{ {
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "Sheet.serialize using offsets"); log.log(log.DEBUG, "Sheet.serialize using offsets");
int pos = offset; int pos = offset;
@ -725,6 +746,7 @@ public class Sheet implements Model
} }
} }
} }
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "Sheet.serialize returning "); log.log(log.DEBUG, "Sheet.serialize returning ");
return pos-offset; return pos-offset;
} }
@ -774,6 +796,7 @@ public class Sheet implements Model
public RowRecord createRow(int row) public RowRecord createRow(int row)
{ {
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "create row number " + row); log.log(log.DEBUG, "create row number " + row);
RowRecord rowrec = new RowRecord(); RowRecord rowrec = new RowRecord();
@ -1020,6 +1043,7 @@ public class Sheet implements Model
{ {
checkCells(); checkCells();
setLoc(dimsloc); setLoc(dimsloc);
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "replaceValueRecord "); log.log(log.DEBUG, "replaceValueRecord ");
cells.insertCell(newval); cells.insertCell(newval);
@ -1056,6 +1080,7 @@ public class Sheet implements Model
public void addRow(RowRecord row) public void addRow(RowRecord row)
{ {
checkRows(); checkRows();
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "addRow "); log.log(log.DEBUG, "addRow ");
DimensionsRecord d = ( DimensionsRecord ) records.get(getDimsLoc()); DimensionsRecord d = ( DimensionsRecord ) records.get(getDimsLoc());
@ -1110,6 +1135,7 @@ public class Sheet implements Model
* } * }
* } * }
*/ */
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "exit addRow"); log.log(log.DEBUG, "exit addRow");
} }
@ -1171,6 +1197,7 @@ public class Sheet implements Model
public CellValueRecordInterface getNextValueRecord() public CellValueRecordInterface getNextValueRecord()
{ {
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "getNextValue loc= " + loc); log.log(log.DEBUG, "getNextValue loc= " + loc);
if (valueRecIterator == null) if (valueRecIterator == null)
{ {
@ -1258,6 +1285,7 @@ public class Sheet implements Model
public RowRecord getNextRow() public RowRecord getNextRow()
{ {
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "getNextRow loc= " + loc); log.log(log.DEBUG, "getNextRow loc= " + loc);
if (rowRecIterator == null) if (rowRecIterator == null)
{ {
@ -1304,6 +1332,7 @@ public class Sheet implements Model
//public RowRecord getRow(short rownum) //public RowRecord getRow(short rownum)
public RowRecord getRow(int rownum) public RowRecord getRow(int rownum)
{ {
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "getNextRow loc= " + loc); log.log(log.DEBUG, "getNextRow loc= " + loc);
if (rows == null) { if (rows == null) {
return null; return null;
@ -2072,6 +2101,7 @@ public class Sheet implements Model
public int getDimsLoc() public int getDimsLoc()
{ {
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "getDimsLoc dimsloc= " + dimsloc); log.log(log.DEBUG, "getDimsLoc dimsloc= " + dimsloc);
return dimsloc; return dimsloc;
} }
@ -2525,6 +2555,7 @@ public class Sheet implements Model
protected Record createProtect() protected Record createProtect()
{ {
if (log.check( POILogger.DEBUG ))
log.log(log.DEBUG, "create protect record with protection disabled"); log.log(log.DEBUG, "create protect record with protection disabled");
ProtectRecord retval = new ProtectRecord(); ProtectRecord retval = new ProtectRecord();

View File

@ -121,6 +121,7 @@ public class Workbook implements Model {
* @return Workbook object * @return Workbook object
*/ */
public static Workbook createWorkbook(List recs) { public static Workbook createWorkbook(List recs) {
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "Workbook (readfile) created with reclen=", log.log(DEBUG, "Workbook (readfile) created with reclen=",
new Integer(recs.size())); new Integer(recs.size()));
Workbook retval = new Workbook(); Workbook retval = new Workbook();
@ -131,71 +132,85 @@ public class Workbook implements Model {
if (rec.getSid() == EOFRecord.sid) { if (rec.getSid() == EOFRecord.sid) {
records.add(rec); records.add(rec);
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found workbook eof record at " + k); log.log(DEBUG, "found workbook eof record at " + k);
break; break;
} }
switch (rec.getSid()) { switch (rec.getSid()) {
case BoundSheetRecord.sid : case BoundSheetRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found boundsheet record at " + k); log.log(DEBUG, "found boundsheet record at " + k);
retval.boundsheets.add(rec); retval.boundsheets.add(rec);
retval.records.setBspos( k ); retval.records.setBspos( k );
break; break;
case SSTRecord.sid : case SSTRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found sst record at " + k); log.log(DEBUG, "found sst record at " + k);
retval.sst = ( SSTRecord ) rec; retval.sst = ( SSTRecord ) rec;
break; break;
case FontRecord.sid : case FontRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found font record at " + k); log.log(DEBUG, "found font record at " + k);
retval.records.setFontpos( k ); retval.records.setFontpos( k );
retval.numfonts++; retval.numfonts++;
break; break;
case ExtendedFormatRecord.sid : case ExtendedFormatRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found XF record at " + k); log.log(DEBUG, "found XF record at " + k);
retval.records.setXfpos( k ); retval.records.setXfpos( k );
retval.numxfs++; retval.numxfs++;
break; break;
case TabIdRecord.sid : case TabIdRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found tabid record at " + k); log.log(DEBUG, "found tabid record at " + k);
retval.records.setTabpos( k ); retval.records.setTabpos( k );
break; break;
case ProtectRecord.sid : case ProtectRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found protect record at " + k); log.log(DEBUG, "found protect record at " + k);
retval.records.setProtpos( k ); retval.records.setProtpos( k );
break; break;
case BackupRecord.sid : case BackupRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found backup record at " + k); log.log(DEBUG, "found backup record at " + k);
retval.records.setBackuppos( k ); retval.records.setBackuppos( k );
break; break;
case ExternSheetRecord.sid : case ExternSheetRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found extern sheet record at " + k); log.log(DEBUG, "found extern sheet record at " + k);
retval.externSheet = ( ExternSheetRecord ) rec; retval.externSheet = ( ExternSheetRecord ) rec;
break; break;
case NameRecord.sid : case NameRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found name record at " + k); log.log(DEBUG, "found name record at " + k);
retval.names.add(rec); retval.names.add(rec);
// retval.records.namepos = k; // retval.records.namepos = k;
break; break;
case SupBookRecord.sid : case SupBookRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found SupBook record at " + k); log.log(DEBUG, "found SupBook record at " + k);
// retval.records.supbookpos = k; // retval.records.supbookpos = k;
break; break;
case FormatRecord.sid : case FormatRecord.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found format record at " + k); log.log(DEBUG, "found format record at " + k);
retval.formats.add(rec); retval.formats.add(rec);
retval.maxformatid = retval.maxformatid >= ((FormatRecord)rec).getIndexCode() ? retval.maxformatid : ((FormatRecord)rec).getIndexCode(); retval.maxformatid = retval.maxformatid >= ((FormatRecord)rec).getIndexCode() ? retval.maxformatid : ((FormatRecord)rec).getIndexCode();
break; break;
case DateWindow1904Record.sid : case DateWindow1904Record.sid :
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found datewindow1904 record at " + k); log.log(DEBUG, "found datewindow1904 record at " + k);
retval.uses1904datewindowing = ((DateWindow1904Record)rec).getWindowing() == 1; retval.uses1904datewindowing = ((DateWindow1904Record)rec).getWindowing() == 1;
break; break;
case PaletteRecord.sid: case PaletteRecord.sid:
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found palette record at " + k); log.log(DEBUG, "found palette record at " + k);
retval.records.setPalettepos( k ); retval.records.setPalettepos( k );
default : default :
@ -209,6 +224,7 @@ public class Workbook implements Model {
// } // }
retval.records.setRecords(records); retval.records.setRecords(records);
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "exit create workbook from existing file function"); log.log(DEBUG, "exit create workbook from existing file function");
return retval; return retval;
} }
@ -219,6 +235,7 @@ public class Workbook implements Model {
*/ */
public static Workbook createWorkbook() public static Workbook createWorkbook()
{ {
if (log.check( POILogger.DEBUG ))
log.log( DEBUG, "creating new workbook from scratch" ); log.log( DEBUG, "creating new workbook from scratch" );
Workbook retval = new Workbook(); Workbook retval = new Workbook();
ArrayList records = new ArrayList( 30 ); ArrayList records = new ArrayList( 30 );
@ -295,6 +312,7 @@ public class Workbook implements Model {
records.add( retval.createEOF() ); records.add( retval.createEOF() );
retval.records.setRecords(records); retval.records.setRecords(records);
if (log.check( POILogger.DEBUG ))
log.log( DEBUG, "exit create new workbook from scratch" ); log.log( DEBUG, "exit create new workbook from scratch" );
return retval; return retval;
} }
@ -402,6 +420,7 @@ public class Workbook implements Model {
*/ */
public void setSheetBof(int sheetnum, int pos) { public void setSheetBof(int sheetnum, int pos) {
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "setting bof for sheetnum =", new Integer(sheetnum), log.log(DEBUG, "setting bof for sheetnum =", new Integer(sheetnum),
" at pos=", new Integer(pos)); " at pos=", new Integer(pos));
checkSheets(sheetnum); checkSheets(sheetnum);
@ -534,6 +553,7 @@ public class Workbook implements Model {
*/ */
public int getNumSheets() { public int getNumSheets() {
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "getNumSheets=", new Integer(boundsheets.size())); log.log(DEBUG, "getNumSheets=", new Integer(boundsheets.size()));
return boundsheets.size(); return boundsheets.size();
} }
@ -545,6 +565,7 @@ public class Workbook implements Model {
*/ */
public int getNumExFormats() { public int getNumExFormats() {
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "getXF=", new Integer(numxfs)); log.log(DEBUG, "getXF=", new Integer(numxfs));
return numxfs; return numxfs;
} }
@ -592,6 +613,7 @@ public class Workbook implements Model {
*/ */
public int addSSTString(String string, boolean use16bits) { public int addSSTString(String string, boolean use16bits) {
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "insert to sst string='", string, "' and use16bits= ", log.log(DEBUG, "insert to sst string='", string, "' and use16bits= ",
new Boolean(use16bits)); new Boolean(use16bits));
if (sst == null) { if (sst == null) {
@ -625,6 +647,7 @@ public class Workbook implements Model {
} }
String retval = sst.getString(str); String retval = sst.getString(str);
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "Returning SST for index=", new Integer(str), log.log(DEBUG, "Returning SST for index=", new Integer(str),
" String= ", retval); " String= ", retval);
return retval; return retval;
@ -638,6 +661,7 @@ public class Workbook implements Model {
*/ */
public void insertSST() { public void insertSST() {
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "creating new SST via insertSST!"); log.log(DEBUG, "creating new SST via insertSST!");
sst = ( SSTRecord ) createSST(); sst = ( SSTRecord ) createSST();
records.add(records.size() - 1, createExtendedSST()); records.add(records.size() - 1, createExtendedSST());
@ -691,6 +715,7 @@ public class Workbook implements Model {
public int serialize( int offset, byte[] data ) public int serialize( int offset, byte[] data )
{ {
if (log.check( POILogger.DEBUG ))
log.log( DEBUG, "Serializing Workbook with offsets" ); log.log( DEBUG, "Serializing Workbook with offsets" );
int pos = 0; int pos = 0;
@ -716,6 +741,7 @@ public class Workbook implements Model {
pos += record.serialize( pos + offset, data ); // rec.length; pos += record.serialize( pos + offset, data ); // rec.length;
} }
} }
if (log.check( POILogger.DEBUG ))
log.log( DEBUG, "Exiting serialize workbook" ); log.log( DEBUG, "Exiting serialize workbook" );
return pos; return pos;
} }

View File

@ -133,11 +133,13 @@ public class EscherGraphics
public void clipRect(int x, int y, int width, int height) public void clipRect(int x, int y, int width, int height)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"clipRect not supported"); logger.log(POILogger.WARN,"clipRect not supported");
} }
public void copyArea(int x, int y, int width, int height, int dx, int dy) public void copyArea(int x, int y, int width, int height, int dx, int dy)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"copyArea not supported"); logger.log(POILogger.WARN,"copyArea not supported");
} }
@ -155,6 +157,7 @@ public class EscherGraphics
public void drawArc(int x, int y, int width, int height, public void drawArc(int x, int y, int width, int height,
int startAngle, int arcAngle) int startAngle, int arcAngle)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawArc not supported"); logger.log(POILogger.WARN,"drawArc not supported");
} }
@ -164,6 +167,7 @@ public class EscherGraphics
Color bgcolor, Color bgcolor,
ImageObserver observer) ImageObserver observer)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawImage not supported"); logger.log(POILogger.WARN,"drawImage not supported");
return true; return true;
@ -174,6 +178,7 @@ public class EscherGraphics
int sx1, int sy1, int sx2, int sy2, int sx1, int sy1, int sx2, int sy2,
ImageObserver observer) ImageObserver observer)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawImage not supported"); logger.log(POILogger.WARN,"drawImage not supported");
return true; return true;
} }
@ -241,17 +246,20 @@ public class EscherGraphics
public void drawPolyline(int xPoints[], int yPoints[], public void drawPolyline(int xPoints[], int yPoints[],
int nPoints) int nPoints)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawPolyline not supported"); logger.log(POILogger.WARN,"drawPolyline not supported");
} }
public void drawRect(int x, int y, int width, int height) public void drawRect(int x, int y, int width, int height)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawRect not supported"); logger.log(POILogger.WARN,"drawRect not supported");
} }
public void drawRoundRect(int x, int y, int width, int height, public void drawRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight) int arcWidth, int arcHeight)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawRoundRect not supported"); logger.log(POILogger.WARN,"drawRoundRect not supported");
} }
@ -318,12 +326,14 @@ public class EscherGraphics
public void drawString(AttributedCharacterIterator iterator, public void drawString(AttributedCharacterIterator iterator,
int x, int y) int x, int y)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawString not supported"); logger.log(POILogger.WARN,"drawString not supported");
} }
public void fillArc(int x, int y, int width, int height, public void fillArc(int x, int y, int width, int height,
int startAngle, int arcAngle) int startAngle, int arcAngle)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"fillArc not supported"); logger.log(POILogger.WARN,"fillArc not supported");
} }
@ -384,6 +394,7 @@ public class EscherGraphics
public void fillRoundRect(int x, int y, int width, int height, public void fillRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight) int arcWidth, int arcHeight)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"fillRoundRect not supported"); logger.log(POILogger.WARN,"fillRoundRect not supported");
} }
@ -439,16 +450,19 @@ public class EscherGraphics
public void setPaintMode() public void setPaintMode()
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"setPaintMode not supported"); logger.log(POILogger.WARN,"setPaintMode not supported");
} }
public void setXORMode(Color color) public void setXORMode(Color color)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"setXORMode not supported"); logger.log(POILogger.WARN,"setXORMode not supported");
} }
public void translate(int x, int y) public void translate(int x, int y)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"translate not supported"); logger.log(POILogger.WARN,"translate not supported");
} }

View File

@ -142,6 +142,7 @@ public class EscherGraphics2d extends Graphics2D
public void draw(Shape shape) public void draw(Shape shape)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"copyArea not supported"); logger.log(POILogger.WARN,"copyArea not supported");
} }
@ -159,6 +160,7 @@ public class EscherGraphics2d extends Graphics2D
public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
int sx2, int sy2, Color bgColor, ImageObserver imageobserver) int sx2, int sy2, Color bgColor, ImageObserver imageobserver)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawImage() not supported"); logger.log(POILogger.WARN,"drawImage() not supported");
return true; return true;
} }
@ -166,11 +168,11 @@ public class EscherGraphics2d extends Graphics2D
public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
int sx2, int sy2, ImageObserver imageobserver) int sx2, int sy2, ImageObserver imageobserver)
{ {
logger.log(POILogger.WARN,"drawImage() not supported");
return drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, imageobserver); return drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null, imageobserver);
} }
public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, Color bgColor, ImageObserver imageobserver) public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, Color bgColor, ImageObserver imageobserver)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"drawImage() not supported"); logger.log(POILogger.WARN,"drawImage() not supported");
return true; return true;
} }
@ -286,6 +288,7 @@ public class EscherGraphics2d extends Graphics2D
public void fill(Shape shape) public void fill(Shape shape)
{ {
if (logger.check( POILogger.WARN ))
logger.log(POILogger.WARN,"fill(Shape) not supported"); logger.log(POILogger.WARN,"fill(Shape) not supported");
} }

View File

@ -754,6 +754,7 @@ public class HSSFWorkbook
public byte[] getBytes() public byte[] getBytes()
{ {
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "HSSFWorkbook.getBytes()"); log.log(DEBUG, "HSSFWorkbook.getBytes()");
int wbsize = workbook.getSize(); int wbsize = workbook.getSize();