• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision8549 (tree)
Zeit2020-02-20 00:37:40
Autorzmatsuo

Log Message

Hashtableの使用をやめた

Ändern Zusammenfassung

Diff

--- trunk/TTProxy/YCL/include/YCL/Dialog.h (revision 8548)
+++ trunk/TTProxy/YCL/include/YCL/Dialog.h (revision 8549)
@@ -12,7 +12,6 @@
1212 #include <YCL/common.h>
1313
1414 #include <YCL/Window.h>
15-#include <YCL/Hashtable.h>
1615
1716 #include "dlglib.h"
1817
@@ -20,11 +19,6 @@
2019
2120 class Dialog : virtual public Window {
2221 protected:
23- typedef Hashtable<HWND, Dialog*> Map;
24- static Map& getMap() {
25- static Map map;
26- return map;
27- }
2822 static Dialog* prepareOpen(Dialog* next) {
2923 static Dialog* initializeing = NULL;
3024 Dialog* prev = initializeing;
@@ -32,18 +26,16 @@
3226 return prev;
3327 }
3428 static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam) {
35- Map& map = getMap();
36- Dialog* target = map.get(dialog);
29+ Dialog* target = (Dialog *)::GetWindowLongPtr(dialog, GWLP_USERDATA);
3730 if (target == NULL) {
3831 target = prepareOpen(NULL);
3932 if (target != NULL) {
4033 *target <<= dialog;
41- map.put(dialog, target);
34+ ::SetWindowLongPtr(dialog, GWLP_USERDATA, (LONG_PTR)target);
4235 }
4336 }
4437 BOOL result = target != NULL ? target->dispatch(message, wParam, lParam) : FALSE;
4538 if (message == WM_NCDESTROY) {
46- map.remove(dialog);
4739 if (target != NULL)
4840 *target <<= NULL;
4941 }
Show on old repository browser