Skip to content
Snippets Groups Projects
Commit ce6fd040 authored by Markus Koschany's avatar Markus Koschany
Browse files

New upstream version 2.3.4

parent bfc4d272
No related branches found
Tags upstream/2.3.4
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<artifactId>sambox</artifactId> <artifactId>sambox</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>sambox</name> <name>sambox</name>
<version>2.3.1</version> <version>2.3.4</version>
<description>An Apache PDFBox fork intended to be used as PDF processor for Sejda and PDFsam related projects</description> <description>An Apache PDFBox fork intended to be used as PDF processor for Sejda and PDFsam related projects</description>
<url>http://www.sejda.org</url> <url>http://www.sejda.org</url>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<connection>scm:git:git@github.com:torakiki/sambox.git</connection> <connection>scm:git:git@github.com:torakiki/sambox.git</connection>
<developerConnection>scm:git:git@github.com:torakiki/sambox.git</developerConnection> <developerConnection>scm:git:git@github.com:torakiki/sambox.git</developerConnection>
<url>scm:git:git@github.com:torakiki/sambox.git</url> <url>scm:git:git@github.com:torakiki/sambox.git</url>
<tag>v2.3.1</tag> <tag>v2.3.4</tag>
</scm> </scm>
<developers> <developers>
......
...@@ -470,7 +470,7 @@ public class PDPageTree implements COSObjectable, Iterable<PDPage> ...@@ -470,7 +470,7 @@ public class PDPageTree implements COSObjectable, Iterable<PDPage>
public void remove(int index) public void remove(int index)
{ {
PageAndPageTreeParent res = get(index + 1, root, 0, null); PageAndPageTreeParent res = get(index + 1, root, 0, null);
remove(res.node); remove(res.node, res.parent);
} }
/** /**
...@@ -487,14 +487,32 @@ public class PDPageTree implements COSObjectable, Iterable<PDPage> ...@@ -487,14 +487,32 @@ public class PDPageTree implements COSObjectable, Iterable<PDPage>
* Removes the given COS page. * Removes the given COS page.
*/ */
private void remove(COSDictionary node) private void remove(COSDictionary node)
{
remove(node, null);
}
/**
* Removes the given COS page.
*/
private void remove(COSDictionary node, COSDictionary knownParent)
{ {
// remove from parent's kids // remove from parent's kids
COSDictionary parent = node.getDictionaryObject(COSName.PARENT, COSName.P, COSDictionary parent = node.getDictionaryObject(COSName.PARENT, COSName.P,
COSDictionary.class); COSDictionary.class);
if(parent == null)
{
// broken node with missing PARENT, use the one known from traversing the page tree
parent = knownParent;
}
COSArray kids = parent.getDictionaryObject(COSName.KIDS, COSArray.class); COSArray kids = parent.getDictionaryObject(COSName.KIDS, COSArray.class);
if (kids.removeObject(node)) if (kids.removeObject(node))
{ {
// update ancestor counts // update ancestor counts
parent.setInt(COSName.COUNT, parent.getInt(COSName.COUNT) - 1);
node = parent;
do do
{ {
node = node.getDictionaryObject(COSName.PARENT, COSName.P, COSDictionary.class); node = node.getDictionaryObject(COSName.PARENT, COSName.P, COSDictionary.class);
......
...@@ -246,7 +246,7 @@ public abstract class PDNameTreeNode<T extends COSObjectable> implements COSObje ...@@ -246,7 +246,7 @@ public abstract class PDNameTreeNode<T extends COSObjectable> implements COSObje
return names.get(name); return names.get(name);
} }
} }
catch (IOException e) catch (IOException | ClassCastException e)
{ {
LOG.warn("NameTreeNode couldn't get the names map", e); LOG.warn("NameTreeNode couldn't get the names map", e);
} }
......
...@@ -115,6 +115,7 @@ public class AxialShadingContext extends ShadingContext implements PaintContext ...@@ -115,6 +115,7 @@ public class AxialShadingContext extends ShadingContext implements PaintContext
{ {
LOG.error(ex.getMessage() + ", matrix: " + matrix, ex); LOG.error(ex.getMessage() + ", matrix: " + matrix, ex);
LOG.error(ex.getMessage(), ex); LOG.error(ex.getMessage(), ex);
rat = new AffineTransform();
} }
// shading space -> device space // shading space -> device space
......
...@@ -441,12 +441,6 @@ public abstract class PDButton extends PDTerminalField ...@@ -441,12 +441,6 @@ public abstract class PDButton extends PDTerminalField
List<String> options = getExportValues(); List<String> options = getExportValues();
Set<String> uniqueOptions = new HashSet<>(options); Set<String> uniqueOptions = new HashSet<>(options);
if (widgets.size() != options.size() && uniqueOptions.size() > 1)
{
throw new IllegalArgumentException(
"The number of options doesn't match the number of widgets");
}
if (value.equals(COSName.Off.getName())) if (value.equals(COSName.Off.getName()))
{ {
updateByValue(value); updateByValue(value);
...@@ -465,8 +459,16 @@ public abstract class PDButton extends PDTerminalField ...@@ -465,8 +459,16 @@ public abstract class PDButton extends PDTerminalField
if (onValue != null) if (onValue != null)
{ {
updateByValue(onValue); updateByValue(onValue);
return;
} }
} }
// we reach here if update failed
if (widgets.size() != options.size() && uniqueOptions.size() > 1)
{
throw new IllegalArgumentException(
"The number of options doesn't match the number of widgets");
}
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment