Author: yegor
Date: Thu May 24 04:05:24 2007
New Revision: 541267
URL: http://svn.apache.org/viewvc?view=rev&rev=541267
Log:
throw HSLFException instead of RuntimeException
Added:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/exceptions/HSLFException.java
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PNG.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Fill.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java
Thu May 24 04:05:24 2007
@@ -37,6 +37,7 @@
import org.apache.poi.hslf.exceptions.CorruptPowerPointFileException;
import org.apache.poi.hslf.exceptions.EncryptedPowerPointFileException;
+import org.apache.poi.hslf.exceptions.HSLFException;
import org.apache.poi.hslf.record.*;
import org.apache.poi.hslf.usermodel.PictureData;
@@ -376,7 +377,7 @@
int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset();
Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(new
Integer(oldLastUserEditAtomPos));
if(newLastUserEditAtomPos == null) {
- throw new RuntimeException("Couldn't find the new location of
the UserEditAtom that used to be at " + oldLastUserEditAtomPos);
+ throw new HSLFException("Couldn't find the new location of the
UserEditAtom that used to be at " + oldLastUserEditAtomPos);
}
currentUser.setCurrentEditOffset(newLastUserEditAtomPos.intValue());
currentUser.writeToFS(outFS);
Modified: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/EMF.java Thu
May 24 04:05:24 2007
@@ -18,6 +18,7 @@
import org.apache.poi.hslf.model.Picture;
import org.apache.poi.hslf.model.Shape;
+import org.apache.poi.hslf.exceptions.HSLFException;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@@ -55,7 +56,7 @@
inflater.close();
return out.toByteArray();
} catch (IOException e){
- throw new RuntimeException(e);
+ throw new HSLFException(e);
}
}
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java Thu
May 24 04:05:24 2007
@@ -18,6 +18,7 @@
import org.apache.poi.hslf.model.Picture;
import org.apache.poi.hslf.model.Shape;
+import org.apache.poi.hslf.exceptions.HSLFException;
import org.apache.poi.util.LittleEndian;
import java.io.*;
@@ -56,7 +57,7 @@
out.write(pict);
return out.toByteArray();
} catch (IOException e){
- throw new RuntimeException(e);
+ throw new HSLFException(e);
}
}
Modified: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PNG.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PNG.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PNG.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/PNG.java Thu
May 24 04:05:24 2007
@@ -17,6 +17,7 @@
package org.apache.poi.hslf.blip;
import org.apache.poi.hslf.model.Picture;
+import org.apache.poi.hslf.exceptions.HSLFException;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
@@ -45,7 +46,7 @@
data = png;
}
} catch (IOException e){
- throw new RuntimeException(e);
+ throw new HSLFException(e);
}
return data;
}
Modified: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/blip/WMF.java Thu
May 24 04:05:24 2007
@@ -19,6 +19,7 @@
import org.apache.poi.util.LittleEndian;
import org.apache.poi.hslf.model.Picture;
import org.apache.poi.hslf.model.Shape;
+import org.apache.poi.hslf.exceptions.HSLFException;
import java.io.*;
import java.util.zip.InflaterInputStream;
@@ -60,7 +61,7 @@
inflater.close();
return out.toByteArray();
} catch (IOException e){
- throw new RuntimeException(e);
+ throw new HSLFException(e);
}
}
@@ -130,7 +131,7 @@
public void read(byte[] data, int offset){
int pos = offset;
int key = LittleEndian.getInt(data, pos); pos +=
LittleEndian.INT_SIZE; //header key
- if (key != APMHEADER_KEY) throw new RuntimeException("Not a valid
WMF file");
+ if (key != APMHEADER_KEY) throw new HSLFException("Not a valid WMF
file");
handle = LittleEndian.getUShort(data, pos); pos +=
LittleEndian.SHORT_SIZE;
left = LittleEndian.getUShort(data, pos); pos +=
LittleEndian.SHORT_SIZE;
@@ -143,7 +144,7 @@
checksum = LittleEndian.getShort(data, pos); pos +=
LittleEndian.SHORT_SIZE;
if (checksum != getChecksum())
- throw new RuntimeException("WMF checksum does not match the
header data");
+ throw new HSLFException("WMF checksum does not match the
header data");
}
/**
Added:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/exceptions/HSLFException.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/exceptions/HSLFException.java?view=auto&rev=541267
==============================================================================
---
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/exceptions/HSLFException.java
(added)
+++
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/exceptions/HSLFException.java
Thu May 24 04:05:24 2007
@@ -0,0 +1,43 @@
+
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.hslf.exceptions;
+
+/**
+ * A generic exception that can be thrown by HSLF classes
+ *
+ * @author Yegor Kozlov
+ */
+public class HSLFException extends RuntimeException {
+
+ public HSLFException() {
+ super();
+ }
+
+ public HSLFException(String message) {
+ super(message);
+ }
+
+ public HSLFException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public HSLFException(Throwable cause) {
+ super(cause);
+ }
+}
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Fill.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Fill.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Fill.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Fill.java
Thu May 24 04:05:24 2007
@@ -22,6 +22,7 @@
import org.apache.poi.hslf.record.*;
import org.apache.poi.hslf.usermodel.PictureData;
import org.apache.poi.hslf.usermodel.SlideShow;
+import org.apache.poi.hslf.exceptions.HSLFException;
import java.awt.*;
import java.util.*;
@@ -211,7 +212,7 @@
return pict[i];
}
}
- throw new RuntimeException("Picture data not found: \n" +
+ throw new HSLFException("Picture data not found: \n" +
" bse: " + bse + " at " + bse.getOffset() );
}
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
---
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java
(original)
+++
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java
Thu May 24 04:05:24 2007
@@ -31,6 +31,7 @@
import org.apache.poi.ddf.EscherProperties;
import org.apache.poi.hslf.usermodel.RichTextRun;
+import org.apache.poi.hslf.exceptions.HSLFException;
/**
* Translates Graphics2D calls into PowerPoint.
@@ -252,43 +253,43 @@
}
//===============================================
public void drawRoundRect(int x, int y, int width, int height, int
arcWidth, int arcHeight) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawString(String str, int x, int y) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void fillOval(int x, int y, int width, int height) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void fillRoundRect(int x, int y, int width, int height, int
arcWidth, int arcHeight) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void fillArc(int x, int y, int width, int height,
int startAngle, int arcAngle) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void setPaintMode() {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawArc(int x, int y, int width, int height,
int startAngle, int arcAngle) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawPolyline(int xPoints[], int yPoints[],
int nPoints) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public Graphics create() {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawOval(int x, int y, int width, int height) {
@@ -308,21 +309,21 @@
}
public void setXORMode(Color color1) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public boolean drawImage(Image img, int x, int y,
Color bgcolor,
ImageObserver observer) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public boolean drawImage(Image img, int x, int y,
int width, int height,
Color bgcolor,
ImageObserver observer) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
@@ -330,7 +331,7 @@
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
ImageObserver observer) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public boolean drawImage(Image img,
@@ -338,22 +339,22 @@
int sx1, int sy1, int sx2, int sy2,
Color bgcolor,
ImageObserver observer) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public boolean drawImage(Image img, int x, int y,
ImageObserver observer) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public boolean drawImage(Image img, int x, int y,
int width, int height,
ImageObserver observer) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void dispose() {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawLine(int x1, int y1, int x2, int y2) {
@@ -369,61 +370,61 @@
public void fillPolygon(int xPoints[], int yPoints[],
int nPoints) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public FontMetrics getFontMetrics(Font f) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void fillRect(int x, int y, int width, int height) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawPolygon(int xPoints[], int yPoints[],
int nPoints) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void clipRect(int x, int y, int width, int height) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void setClip(Shape clip) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public java.awt.Rectangle getClipBounds() {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawString(AttributedCharacterIterator iterator, int x, int y)
{
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void clearRect(int x, int y, int width, int height) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void copyArea(int x, int y, int width, int height, int dx, int dy) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void setClip(int x, int y, int width, int height) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void rotate(double d) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void rotate(double d, double d1, double d2) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void shear(double d, double d1) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public FontRenderContext getFontRenderContext() {
@@ -431,83 +432,83 @@
}
public void transform(AffineTransform affinetransform) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawImage(BufferedImage bufferedimage, BufferedImageOp op, int
x, int y) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void setBackground(Color c) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawRenderedImage(RenderedImage renderedimage, AffineTransform
affinetransform) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public Color getBackground() {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void setComposite(Composite composite) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public Composite getComposite() {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public Object getRenderingHint(java.awt.RenderingHints.Key key) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public boolean drawImage(Image image, AffineTransform affinetransform,
ImageObserver imageobserver) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void setRenderingHint(java.awt.RenderingHints.Key key, Object obj) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawGlyphVector(GlyphVector g, float x, float y) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public GraphicsConfiguration getDeviceConfiguration() {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void addRenderingHints(Map map) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void translate(double d, double d1) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawString(AttributedCharacterIterator
attributedcharacteriterator, float x, float y) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public boolean hit(java.awt.Rectangle rectangle, Shape shape, boolean
flag) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public RenderingHints getRenderingHints() {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void setRenderingHints(Map map) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
public void drawRenderableImage(RenderableImage renderableimage,
AffineTransform affinetransform) {
- throw new RuntimeException("Not implemented");
+ throw new HSLFException("Not implemented");
}
}
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
---
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java
(original)
+++
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java
Thu May 24 04:05:24 2007
@@ -19,6 +19,7 @@
import org.apache.poi.ddf.*;
import org.apache.poi.hslf.record.OEPlaceholderAtom;
+import org.apache.poi.hslf.exceptions.HSLFException;
import java.util.List;
import java.io.ByteArrayOutputStream;
@@ -80,7 +81,7 @@
try {
oep.writeOut(out);
} catch(Exception e){
- throw new RuntimeException(e);
+ throw new HSLFException(e);
}
cldata.setRemainingData(out.toByteArray());
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
---
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
(original)
+++
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
Thu May 24 04:05:24 2007
@@ -16,6 +16,8 @@
==================================================================== */
package org.apache.poi.hslf.model;
+import org.apache.poi.hslf.exceptions.HSLFException;
+
import java.util.HashMap;
import java.lang.reflect.Field;
@@ -251,7 +253,7 @@
}
}
} catch (IllegalAccessException e){
- throw new RuntimeException("Failed to initialize shape types");
+ throw new HSLFException("Failed to initialize shape types");
}
}
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java
Thu May 24 04:05:24 2007
@@ -21,6 +21,7 @@
import org.apache.poi.ddf.*;
import org.apache.poi.hslf.record.*;
import org.apache.poi.hslf.usermodel.RichTextRun;
+import org.apache.poi.hslf.exceptions.HSLFException;
import java.awt.*;
import java.awt.font.FontRenderContext;
@@ -193,7 +194,7 @@
try {
_txtbox.writeOut(null);
} catch (IOException e){
- throw new RuntimeException(e);
+ throw new HSLFException(e);
}
if(getAnchor().equals(new java.awt.Rectangle())) resizeToFitText();
}
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
---
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java
(original)
+++
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/PictureData.java
Thu May 24 04:05:24 2007
@@ -19,6 +19,7 @@
import org.apache.poi.util.LittleEndian;
import org.apache.poi.hslf.model.Picture;
import org.apache.poi.hslf.blip.*;
+import org.apache.poi.hslf.exceptions.HSLFException;
import java.io.OutputStream;
import java.io.IOException;
@@ -121,7 +122,7 @@
try {
sha = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e){
- throw new RuntimeException(e.getMessage());
+ throw new HSLFException(e.getMessage());
}
sha.update(data);
return sha.digest();
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java
URL:
http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java?view=diff&rev=541267&r1=541266&r2=541267
==============================================================================
---
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java
(original)
+++
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java
Thu May 24 04:05:24 2007
@@ -35,6 +35,7 @@
import org.apache.poi.hslf.record.SlideListWithText.*;
import org.apache.poi.hslf.record.*;
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;
@@ -739,7 +740,7 @@
is.read(data);
is.close();
} catch (IOException e){
- throw new RuntimeException(e);
+ throw new HSLFException(e);
}
return addPicture(data, format);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/