← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2343: save the font size as an int

 

------------------------------------------------------------
revno: 2343
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2010-12-12 15:58:25 +0100
message:
  save the font size as an int
modified:
  win32/WinUtil.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/WinUtil.cpp'
--- win32/WinUtil.cpp	2010-12-11 23:50:40 +0000
+++ win32/WinUtil.cpp	2010-12-12 14:58:25 +0000
@@ -317,7 +317,7 @@
 tstring WinUtil::encodeFont(LOGFONT const& font) {
 	tstring res(font.lfFaceName);
 	res += _T(',');
-	res += Text::toT(Util::toString(font.lfHeight / dpiFactor));
+	res += Text::toT(Util::toString(static_cast<int>(font.lfHeight / dpiFactor)));
 	res += _T(',');
 	res += Text::toT(Util::toString(font.lfWeight));
 	res += _T(',');
@@ -329,11 +329,12 @@
 
 std::string WinUtil::toString(const std::vector<int>& tokens) {
 	std::string ret;
-	for(std::vector<int>::const_iterator i = tokens.begin(); i != tokens.end(); ++i) {
-		ret += Util::toString(*i) + ',';
+	auto start = tokens.cbegin();
+	for(auto i = start, iend = tokens.cend(); i != iend; ++i) {
+		if(i != start)
+			ret += ',';
+		ret += Util::toString(*i);
 	}
-	if(!ret.empty())
-		ret.erase(ret.size() - 1);
 	return ret;
 }