package org.apache.poi.hslf.record;
+import org.apache.poi.util.POILogger;
+
import java.io.IOException;
import java.io.OutputStream;
// (normally it's 2, or 3 if you have notes)
// Complain if it's not
if(slwtcount == 0) {
- System.err.println("No SlideListWithText's found - there should normally be at least one!");
+ logger.log(POILogger.WARN, "No SlideListWithText's found - there should normally be at least one!");
}
if(slwtcount > 3) {
- System.err.println("Found " + slwtcount + " SlideListWithTexts - normally there should only be three!");
+ logger.log(POILogger.WARN, "Found " + slwtcount + " SlideListWithTexts - normally there should only be three!");
}
// Now grab all the SLWTs
package org.apache.poi.hslf.record;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogger;
+
import java.io.*;
import java.util.*;
FontEntityAtom atom = (FontEntityAtom)_children[i];
fonts.add(atom.getFontName());
} else {
- System.err.println("Warning: FontCollection child wasn't a FontEntityAtom, was " + _children[i]);
+ logger.log(POILogger.WARN, "Warning: FontCollection child wasn't a FontEntityAtom, was " + _children[i]);
}
}
}
package org.apache.poi.hslf.record;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogger;
import org.apache.poi.ddf.*;
import org.apache.poi.hslf.model.ShapeTypes;
// Wind on
int size = r.getRecordSize();
if(size < 8) {
- System.err.println("Hit short DDF record at " + startPos + " - " + size);
+ logger.log(POILogger.WARN, "Hit short DDF record at " + startPos + " - " + size);
}
startPos += size;
lenToGo -= size;
package org.apache.poi.hslf.record;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogger;
+
import java.io.IOException;
import java.io.OutputStream;
import java.util.Enumeration;
Integer newPos = (Integer)oldToNewReferencesLookup.get(oldPos);
if(newPos == null) {
- System.err.println("Couldn't find the new location of the \"slide\" with id " + id + " that used to be at " + oldPos);
- System.err.println("Not updating the position of it, you probably won't be able to find it any more (if you ever could!)");
+ logger.log(POILogger.WARN, "Couldn't find the new location of the \"slide\" with id " + id + " that used to be at " + oldPos);
+ logger.log(POILogger.WARN, "Not updating the position of it, you probably won't be able to find it any more (if you ever could!)");
newPos = oldPos;
}
import java.io.OutputStream;
import java.util.Vector;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogger;
+import org.apache.poi.util.POILogFactory;
import org.apache.poi.hslf.exceptions.CorruptPowerPointFileException;
public abstract class Record
{
- /**
+ // For logging
+ protected POILogger logger = POILogFactory.getLogger(this.getClass());
+
+ /**
* Is this record type an Atom record (only has data),
* or is it a non-Atom record (has other records)?
*/
import org.apache.poi.hslf.model.textproperties.TextProp;
import org.apache.poi.hslf.model.textproperties.TextPropCollection;
import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogger;
+
import java.io.IOException;
import java.io.OutputStream;
import java.io.ByteArrayOutputStream;
}
if (rawContents.length > 0 && textHandled != (size+1)){
- System.err.println("Problem reading paragraph style runs: textHandled = " + textHandled + ", text.size+1 = " + (size+1));
+ logger.log(POILogger.WARN, "Problem reading paragraph style runs: textHandled = " + textHandled + ", text.size+1 = " + (size+1));
}
// Now do the character stylings
}
}
if (rawContents.length > 0 && textHandled != (size+1)){
- System.err.println("Problem reading character style runs: textHandled = " + textHandled + ", text.size+1 = " + (size+1));
+ logger.log(POILogger.WARN, "Problem reading character style runs: textHandled = " + textHandled + ", text.size+1 = " + (size+1));
}
// Handle anything left over