PATCH: Save/Load of multiple image and layer
Toshitaka Fujioka
kimageshop@mail.kde.org
Sun, 19 Aug 2001 19:34:15 +0900
--------------Boundary-00=_3D9BCCQG6ZBYUAYOTB9D
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Hello,
This patch can save/load of multiple image and layer. But, this patch is not
compatible with former file.
Is compatibility with former file necessary ?
Please review.
--
Toshitaka Fujioka
http://www.kde.org The K Desktop Environment Project
fujioka@kde.org
http://www.kde.gr.jp Japan KDE User's Group
toshitaka@kde.gr.jp
-- We offer the best Desktop Environment to you. (This is my goal. ;-)) --
--------------Boundary-00=_3D9BCCQG6ZBYUAYOTB9D
Content-Type: text/x-diff;
charset="iso-8859-1";
name="koffice-krayon-filesave-fix-20010819.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="koffice-krayon-filesave-fix-20010819.diff"
SW5kZXg6IGtpc19kb2MuY2MKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2hvbWUva2RlL2tvZmZpY2Uv
a3JheW9uL2NvcmUva2lzX2RvYy5jYyx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS41OApkaWZmIC11
IC0zIC1kIC1wIC1yMS41OCBraXNfZG9jLmNjCi0tLSBraXNfZG9jLmNjCTIwMDEvMDgvMTggMTE6
MjI6MDUJMS41OAorKysga2lzX2RvYy5jYwkyMDAxLzA4LzE5IDEwOjI3OjE1CkBAIC0xNjAsMTE1
ICsxNjAsMTM5IEBAIEtpc1RpbWVyOjpzdG9wKCJpbml0RG9jKCkiKTsKIAogCiAvKgotICAgIFNh
dmUgY3VycmVudCBkb2N1bWVudCAoaW1hZ2UpIHRvIHhtbCBmb3JtYXQgdXNpbmcgUURvbURvY3Vt
ZW50CisgICAgU2F2ZSBkb2N1bWVudCAoaW1hZ2UpIHRvIHhtbCBmb3JtYXQgdXNpbmcgUURvbURv
Y3V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wgImNoYW5u
ZWwgZWxlbWVudHMiIDw8IGVuZGw7CisKKyAgICAgICAgICAgIC8vIGNoYW5uZWwgZWxlbWVudHMK
KyAgICAgICAgICAgIGZvciAoIEtpc0NoYW5uZWwqIGNoID0gbGF5LT5maXJzdENoYW5uZWwoKTsg
Y2ggIT0gMDsgY2ggPSBsYXktPm5leHRDaGFubmVsKCkgKQorICAgICAgICAgICAgeworICAgICAg
ICAgICAgICAgIFFEb21FbGVtZW50IGNoYW5uZWwgPSBkb2MuY3JlYXRlRWxlbWVudCggImNoYW5u
ZWwiICk7CisKKyAgICAgICAgICAgICAgICBjaGFubmVsLnNldEF0dHJpYnV0ZSggImNJZCIsIHN0
YXRpY19jYXN0PGludD4oY2gtPmNoYW5uZWxJZCgpKSApOworICAgICAgICAgICAgICAgIGNoYW5u
ZWwuc2V0QXR0cmlidXRlKCAiYml0RGVwdGgiLCBzdGF0aWNfY2FzdDxpbnQ+KGNoLT5iaXREZXB0
aCgpKSApOworCisgICAgICAgICAgICAgICAga2REZWJ1ZygwKSA8PCAiY0lkOiAiIDw8ICBzdGF0
aWNfY2FzdDxpbnQ+KGNoLT5jaGFubmVsSWQoKSkgIDw8IGVuZGw7CisgICAgICAgICAgICAgICAg
a2REZWJ1ZygwKSA8PCAiYml0RGVwdGg6ICIgPDwgIHN0YXRpY19jYXN0PGludD4oY2gtPmJpdERl
cHRoKCkpICA8PCBlbmRsOworCisgICAgICAgICAgICAgICAgY2hhbm5lbHMuYXBwZW5kQ2hpbGQo
IGNoYW5uZWwgKTsKKworICAgICAgICAgICAgfSAvLyBlbmQgb2YgY2hhbm5lbHMgbG9vcAorICAg
ICAgICB9IC8vIGVuZCBvZiBsYXllcnMgbG9vcAorICAgIH0gLy8gZW5kIG9mIGltYWdlcyBsb29w
CisKKyAgICBzZXRJbWFnZSggdG1wX2N1cnJlbnRJbWFnZU5hbWUgKTsKKworICAgIHJldHVybiBp
bWFnZXM7CiB9CiAKKwogLyoKICAgICBTYXZlIGV4d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PSAwICkKKyAgICAgICAgICAgICAgICAgICAgbGF5ZXIgPSBRU3RyaW5nOjpmcm9tTGF0aW4x
KCAiYmFja2dyb3VuZCIgKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg
ICAgIGxheWVyID0gUVN0cmluZyggImxheWVyJTEiICkuYXJnKCBsYXllck51bWJlcnMgKTsKIAot
a2REZWJ1ZygwKSA8PCAiS2lzRG9jOjpjb21wbGV0ZVNhdmluZygpIGxlYXZpbmciIDw8IGVuZGw7
CisgICAgICAgICAgICAgICAgUVN0cmluZyB1cmwgPSBRU3RyaW5nKCAiaW1hZ2VzLyUxL2xheWVy
cy8lMi9jaGFubmVscy9jaCUzLmJpbiIgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
LmFyZyggaW1hZ2UgKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFyZyggbGF5ZXIg
KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFyZyggc3RhdGljX2Nhc3Q8aW50Pihj
aC0+Y2hhbm5lbElkKCkpICk7CiAKKyAgICAgICAgICAgICAgICBpZiAoIHN0b3JlLT5vcGVuKCB1
cmwgKSApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjaC0+d3JpdGVU
b1N0b3JlKHN0b3JlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RvcmUtPmNsb3NlKCk7CisgICAg
ICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgKytsYXllck51bWJlcnM7
CisgICAgICAgIH0KKyAgICAgICAgKytpbWFnZU51bWJlcnM7CisgICAgfQorICAgIGtkRGVidWco
MCkgPDwgIktpc0RvYzo6Y29tcGxldGVTYXZpbmcoKSBsZWF2aW5nIiA8PCBlbmRsOworICAgIHNl
dEltYWdlKCB0bXBfY3VycmVudEltYWdlTmFtZSApOworCiAgICAgcmV0dXJuIHRydWU7CiB9CiAK
QEAgLTMxOSwxMjEgKzM2Myw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AgICBicmVhazsKLQkgIGNhc2UgNToKLQkgICAgY29sb3JNb2RlID0gY21fQ01ZS0E7Ci0JICAg
IGJyZWFrOwotCSAgY2FzZSA2OgotCSAgICBjb2xvck1vZGUgPSBjbV9MYWI7Ci0JICAgIGJyZWFr
OwotCSAgY2FzZSA3OgotCSAgICBjb2xvck1vZGUgPSBjbV9MYWJBOwotCSAgICBicmVhazsKLQkg
IGRlZmF1bHQ6Ci0JICAgIHJldHVybiBmYWxzZTsKLSAgICB9CisgICAgICAgICAgICBzd2l0Y2gg
KCBjbSApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAg
ICAgICAgICAgICBjb2xvck1vZGUgPSBjbV9JbmRleGVkOworICAgICAgICAgICAgICAgICAgICBi
cmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgIGNvbG9y
TW9kZSA9IGNtX0dyZXlzY2FsZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg
ICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICBjb2xvck1vZGUgPSBjbV9SR0I7
CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgMzoKKyAg
ICAgICAgICAgICAgICAgICAgY29sb3JNb2RlID0gY21fUkdCQTsKKyAgICAgICAgICAgICAgICAg
ICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgICBj
b2xvck1vZGUgPSBjbV9DTVlLOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg
ICAgICAgICBjYXNlIDU6CisgICAgICAgICAgICAgICAgICAgIGNvbG9yTW9kZSA9IGNtX0NNWUtB
OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDY6Cisg
ICAgICAgICAgICAgICAgICAgIGNvbG9yTW9kZSA9IGNtX0xhYjsKKyAgICAgICAgICAgICAgICAg
ICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSA3OgorICAgICAgICAgICAgICAgICAgICBj
b2xvck1vZGUgPSBjbV9MYWJBOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg
ICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAg
ICAgICAgICB9CiAKLSAgICBLaXNJbWFnZSAqaW1nID0gbmV3SW1hZ2UobmFtZSwgdywgaCwgY29s
b3JNb2RlLCBiZCk7Ci0gICAgaWYgKCFpbWcpIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIEtp
c0ltYWdlICppbWcgPSBuZXdJbWFnZSggbmFtZSwgdywgaCwgY29sb3JNb2RlLCBiZCApOworICAg
ICAgICAgICAgaWYgKCAhaW1nICkgcmV0dXJuIGZhbHNlOwogCi0gICAgaW1nLT5zZXRBdXRob3Io
IGltYWdlLmF0dHJpYnV0ZSggImF1dGhvciIgKSk7Ci0gICAgaW1nLT5zZXRFbWFpbCggaW1hZ2Uu
YXR0cmlidXRlKCAiZW1haWwiICkpOworICAgICAgICAgICAgaW1nLT5zZXRBdXRob3IoIGVsZW0u
YXR0cmlidXRlKCAiYXV0aG9yIiApICk7CisgICAgICAgICAgICBpbWctPnNldEVtYWlsKCBlbGVt
LmF0dHJpYnV0ZSggImVtYWlsIiApICk7CiAKLSAgICAvLyBsYXllcnMgZWxlbWVudAotICAgIFFE
b21FbGVtZW50IGxheWVycyA9IGltYWdlLm5hbWVkSXRlbSggImxheWVycyIgKS50b0VsZW1lbnQo
KTsKLSAgICBpZiAobGF5ZXJzLmlzTnVsbCgpKQotICAgIHsKLSAgICAgICAga2REZWJ1ZygwKSA8
PCAiS2lzRG9jOjpsb2FkWE1MKCk6IGxheWVycy5pc051bGwoKSBlcnJvciEiIDw8IGVuZGw7Ci0g
ICAgICAgIHJldHVybiBmYWxzZTsKLSAgICB9CisgICAgICAgICAgICAvLyBsYXllcnMgZWxlbWVu
dAorICAgICAgICAgICAgUURvbUVsZW1lbnQgbGF5ZXJzID0gZWxlbS5uYW1lZEl0ZW0oICJsYXll
cnMiICkudG9FbGVtZW50KCk7CisgICAgICAgICAgICBpZiAoIGxheWVycy5pc051bGwoKSApCisg
ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAga2REZWJ1ZygwKSA8PCAiS2lzRG9jOjpsb2Fk
WE1MKCk6IGxheWVycy5pc051bGwoKSBlcnJvciEiIDw8IGVuZGw7CisgICAgICAgICAgICAgICAg
cmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQogCi0gICAgLy8gbGF5ZXIgZWxlbWVudHMKLSAg
ICBRRG9tTm9kZSBsID0gbGF5ZXJzLmZpcnN0Q2hpbGQoKTsKKyAgICAgICAgICAgIC8vIGxheWVy
IGVsZW1lbnRzCisgICAgICAgICAgICBRRG9tTm9kZSBsID0gbGF5ZXJzLmZpcnN0Q2hpbGQoKTsK
IAotICAgIHdoaWxlICghbC5pc051bGwoKSkKLSAgICB7Ci0gICAgICAgIFFEb21FbGVtZW50IGxh
eWVyID0gbC50b0VsZW1lbnQoKTsKLSAgICAgICAgaWYgKGxheWVyLnRhZ05hbWUoKSAhPSAibGF5
ZXIiICkgY29udGludWU7CisgICAgICAgICAgICB3aGlsZSAoICFsLmlzTnVsbCgpICkKKyAgICAg
ICAgICAgIHsKKyAgICAgICAgICAgICAgICBRRG9tRWxlbWVudCBsYXllciA9IGwudG9FbGVtZW50
KCk7CisgICAgICAgICAgICAgICAgaWYgKCBsYXllci50YWdOYW1lKCkgIT0gImxheWVyIiApIGNv
bnRpbnVlOwogCi0JICAgIGNvdXQgPDwgImxheWVyIiA8PCBlbmRsOworICAgICAgICAgICAgICAg
IGtkRGVidWcoMCkgPDwgImxheWVyIiA8PCBlbmRsOwogCi0JICAgIC8vIGNoYW5uZWxzIGVsZW1l
bnQKLQkgICAgUURvbUVsZW1lbnQgY2hhbm5lbHMgPSBsYXllci5uYW1lZEl0ZW0oICJjaGFubmVs
cyIgKS50b0VsZW1lbnQoKTsKLQkgICAgaWYgKGNoYW5uZWxzLmlzTnVsbCgpKSBjb250aW51ZTsK
KyAgICAgICAgICAgICAgICBRU3RyaW5nIGxheWVyTmFtZSA9IGxheWVyLmF0dHJpYnV0ZSggIm5h
bWUiICk7CisgICAgICAgICAgICAgICAgaW50IHcgPSBsYXllci5hdHRyaWJ1dGUoICJ3aWR0aCIg
KS50b0ludCgpOworICAgICAgICAgICAgICAgIGludCBoID0gbGF5ZXIuYXR0cmlidXRlKCAiaGVp
Z2h0IiApLnRvSW50KCk7CisgICAgICAgICAgICAgICAgaW50IHggPSBsYXllci5hdHRyaWJ1dGUo
ICJ4IiApLnRvSW50KCk7CisgICAgICAgICAgICAgICAgaW50IHkgPSBsYXllci5hdHRyaWJ1dGUo
ICJ5IiApLnRvSW50KCk7CiAKLQkgICAgLy8gY2hhbm5lbCBlbGVtZW50cwotCSAgICBRRG9tTm9k
ZSBjID0gY2hhbm5lbHMuZmlyc3RDaGlsZCgpOworICAgICAgICAgICAgICAgIGltZy0+YWRkTGF5
ZXIoIFFSZWN0KCB4LCB5LCB3LCBoICksIEtpc0NvbG9yOjp3aGl0ZSgpLCB0cnVlLCBsYXllck5h
bWUgKTsKKyAgICAgICAgICAgICAgICBpbWctPm1hcmtEaXJ0eSggUVJlY3QoIHgsIHksIHcsIGgg
KSApOwogCi0JICAgIHdoaWxlICghYy5pc051bGwoKSkKLQkgICAgewotCSAgICAgICAgUURvbUVs
ZW1lbnQgY2hhbm5lbCA9IGMudG9FbGVtZW50KCk7Ci0JICAgICAgICBpZiAoY2hhbm5lbC50YWdO
YW1lKCkgIT0gImNoYW5uZWwiICkgY29udGludWU7CisgICAgICAgICAgICAgICAgS2lzTGF5ZXIg
KmxheSA9IGltZy0+Z2V0Q3VycmVudExheWVyKCk7CisgICAgICAgICAgICAgICAgbGF5LT5zZXRP
cGFjaXR5KCBsYXllci5hdHRyaWJ1dGUoICJvcGFjaXR5IiApLnRvSW50KCkgKTsKIAotICAgICAg
ICAgICAgY291dCA8PCAiY2hhbm5lbCIgPDwgZW5kbDsKLQkgICAgICAgIGMgPSBjLm5leHRTaWJs
aW5nKCk7Ci0JICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIGxheWVyLmF0dHJpYnV0ZSggInZp
c2libGUiICkgPT0gInRydWUiICkKKyAgICAgICAgICAgICAgICAgICAgbGF5LT5zZXRWaXNpYmxl
KCB0cnVlICk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBsYXkt
PnNldFZpc2libGUoIGZhbHNlICk7CiAKLQkgICAgbCA9IGwubmV4dFNpYmxpbmcoKTsKLSAgICB9
CisgICAgICAgICAgICAgICAgaWYgKCBsYXllci5hdHRyaWJ1dGUoICJsaW5rZWQiICkgPT0gInRy
dWUiICkKKyAgICAgICAgICAgICAgICAgICAgbGF5LT5zZXRMaW5rZWQoIHRydWUgKTsKKyAgICAg
ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGxheS0+c2V0TGlua2VkKCBmYWxz
ZSApOwogCi0gICAgLyogYWRkIGJhY2tncm91bmQgbGF5ZXIgOiBzaG91bGQgb25seSBkbyB0aGlz
IGZvciBhIG5ldyBkb2N1bWVudCwgbm90Ci0gICAgd2hlbiBsb2FkaW5nIGFuIGV4aXN0aW5nIGlt
YWdlIC0gZm9yIGV4aXN0aW5nIGRvY3VtZW50LAotICAgIGJ1dCB3aWxsIGRvIGZvciBub3cgKi8K
IAotICAgIGltZy0+YWRkTGF5ZXIoIFFSZWN0KDAsIDAsIHcsIGgpLCBLaXNDb2xvcjo6d2hpdGUo
KSwgZmFsc2UsIGkxOG4oImJhY2tncm91bmQiKSk7Ci0gICAgaW1nLT5tYXJrRGlydHkoIFFSZWN0
KDAsIDAsIHcsIGgpICk7Ci0gICAgc2V0Q3VycmVudEltYWdlKGltZyk7CiAKLWtkRGVidWcoMCkg
PDwgIktpc0RvYzo6bG9hZFhNTCgpIGxlYXZpbmcgc3VjY2VzZnVsbHkiIDw8IGVuZGw7CisgICAg
ICAgICAgICAgICAgLy8gY2hhbm5lbHMgZWxlbWVudAorICAgICAgICAgICAgICAgIFFEb21FbGVt
ZW50IGNoYW5uZWxzID0gbGF5ZXIubmFtZWRJdGVtKCAiY2hhbm5lbHMiICkudG9FbGVtZW50KCk7
CisgICAgICAgICAgICAgICAgaWYgKCBjaGFubmVscy5pc051bGwoKSApIGNvbnRpbnVlOworCisg
ICAgICAgICAgICAgICAgLy8gY2hhbm5lbCBlbGVtZW50cworICAgICAgICAgICAgICAgIFFEb21O
b2RlIGMgPSBjaGFubmVscy5maXJzdENoaWxkKCk7CisKKyAgICAgICAgICAgICAgICB3aGlsZSAo
ICFjLmlzTnVsbCgpICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFFE
b21FbGVtZW50IGNoYW5uZWwgPSBjLnRvRWxlbWVudCgpOworICAgICAgICAgICAgICAgICAgICBp
ZiAoIGNoYW5uZWwudGFnTmFtZSgpICE9ICJjaGFubmVsIiApIGNvbnRpbnVlOworCisgICAgICAg
ICAgICAgICAgICAgIGtkRGVidWcoMCkgPDwgImNoYW5uZWwiIDw8IGVuZGw7CisgICAgICAgICAg
ICAgICAgICAgIGMgPSBjLm5leHRTaWJsaW5nKCk7CisgICAgICAgICAgICAgICAgfQorCisgICAg
ICAgICAgICAgICAgbCA9IGwubmV4dFNpYmxpbmcoKTsKKyAgICAgICAgICAgIH0KKworICAgICAg
ICAgICAgc2V0Q3VycmVudEltYWdlKCBpbWcgKTsKKyAgICAgICAgfQorCisgICAgICAgIGVsZW0g
PSBlbGVtLm5leHRTaWJsaW5nKCkudG9FbGVtZW50KCk7CisgICAgfQorCisgICAga2REZWJ1Zygw
KSA8PCAiS2lzRG9jOjpsb2FkWE1MKCkgbGVhdmluZyBzdWNjZXNmdWxseSIgPDwgZW5kbDsKIAog
ICAgIHJldHVyb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5ZXJzLyUxL2NoYW5uZWxzL2NoJTIuYmluIiApLmFyZyggbGF5LT5u
YW1lKCkgKQotCQkJICAgIC5hcmcoIHN0YXRpY19jYXN0PGludD4oY2gtPmNoYW5uZWxJZCgpKSAp
OworICAgICAgICBzZXRJbWFnZSggKml0ICk7CisgICAgICAgIFFMaXN0PEtpc0xheWVyPiBsYXll
cnMgPSBtX3BDdXJyZW50LT5sYXllckxpc3QoKTsKKyAgICAgICAgdWludCBsYXllck51bWJlcnMg
PSAwOwogCi0gICAgICAgICAgICBpZiAoIHN0b3JlLT5vcGVuKCB1cmwgKSApCi0JICAgICAgICB7
Ci0gICAgICAgICAgICAgICAga2REZWJ1ZygwKSA8PCAiS2lzRG9jOjpjb21wbGV0ZUxvYWRpbmco
KSBjaC0+bG9hZEZyb21TdG9yZSgpIiA8PCBlbmRsOwotICAgICAgICAgICAgICAgIGNoLT5sb2Fk
RnJvbVN0b3JlKHN0b3JlKTsKLQkJICAgICAgICBzdG9yZS0+Y2xvc2UoKTsKLQkgICAgICAgIH0K
LQkgICAgfQotICAgIH0KKyAgICAgICAgZm9yICggS2lzTGF5ZXIgKmxheSA9IGxheWVycy5maXJz
dCgpOyBsYXkgIT0gMDsgbGF5ID0gbGF5ZXJzLm5leHQoKSApCisgICAgICAgIHsKKyAgICAgICAg
ICAgIGZvciAoIEtpc0NoYW5uZWwqIGNoID0gbGF5LT5maXJzdENoYW5uZWwoKTsgY2ggIT0gMDsg
Y2ggPSBsYXktPm5leHRDaGFubmVsKCkgKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAg
IFFTdHJpbmcgaW1hZ2UgPSBRU3RyaW5nKCAiaW1hZ2UlMSIgKS5hcmcoIGltYWdlTnVtYmVycyAp
OworICAgICAgICAgICAgICAgIFFTdHJpbmcgbGF5ZXI7CisgICAgICAgICAgICAgICAgaWYgKCBs
YXllck51bWJlcnMgPT0gMCApCisgICAgICAgICAgICAgICAgICAgIGxheWVyID0gUVN0cmluZzo6
ZnJvbUxhdGluMSggImJhY2tncm91bmQiICk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg
ICAgICAgICAgICAgICBsYXllciA9IFFTdHJpbmcoICJsYXllciUxIiApLmFyZyggbGF5ZXJOdW1i
ZXJzICk7CiAKLSAgICAvLyBuZWVkIHRoaXMgdG8gZm9yY2UgcmVkcmF3IG9mIGltYWdlIGRhdGEg
anVzdCBsb2FkZWQKLSAgICBjdXJyZW50KCktPm1hcmtEaXJ0eShRUmVjdCgwLCAwLCBjdXJyZW50
KCktPndpZHRoKCksIGN1cnJlbnQoKS0+aGVpZ2h0KCkpKTsKLSAgICBzZXRDdXJyZW50SW1hZ2Uo
Y3VycmVudCgpKTsKKyAgICAgICAgICAgICAgICBRU3RyaW5nIHVybCA9IFFTdHJpbmcoICJpbWFn
ZXMvJTEvbGF5ZXJzLyUyL2NoYW5uZWxzL2NoJTMuYmluIiApCisgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAuYXJnKCBpbWFnZSApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAu
YXJnKCBsYXllciApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXJnKCBzdGF0aWNf
Y2FzdDxpbnQ+KGNoLT5jaGFubmVsSWQoKSkgKTsKIAota2REZWJ1ZygwKSA8PCAiS2lzRG9jOjpj
b21wbGV0ZUxvYWRpbmcoKSBsZWF2aW5nIiA8PCBlbmRsOworICAgICAgICAgICAgICAgIGlmICgg
c3RvcmUtPm9wZW4oIHVybCApICkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg
ICAgIGtkRGVidWcoMCkgPDwgIktpc0RvYzo6Y29tcGxldGVMb2FkaW5nKCkgY2gtPmxvYWRGcm9t
U3RvcmUoKSIgPDwgZW5kbDsKKyAgICAgICAgICAgICAgICAgICAgY2gtPmxvYWRGcm9tU3RvcmUo
IHN0b3JlICk7CisgICAgICAgICAgICAgICAgICAgIHN0b3JlLT5jbG9zZSgpOworICAgICAgIC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