Fixed "priority keys" issue highlighted by Udi Fuchs.

v0.27.3
Andreas Huggel 17 years ago
parent 3967661d04
commit d79bc27e81

@ -52,7 +52,6 @@ EXIV2_RCSID("@(#) $Id$")
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <cassert> #include <cassert>
#include <set>
// ***************************************************************************** // *****************************************************************************
// class member definitions // class member definitions
@ -375,10 +374,7 @@ namespace Exiv2 {
void TiffDecoder::setExifTag(const ExifKey& key, const Value* pValue, Prio prio) void TiffDecoder::setExifTag(const ExifKey& key, const Value* pValue, Prio prio)
{ {
typedef std::set<std::string> PriorityKeys; bool isRegPrioTag = (priorityKeys_.find(key.key()) != priorityKeys_.end());
static PriorityKeys priorityKeys;
bool isRegPrioTag = (priorityKeys.find(key.key()) != priorityKeys.end());
switch (prio) { switch (prio) {
case pvNormal: case pvNormal:
@ -388,7 +384,7 @@ namespace Exiv2 {
case pvHigh: case pvHigh:
// Register the key as a high prio tag, erase low prio tags, add this // Register the key as a high prio tag, erase low prio tags, add this
if (!isRegPrioTag) { if (!isRegPrioTag) {
priorityKeys.insert(key.key()); priorityKeys_.insert(key.key());
ExifData::iterator pos = exifData_.findKey(key); ExifData::iterator pos = exifData_.findKey(key);
while (pos != exifData_.end()) { while (pos != exifData_.end()) {
exifData_.erase(pos); exifData_.erase(pos);

@ -42,6 +42,7 @@
#include <iomanip> #include <iomanip>
#include <cassert> #include <cassert>
#include <map> #include <map>
#include <set>
// ***************************************************************************** // *****************************************************************************
// namespace extensions // namespace extensions
@ -307,6 +308,11 @@ namespace Exiv2 {
GroupType groupType_; //!< NewSubfileType for each group GroupType groupType_; //!< NewSubfileType for each group
bool decodedIptc_; //!< Indicates if IPTC has been decoded yet bool decodedIptc_; //!< Indicates if IPTC has been decoded yet
//! Type used as the container for "priority keys"
typedef std::set<std::string> PriorityKeys;
PriorityKeys priorityKeys_; //!< Priority keys
}; // class TiffDecoder }; // class TiffDecoder
/*! /*!

Loading…
Cancel
Save