summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2018-02-03 06:33:19 -0500
committerKurt <kurt.w.jung@gmail.com>2018-02-03 06:33:19 -0500
commita54c36de12e47a056125a56b2a9ef77c4cb74cb4 (patch)
tree7338a5f78613b7b018c2e962d5b56e8e95cd6709
parentdb5f2eb6b1ec30bc26c7454d8341249aeb8fbd36 (diff)
parent7dba5968392517e366ba4cfe4b3a44f9375849ba (diff)
Merge branch 'thwarted-stable-obj-ordering'
-rw-r--r--fpdf.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/fpdf.go b/fpdf.go
index ad29d18..b8875a5 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -3199,7 +3199,7 @@ func (f *Fpdf) putfonts() {
fileList = append(fileList, file)
}
if f.catalogSort {
- sort.Strings(fileList)
+ sort.SliceStable(fileList, func(i, j int) bool { return fileList[i] < fileList[j] })
}
for _, file = range fileList {
info = f.fontFiles[file]
@@ -3249,7 +3249,7 @@ func (f *Fpdf) putfonts() {
keyList = append(keyList, key)
}
if f.catalogSort {
- sort.Strings(keyList)
+ sort.SliceStable(keyList, func(i, j int) bool { return keyList[i] < keyList[j] })
}
for _, key = range keyList {
font = f.fonts[key]
@@ -3350,7 +3350,7 @@ func (f *Fpdf) putimages() {
keyList = append(keyList, key)
}
if f.catalogSort {
- sort.Strings(keyList)
+ sort.SliceStable(keyList, func(i, j int) bool { return f.images[keyList[i]].w < f.images[keyList[j]].w })
}
for _, key = range keyList {
f.putimage(f.images[key])
@@ -3430,7 +3430,7 @@ func (f *Fpdf) putxobjectdict() {
keyList = append(keyList, key)
}
if f.catalogSort {
- sort.Strings(keyList)
+ sort.SliceStable(keyList, func(i, j int) bool { return f.images[keyList[i]].i < f.images[keyList[j]].i })
}
for _, key = range keyList {
image = f.images[key]
@@ -3464,7 +3464,7 @@ func (f *Fpdf) putresourcedict() {
keyList = append(keyList, key)
}
if f.catalogSort {
- sort.Strings(keyList)
+ sort.SliceStable(keyList, func(i, j int) bool { return f.fonts[keyList[i]].I < f.fonts[keyList[j]].I })
}
for _, key = range keyList {
font = f.fonts[key]