← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2334: mingw build fix

 

------------------------------------------------------------
revno: 2334
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-12-08 18:21:01 +0100
message:
  mingw build fix
modified:
  dwt/include/dwt/widgets/Table.h
  dwt/src/widgets/Table.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 'dwt/include/dwt/widgets/Table.h'
--- dwt/include/dwt/widgets/Table.h	2010-12-08 16:54:29 +0000
+++ dwt/include/dwt/widgets/Table.h	2010-12-08 17:21:01 +0000
@@ -83,22 +83,14 @@
 		typedef Dispatchers::Base<void (int)> BaseType;
 		HeaderDispatcher(const F& f_) : BaseType(f_) { }
 
-		bool operator()(const MSG& msg, LRESULT& ret) const {
-			f(reinterpret_cast<LPNMLISTVIEW>(msg.lParam)->iSubItem);
-			return true;
-		}
+		bool operator()(const MSG& msg, LRESULT& ret) const;
 	};
 
 	struct TooltipDispatcher : Dispatchers::Base<tstring (int)> {
 		typedef Dispatchers::Base<tstring (int)> BaseType;
 		TooltipDispatcher(const F& f_) : BaseType(f_) { }
 
-		bool operator()(const MSG& msg, LRESULT& ret) const {
-			NMLVGETINFOTIP& tip = *reinterpret_cast<LPNMLVGETINFOTIP>(msg.lParam);
-			tstring text(f(tip.iItem));
-			_tcscpy_s(tip.pszText, tip.cchTextMax, text.c_str());
-			return true;
-		}
+		bool operator()(const MSG& msg, LRESULT& ret) const;
 	};
 
 	// Need to be friend to access private data...

=== modified file 'dwt/src/widgets/Table.cpp'
--- dwt/src/widgets/Table.cpp	2010-12-08 16:54:29 +0000
+++ dwt/src/widgets/Table.cpp	2010-12-08 17:21:01 +0000
@@ -35,6 +35,7 @@
 #include <dwt/CanvasClasses.h>
 #include <dwt/LibraryLoader.h>
 #include <dwt/util/check.h>
+#include <dwt/util/StringUtils.h>
 #include <dwt/DWTException.h>
 
 #include <boost/scoped_array.hpp>
@@ -87,6 +88,21 @@
 	createArrows();
 }
 
+bool Table::HeaderDispatcher::operator()(const MSG& msg, LRESULT& ret) const {
+	f(reinterpret_cast<LPNMLISTVIEW>(msg.lParam)->iSubItem);
+	return true;
+}
+
+bool Table::TooltipDispatcher::operator()(const MSG& msg, LRESULT& ret) const {
+	NMLVGETINFOTIP& tip = *reinterpret_cast<LPNMLVGETINFOTIP>(msg.lParam);
+	if(tip.cchTextMax <= 2)
+		return true;
+	tstring text(f(tip.iItem));
+	util::cutStr(text, tip.cchTextMax - 1);
+	_tcscpy(tip.pszText, text.c_str());
+	return true;
+}
+
 void Table::setSort(int aColumn, SortType aType, bool aAscending) {
 	bool doUpdateArrow = (aColumn != sortColumn || aAscending != ascending);