Return-Path: Delivered-To: apmail-poi-commits-archive@locus.apache.org Received: (qmail 86772 invoked from network); 14 Apr 2008 09:21:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Apr 2008 09:21:06 -0000 Received: (qmail 36863 invoked by uid 500); 14 Apr 2008 09:21:06 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 36834 invoked by uid 500); 14 Apr 2008 09:21:06 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 36799 invoked by uid 99); 14 Apr 2008 09:21:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2008 02:21:06 -0700 X-ASF-Spam-Status: No, hits=-1998.0 required=10.0 tests=ALL_TRUSTED,URIBL_BLACK X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2008 09:20:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0D0A71A9832; Mon, 14 Apr 2008 02:20:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r647712 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hslf: ./ record/ usermodel/ Date: Mon, 14 Apr 2008 09:20:32 -0000 To: commits@poi.apache.org From: yegor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080414092038.0D0A71A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: yegor Date: Mon Apr 14 02:20:20 2008 New Revision: 647712 URL: http://svn.apache.org/viewvc?rev=647712&view=rev Log: use commons logging throughout the code Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java Mon Apr 14 02:20:20 2008 @@ -45,13 +45,15 @@ import org.apache.poi.hslf.record.UserEditAtom; import org.apache.poi.hslf.usermodel.ObjectData; import org.apache.poi.hslf.usermodel.PictureData; +import org.apache.poi.hslf.model.Shape; import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.DocumentEntry; import org.apache.poi.poifs.filesystem.DocumentInputStream; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.POILogFactory; -import org.apache.poi.util.POILogger; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * This class contains the main functionality for the Powerpoint file @@ -63,7 +65,7 @@ public class HSLFSlideShow extends POIDocument { // For logging - protected POILogger logger = POILogFactory.getLogger(this.getClass()); + private static final Log logger = LogFactory.getLog(HSLFSlideShow.class); private InputStream istream; @@ -289,7 +291,7 @@ try { currentUser = new CurrentUserAtom(directory); } catch(IOException ie) { - logger.log(POILogger.ERROR, "Error finding Current User Atom:\n" + ie); + logger.error("Error finding Current User Atom:\n" + ie); currentUser = new CurrentUserAtom(); } } @@ -344,8 +346,8 @@ // If they type (including the bonus 0xF018) is 0, skip it if(type == 0) { - logger.log(POILogger.ERROR, "Problem reading picture: Invalid image type 0, on picture with length " + imgsize + ".\nYou document will probably become corrupted if you save it!"); - logger.log(POILogger.ERROR, "" + pos); + logger.error("Problem reading picture: Invalid image type 0, on picture with length " + imgsize + ".\nYou document will probably become corrupted if you save it!"); + logger.error("" + pos); } else { // Copy the data, ready to pass to PictureData byte[] imgdata = new byte[imgsize]; @@ -360,7 +362,7 @@ pict.setOffset(offset); p.add(pict); } catch(IllegalArgumentException e) { - logger.log(POILogger.ERROR, "Problem reading picture: " + e + "\nYou document will probably become corrupted if you save it!"); + logger.error("Problem reading picture: " + e + "\nYou document will probably become corrupted if you save it!"); } } Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java Mon Apr 14 02:20:20 2008 @@ -19,8 +19,6 @@ package org.apache.poi.hslf.record; -import org.apache.poi.util.POILogger; - import java.io.IOException; import java.io.OutputStream; @@ -134,10 +132,10 @@ // (normally it's 2, or 3 if you have notes) // Complain if it's not if(slwtcount == 0) { - logger.log(POILogger.WARN, "No SlideListWithText's found - there should normally be at least one!"); + logger.warn("No SlideListWithText's found - there should normally be at least one!"); } if(slwtcount > 3) { - logger.log(POILogger.WARN, "Found " + slwtcount + " SlideListWithTexts - normally there should only be three!"); + logger.warn("Found " + slwtcount + " SlideListWithTexts - normally there should only be three!"); } // Now grab all the SLWTs Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java Mon Apr 14 02:20:20 2008 @@ -21,7 +21,6 @@ import java.io.IOException; import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.POILogger; /** * This data represents an embedded object in the document. @@ -94,14 +93,14 @@ if(_children[0] instanceof ExEmbedAtom) { embedAtom = (ExEmbedAtom)_children[0]; } else { - logger.log(POILogger.ERROR, "First child record wasn't a ExEmbedAtom, was of type " + _children[0].getRecordType()); + logger.error("First child record wasn't a ExEmbedAtom, was of type " + _children[0].getRecordType()); } // Second child should be the ExOleObjAtom if (_children[1] instanceof ExOleObjAtom) { oleObjAtom = (ExOleObjAtom)_children[1]; } else { - logger.log(POILogger.ERROR, "Second child record wasn't a ExOleObjAtom, was of type " + _children[1].getRecordType()); + logger.error("Second child record wasn't a ExOleObjAtom, was of type " + _children[1].getRecordType()); } for (int i = 2; i < _children.length; i++) { @@ -110,15 +109,15 @@ else if (progId == null) progId = (CString)_children[i]; else if (clipboardName == null) clipboardName = (CString)_children[i]; } else { - logger.log(POILogger.ERROR, "Record after atoms wasn't a CString, was of type " + _children[i].getRecordType()); + logger.error("Record after atoms wasn't a CString, was of type " + _children[i].getRecordType()); } } } /** - * Gets the {@code ExEmbedAtom}. + * Gets the {@link ExEmbedAtom}. * - * @return the {@code ExEmbedAtom}. + * @return the {@link ExEmbedAtom}. */ public ExEmbedAtom getExEmbedAtom() { @@ -126,9 +125,9 @@ } /** - * Gets the {@code ExOleObjAtom}. + * Gets the {@link ExOleObjAtom}. * - * @return the {@code ExOleObjAtom}. + * @return the {@link ExOleObjAtom}. */ public ExOleObjAtom getExOleObjAtom() { Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java Mon Apr 14 02:20:20 2008 @@ -20,7 +20,6 @@ import java.io.OutputStream; import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.POILogger; /** * This class represents the data of a link in the document. @@ -108,7 +107,7 @@ if(_children[0] instanceof ExHyperlinkAtom) { linkAtom = (ExHyperlinkAtom)_children[0]; } else { - logger.log(POILogger.ERROR, "First child record wasn't a ExHyperlinkAtom, was of type " + _children[0].getRecordType()); + logger.error("First child record wasn't a ExHyperlinkAtom, was of type " + _children[0].getRecordType()); } for (int i = 1; i < _children.length; i++) { @@ -116,7 +115,7 @@ if ( linkDetailsA == null) linkDetailsA = (CString)_children[i]; else linkDetailsB = (CString)_children[i]; } else { - logger.log(POILogger.ERROR, "Record after ExHyperlinkAtom wasn't a CString, was of type " + _children[1].getRecordType()); + logger.error("Record after ExHyperlinkAtom wasn't a CString, was of type " + _children[1].getRecordType()); } } Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/FontCollection.java Mon Apr 14 02:20:20 2008 @@ -18,9 +18,6 @@ package org.apache.poi.hslf.record; -import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.POILogger; - import java.io.*; import java.util.*; @@ -49,7 +46,7 @@ FontEntityAtom atom = (FontEntityAtom)_children[i]; fonts.add(atom.getFontName()); } else { - logger.log(POILogger.WARN, "Warning: FontCollection child wasn't a FontEntityAtom, was " + _children[i]); + logger.warn("Warning: FontCollection child wasn't a FontEntityAtom, was " + _children[i]); } } } Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java Mon Apr 14 02:20:20 2008 @@ -20,7 +20,6 @@ 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; @@ -132,7 +131,7 @@ // Wind on int size = r.getRecordSize(); if(size < 8) { - logger.log(POILogger.WARN, "Hit short DDF record at " + startPos + " - " + size); + logger.warn("Hit short DDF record at " + startPos + " - " + size); } /** @@ -142,7 +141,7 @@ * Sometimes it is not so, see an example in bug #44770. Most likely reason is that one of ddf records calculates wrong size. */ if(size != escherBytes){ - logger.log(POILogger.WARN, "Record length=" + escherBytes + " but getRecordSize() returned " + r.getRecordSize() + "; record: " + r.getClass()); + logger.warn("Record length=" + escherBytes + " but getRecordSize() returned " + r.getRecordSize() + "; record: " + r.getClass()); size = escherBytes; } startPos += size; Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java Mon Apr 14 02:20:20 2008 @@ -20,7 +20,6 @@ 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; @@ -195,8 +194,8 @@ Integer newPos = (Integer)oldToNewReferencesLookup.get(oldPos); if(newPos == null) { - 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!)"); + logger.warn("Couldn't find the new location of the \"slide\" with id " + id + " that used to be at " + oldPos); + logger.warn("Not updating the position of it, you probably won't be able to find it any more (if you ever could!)"); newPos = oldPos; } Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java Mon Apr 14 02:20:20 2008 @@ -24,9 +24,9 @@ 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; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** @@ -40,7 +40,7 @@ public abstract class Record { // For logging - protected POILogger logger = POILogFactory.getLogger(this.getClass()); + protected Log logger = LogFactory.getLog(this.getClass()); /** * Is this record type an Atom record (only has data), Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java Mon Apr 14 02:20:20 2008 @@ -31,7 +31,6 @@ 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; /** * A StyleTextPropAtom (type 4001). Holds basic character properties @@ -293,7 +292,7 @@ } if (rawContents.length > 0 && textHandled != (size+1)){ - logger.log(POILogger.WARN, "Problem reading paragraph style runs: textHandled = " + textHandled + ", text.size+1 = " + (size+1)); + logger.warn("Problem reading paragraph style runs: textHandled = " + textHandled + ", text.size+1 = " + (size+1)); } // Now do the character stylings @@ -328,7 +327,7 @@ } } if (rawContents.length > 0 && textHandled != (size+1)){ - logger.log(POILogger.WARN, "Problem reading character style runs: textHandled = " + textHandled + ", text.size+1 = " + (size+1)); + logger.warn("Problem reading character style runs: textHandled = " + textHandled + ", text.size+1 = " + (size+1)); } // Handle anything left over Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java?rev=647712&r1=647711&r2=647712&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java Mon Apr 14 02:20:20 2008 @@ -37,8 +37,8 @@ import org.apache.poi.hslf.exceptions.CorruptPowerPointFileException; import org.apache.poi.hslf.exceptions.HSLFException; import org.apache.poi.util.ArrayUtil; -import org.apache.poi.util.POILogFactory; -import org.apache.poi.util.POILogger; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * This class is a friendly wrapper on top of the more scary HSLFSlideShow. @@ -80,7 +80,7 @@ private FontCollection _fonts; // For logging - private POILogger logger = POILogFactory.getLogger(this.getClass()); + private static final Log logger = LogFactory.getLog(SlideShow.class); /* =============================================================== @@ -275,7 +275,7 @@ Record r = _mostRecentCoreRecords[coreRecordId.intValue()]; return r; } else { - logger.log(POILogger.ERROR, "We tried to look up a reference to a core record, but there was no core ID for reference ID " + refID); + logger.error("We tried to look up a reference to a core record, but there was no core ID for reference ID " + refID); return null; } } @@ -378,7 +378,7 @@ Integer slideId = new Integer(spa.getSlideIdentifier()); slideIdToNotes.put(slideId, new Integer(i)); } else { - logger.log(POILogger.ERROR, "A Notes SlideAtomSet at " + i + " said its record was at refID " + notesSets[i].getSlidePersistAtom().getRefID() + ", but that was actually a " + r); + logger.error("A Notes SlideAtomSet at " + i + " said its record was at refID " + notesSets[i].getSlidePersistAtom().getRefID() + ", but that was actually a " + r); } } notesRecords = new org.apache.poi.hslf.record.Notes[notesRecordsL.size()]; @@ -404,7 +404,7 @@ if(r instanceof org.apache.poi.hslf.record.Slide) { slidesRecords[i] = (org.apache.poi.hslf.record.Slide)r; } else { - logger.log(POILogger.ERROR, "A Slide SlideAtomSet at " + i + " said its record was at refID " + slidesSets[i].getSlidePersistAtom().getRefID() + ", but that was actually a " + r); + logger.error("A Slide SlideAtomSet at " + i + " said its record was at refID " + slidesSets[i].getSlidePersistAtom().getRefID() + ", but that was actually a " + r); } } } @@ -429,7 +429,7 @@ if (noteId != 0){ Integer notesPos = (Integer)slideIdToNotes.get(new Integer(noteId)); if (notesPos != null) notes = _notes[notesPos.intValue()]; - else logger.log(POILogger.ERROR, "Notes not found for noteId=" + noteId); + else logger.error("Notes not found for noteId=" + noteId); } // Now, build our slide @@ -622,7 +622,7 @@ System.arraycopy(_slides, 0, s, 0, _slides.length); s[_slides.length] = slide; _slides = s; - logger.log(POILogger.INFO, "Added slide " + _slides.length + " with ref " + sp.getRefID() + " and identifier " + sp.getSlideIdentifier()); + logger.info("Added slide " + _slides.length + " with ref " + sp.getRefID() + " and identifier " + sp.getSlideIdentifier()); // Add the core records for this new Slide to the record tree org.apache.poi.hslf.record.Slide slideRecord = slide.getSlideRecord(); @@ -658,7 +658,7 @@ // (Also need to tell it where it is) slideRecord.setLastOnDiskOffset(slideOffset); ptr.addSlideLookup(sp.getRefID(), slideOffset); - logger.log(POILogger.INFO, "New slide ended up at " + slideOffset); + logger.info("New slide ended up at " + slideOffset); // Last view is now of the slide usr.setLastViewType((short)UserEditAtom.LAST_VIEW_SLIDE_VIEW); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org