From a5fec87ad5ff8bf6c6f90a6f603c885dd38ffcb8 Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Thu, 19 Apr 2012 21:25:01 +0200 Subject: [PATCH] Fixed auto profile detection in some cases see issue 1312 --- rtengine/dcp.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index dc3be76e9..7355f7915 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -443,10 +443,13 @@ DCPProfile* DCPStore::getProfile (Glib::ustring filename) { } DCPProfile* DCPStore::getStdProfile(Glib::ustring camShortName) { - std::map::iterator r = fileStdProfiles.find (camShortName.uppercase()); - if (r==fileStdProfiles.end()) return NULL; + Glib::ustring name2=camShortName.uppercase(); - return getProfile(r->second); + // Warning: do NOT use map.find(), since it does not seem to work reliably here + for (std::map::iterator i=fileStdProfiles.begin();i!=fileStdProfiles.end();i++) + if (name2==(*i).first) return getProfile((*i).second); + + return NULL; } bool DCPStore::isValidDCPFileName(Glib::ustring filename) const {