summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-12-08 20:12:16 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-12-08 20:12:26 +0300
commit8ffc77be71507825a8f7585bcabff8ccc370206a (patch)
treeaa13a8070f31286db6ad22e17a577e547942f951 /plugins/Clist_modern/src
parent41b2fdfc654e3eec07c97ceba00cda13d988ffff (diff)
db_get_sa / db_get_wsa to receive the default value, massive code simplification
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r--plugins/Clist_modern/src/modern_rowtemplateopt.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp8
2 files changed, 3 insertions, 9 deletions
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
index f28e596aae..f5d455ee83 100644
--- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
+++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
@@ -336,9 +336,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- rowOptTmplStr = db_get_sa(0, "ModernData", "RowTemplate");
- if (!rowOptTmplStr)
- rowOptTmplStr = mir_strdup("<TR />");
+ rowOptTmplStr = db_get_sa(0, "ModernData", "RowTemplate", "<TR />");
SendDlgItemMessage(hwndDlg, IDC_SPINCONTWIDTH, UDM_SETRANGE, 0, MAKELONG(999, 0));
SendDlgItemMessage(hwndDlg, IDC_SPINCONTHEIGHT, UDM_SETRANGE, 0, MAKELONG(999, 0));
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp
index 6884fbbbe6..bebfd0ffca 100644
--- a/plugins/Clist_modern/src/modern_skinbutton.cpp
+++ b/plugins/Clist_modern/src/modern_skinbutton.cpp
@@ -127,12 +127,8 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
} while (key[0] != '\0');
switch (bct->ValueTypeDef[0]) {
case 's':
- {
- Value = db_get_sa(0, section, key);
- if (!Value)
- Value = mir_strdup(bct->ValueTypeDef + 1);
- break;
- }
+ Value = db_get_sa(0, section, key, bct->ValueTypeDef + 1);
+ break;
case 'd':
defval = db_get_dw(0, section, key, defval);
Value = mir_strdup(_ltoa(defval, buf, _countof(buf)));