Sat, 08 Mar 2003 09:23:05 +0000
fix bugs in pdf_split_name_tree_node().
pdf_name_tree.c | file | annotate | diff | revisions |
1.1 diff -r 870a093b587c -r a9991578aa3f pdf_name_tree.c 1.2 --- a/pdf_name_tree.c Sat Mar 08 07:45:46 2003 +0000 1.3 +++ b/pdf_name_tree.c Sat Mar 08 09:23:05 2003 +0000 1.4 @@ -4,7 +4,7 @@ 1.5 * will be compressed using ITU-T T.6 (G4) fax encoding. 1.6 * 1.7 * PDF routines 1.8 - * $Id: pdf_name_tree.c,v 1.5 2003/03/07 23:45:46 eric Exp $ 1.9 + * $Id: pdf_name_tree.c,v 1.6 2003/03/08 01:23:05 eric Exp $ 1.10 * Copyright 2003 Eric Smith <eric@brouhaha.com> 1.11 * 1.12 * This program is free software; you can redistribute it and/or modify 1.13 @@ -167,7 +167,7 @@ 1.14 i++; 1.15 1.16 /* move other entries right one position */ 1.17 - if (i != node->count) 1.18 + if (i != parent->count) 1.19 { 1.20 memmove (& parent->kids [i+1], 1.21 & parent->kids [i], 1.22 @@ -206,7 +206,7 @@ 1.23 1.24 /* figure out in which slot to insert it */ 1.25 for (i = 0; i < node->count; i++) 1.26 - if (pdf_compare_obj (key, node->keys [i] < 0)) 1.27 + if (pdf_compare_obj (key, node->keys [i]) < 0) 1.28 break; 1.29 1.30 /* move other entries right one position */ 1.31 @@ -235,7 +235,7 @@ 1.32 node->min_key = key; 1.33 } 1.34 } 1.35 - else if (i == (node->count - 1)) 1.36 + if (i == (node->count - 1)) 1.37 { 1.38 node->max_key = key; 1.39 while (node->parent && (node->parent->kids [node->parent->count - 1] == node)) 1.40 @@ -299,7 +299,7 @@ 1.41 pdf_set_dict_entry (node->dict, "Kids", kids); 1.42 } 1.43 1.44 - if (! node->parent) 1.45 + if (node->parent) 1.46 { 1.47 /* write Limits array */ 1.48 struct pdf_obj *limits = pdf_new_obj (PT_ARRAY);