[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:44:45 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=b59768d
The following commit has been merged in the master branch:
commit b59768df7dec9472beafa05fcac10c819de03ab4
Author: Robin Mills <robin at clanmills.com>
Date: Thu Jan 8 14:44:06 2015 +0000
#1021. Thank You Thomas for reporting this and the patch.
---
src/actions.cpp | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/actions.cpp b/src/actions.cpp
index 3566054..10e0f83 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -149,6 +149,15 @@ namespace {
exists and shouldn't be overwritten, else 0.
*/
int dontOverwrite(const std::string& path);
+
+ /*!
+ @brief Output a text with a given minimum number of chars, honoring
+ multi-byte characters correctly. Replace code in the form
+ os << setw(width) << myString
+ with
+ os << make_pair( myString, width)
+ */
+ std::ostream& operator<<( std::ostream& os, std::pair< const std::string&, unsigned int> strAndWidth);
}
// *****************************************************************************
@@ -443,8 +452,8 @@ namespace Action {
if (Params::instance().files_.size() > 1) {
std::cout << std::setw(20) << path_ << " ";
}
- std::cout << std::setw(align_)
- << label << ": ";
+ std::cout << std::make_pair( label, align_)
+ << ": ";
}
int Print::printTag(const Exiv2::ExifData& exifData,
@@ -2009,4 +2018,16 @@ namespace {
return 0;
}
+ std::ostream& operator<<( std::ostream& os, std::pair< const std::string&, unsigned int> strAndWidth)
+ {
+ const std::string& str( strAndWidth.first);
+ unsigned int minChCount( strAndWidth.second);
+ unsigned int count = mbstowcs( NULL, str.c_str(), 0); // returns 0xFFFFFFFF on error
+ if( count < minChCount)
+ {
+ minChCount += str.size() - count;
+ }
+ return os << std::setw( minChCount) << str;
+ }
+
}
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list