From a0de2a3b2a5f4a99f280f5caebbca0d183ae109a Mon Sep 17 00:00:00 2001 From: tknall Date: Wed, 7 Feb 2007 10:08:21 +0000 Subject: Bugfix: Querformat, BKU 2.7.x, ... git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@35 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/com/lowagie/text/pdf/PdfDictionary.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/lowagie/text/pdf') diff --git a/src/main/java/com/lowagie/text/pdf/PdfDictionary.java b/src/main/java/com/lowagie/text/pdf/PdfDictionary.java index f7310e4..acf84d5 100644 --- a/src/main/java/com/lowagie/text/pdf/PdfDictionary.java +++ b/src/main/java/com/lowagie/text/pdf/PdfDictionary.java @@ -105,11 +105,20 @@ public class PdfDictionary extends PdfObject { /** This is the hashmap that contains all the values and keys of the dictionary */ protected HashMap hashMap; + + // EGIZ various modifications /** * This list preserves the order of the elements. + * + *

+ * If an element to be added to the list already exists in the list, + * it sould not be added as the contents of this new element + * overwrites the contents of the old element in the hash map. + *

*/ protected List list; + // constructors /** @@ -175,8 +184,13 @@ public class PdfDictionary extends PdfObject { */ public void put(PdfName key, PdfObject value) { + if (!hashMap.containsKey(key)) + { + // If the key is new, add it to the ordered list. + // If not, it already has a position in the list. + list.add(key); + } hashMap.put(key, value); - list.add(key); } /** -- cgit v1.2.3