[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:42:45 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=352794e

The following commit has been merged in the master branch:
commit 352794e4eba0d08585b6154f2803be82ce5fab58
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Thu Sep 8 04:54:09 2011 +0000

    #708: Improved documentation and guarantee in case of failure.
---
 src/convert.cpp | 12 +++++++-----
 src/convert.hpp | 43 +++++++++++++++++++++++--------------------
 2 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/src/convert.cpp b/src/convert.cpp
index 135fd0a..ce3e8fe 100644
--- a/src/convert.cpp
+++ b/src/convert.cpp
@@ -71,8 +71,8 @@ EXIV2_RCSID("@(#) $Id$")
 // local declarations
 namespace {
 #if defined WIN32 && !defined __CYGWIN__
-    // Convert string charset with Windows MSVC functions.
-    bool convertStringCharsetMsvc(std::string& str, const char* from, const char* to);
+    // Convert string charset with Windows functions.
+    bool convertStringCharsetWindows(std::string& str, const char* from, const char* to);
 #endif
 #if defined EXV_HAVE_ICONV
     // Convert string charset with iconv.
@@ -1335,7 +1335,7 @@ namespace Exiv2 {
 #if defined EXV_HAVE_ICONV
         ret = convertStringCharsetIconv(str, from, to);
 #elif defined WIN32 && !defined __CYGWIN__
-        ret = convertStringCharsetMsvc(str, from, to);
+        ret = convertStringCharsetWindows(str, from, to);
 #else
 # ifndef SUPPRESS_WARNINGS
         EXV_WARNING << "Charset conversion required but no character mapping functionality available.
";
@@ -1490,16 +1490,18 @@ namespace {
         // Update the convertStringCharset() documentation if you add more here!
     };
 
-    bool convertStringCharsetMsvc(std::string& str, const char* from, const char* to)
+    bool convertStringCharsetWindows(std::string& str, const char* from, const char* to)
     {
         bool ret = false;
         const ConvFctList* p = find(convFctList, std::make_pair(from, to));
-        if (p) ret = p->convFct_(str);
+        std::string tmpstr = str;
+        if (p) ret = p->convFct_(tmpstr);
 #ifndef SUPPRESS_WARNINGS
         else {
             EXV_WARNING << "No Windows function to map character string from " << from << " to " << to << " available.
";
         }
 #endif
+        if (ret) str = tmpstr;
         return ret;
     }
 
diff --git a/src/convert.hpp b/src/convert.hpp
index 545723b..d56709a 100644
--- a/src/convert.hpp
+++ b/src/convert.hpp
@@ -81,29 +81,32 @@ namespace Exiv2 {
 
     /*!
       @brief Convert character encoding of \em str from \em from to \em to.
-             The string is modified and its size may change.
-
-      This function uses the iconv library, if Exiv2 was compiled with iconv
-      support.  Otherwise, on Windows, it uses MSVC functions to support a
-      limited number of conversions and issues a warning if an unsupported
-      conversion is attempted. The conversions supported on Windows without
-      iconv are:
-
-      from: UTF-8 to: UCS-2BE<br>
-      from: UTF-8 to: UCS-2LE<br>
-      from: UCS-2BE to: UTF-8<br>
-      from: UCS-2BE to: UCS-2LE<br>
-      from: UCS-2LE to: UTF-8<br>
-      from: UCS-2LE to: UCS-2BE<br>
-      from: ISO-8859-1 to: UTF-8<br>
-      from: ASCII to: UTF-8<br>
-
-      If the function is called but Exiv2 was not compiled with iconv support
-      and can't use Windows MSVC functions, it issues a warning.
+             If the function succeeds, \em str contains the result string.
+
+      This function uses the iconv library, if the %Exiv2 library was compiled
+      with iconv support.  Otherwise, on Windows, it uses Windows functions to
+      support a limited number of conversions and fails with a warning if an
+      unsupported conversion is attempted.  If the function is called but %Exiv2
+      was not compiled with iconv support and can't use Windows functions, it
+      fails with a warning.
+
+      The conversions supported on Windows without iconv are:
+
+      <TABLE>
+      <TR><TD class="indexkey"><B>from</B></TD><TD class="indexkey">to</TD></TR>
+      <TR><TD class="indexvalue">UTF-8</TD>     <TD class="indexvalue">UCS-2BE</TD></TR>
+      <TR><TD class="indexvalue">UTF-8</TD>     <TD class="indexvalue">UCS-2LE</TD></TR>
+      <TR><TD class="indexvalue">UCS-2BE</TD>   <TD class="indexvalue">UTF-8</TD></TR>
+      <TR><TD class="indexvalue">UCS-2BE</TD>   <TD class="indexvalue">UCS-2LE</TD></TR>
+      <TR><TD class="indexvalue">UCS-2LE</TD>   <TD class="indexvalue">UTF-8</TD></TR>
+      <TR><TD class="indexvalue">UCS-2LE</TD>   <TD class="indexvalue">UCS-2BE</TD></TR>
+      <TR><TD class="indexvalue">ISO-8859-1</TD><TD class="indexvalue">UTF-8</TD></TR>
+      <TR><TD class="indexvalue">ASCII</TD>     <TD class="indexvalue">UTF-8</TD></TR>
+      </TABLE>
 
       @param str  The string to convert. It is updated to the converted string,
                   which may have a different size. If the function call fails,
-                  the string may have been modified.
+                  the string is not modified.
       @param from Charset in which the input string is encoded as a name
                   understood by 
-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list