summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-28 17:16:36 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-28 17:16:36 +0000
commit84b5cac8e0f148250c44fc91d7d9752dca13dbb6 (patch)
treefbb1f7d612419ea7ff02770ca5e5af31c28ebd61 /src
parente22f3f791caefb016c7ba72256c325609f6a5a5b (diff)
- MS_UTILS_GETBITMAPFILTERSTRINGS - end of story, replaced with BmpFilterGetStrings();
- parasite mir_strncat's removed from bitmap filter creation; - CMString::AllocSysString/SetSysString removed due to complete uselessness; - CMString::Detouch - typo fixed. git-svn-id: http://svn.miranda-ng.org/main/trunk@13881 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/stdclist/src/clcopts.cpp15
-rw-r--r--src/mir_core/mir_core_10.vcxproj1
-rw-r--r--src/mir_core/mir_core_10.vcxproj.filters3
-rw-r--r--src/mir_core/mir_core_12.vcxproj2
-rw-r--r--src/mir_core/mir_core_12.vcxproj.filters6
-rw-r--r--src/mir_core/src/mir_core.def9
-rw-r--r--src/mir_core/src/mir_core64.def9
-rw-r--r--src/modules/utils/bmpfilter.cpp92
8 files changed, 25 insertions, 112 deletions
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp
index 83e9154511..2350d7d947 100644
--- a/src/core/stdclist/src/clcopts.cpp
+++ b/src/core/stdclist/src/clcopts.cpp
@@ -334,24 +334,23 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
}
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
- char str[MAX_PATH];
- OPENFILENAMEA ofn = { 0 };
- char filter[512];
+ TCHAR str[MAX_PATH], filter[512];
+ GetDlgItemText(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
- GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
+ OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.hInstance = NULL;
- CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, SIZEOF(filter), (LPARAM) filter);
+ BmpFilterGetStrings(filter, SIZEOF(filter));
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = "bmp";
- if (!GetOpenFileNameA(&ofn))
+ ofn.lpstrDefExt = _T("bmp");
+ if (!GetOpenFileName(&ofn))
break;
- SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
+ SetDlgItemText(hwndDlg, IDC_FILENAME, str);
}
else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE)
break;
diff --git a/src/mir_core/mir_core_10.vcxproj b/src/mir_core/mir_core_10.vcxproj
index 24abcbe7f0..8770eb8e40 100644
--- a/src/mir_core/mir_core_10.vcxproj
+++ b/src/mir_core/mir_core_10.vcxproj
@@ -37,6 +37,7 @@
<ClInclude Include="src\miranda.h" />
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="src\bitmaps.cpp" />
<ClCompile Include="src\cmdline.cpp" />
<ClCompile Include="src\http.cpp" />
<ClCompile Include="src\icons.cpp" />
diff --git a/src/mir_core/mir_core_10.vcxproj.filters b/src/mir_core/mir_core_10.vcxproj.filters
index 8162971b59..7160a06293 100644
--- a/src/mir_core/mir_core_10.vcxproj.filters
+++ b/src/mir_core/mir_core_10.vcxproj.filters
@@ -112,6 +112,9 @@
<ClCompile Include="src\ui_utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\bitmaps.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\commonheaders.h">
diff --git a/src/mir_core/mir_core_12.vcxproj b/src/mir_core/mir_core_12.vcxproj
index 3c9ae7f200..626835ac80 100644
--- a/src/mir_core/mir_core_12.vcxproj
+++ b/src/mir_core/mir_core_12.vcxproj
@@ -28,6 +28,7 @@
<ClInclude Include="..\..\include\m_string.h" />
<ClInclude Include="..\..\include\m_system.h" />
<ClInclude Include="..\..\include\m_system_cpp.h" />
+ <ClInclude Include="..\..\include\m_utils.h" />
<ClInclude Include="src\commonheaders.h" />
<ClInclude Include="src\json\internalJSONNode.h" />
<ClInclude Include="src\json\JSONChildren.h" />
@@ -40,6 +41,7 @@
<ClInclude Include="src\miranda.h" />
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="src\bitmaps.cpp" />
<ClCompile Include="src\cmdline.cpp" />
<ClCompile Include="src\http.cpp" />
<ClCompile Include="src\icons.cpp" />
diff --git a/src/mir_core/mir_core_12.vcxproj.filters b/src/mir_core/mir_core_12.vcxproj.filters
index 18af03d46d..ec0939a562 100644
--- a/src/mir_core/mir_core_12.vcxproj.filters
+++ b/src/mir_core/mir_core_12.vcxproj.filters
@@ -112,6 +112,9 @@
<ClCompile Include="src\json\JSONIterators.cpp">
<Filter>Source Files\json</Filter>
</ClCompile>
+ <ClCompile Include="src\bitmaps.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\m_core.h">
@@ -171,6 +174,9 @@
<ClInclude Include="..\..\include\m_protoint.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\m_utils.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\include\m_string.inl">
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index ef180d7bdd..838a1d4b0b 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -372,8 +372,6 @@ mir_wstrcmpi @280
??Y?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QAEAAV0@PBD@Z @370 NONAME
??Y?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QAEAAV0@PB_W@Z @371 NONAME
??Y?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QAEAAV0@_W@Z @372 NONAME
-?AllocSysString@?$CMStringT@DV?$ChTraitsCRT@D@@@@QBEPA_WXZ @373 NONAME
-?AllocSysString@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QBEPA_WXZ @374 NONAME
?Append@?$CMSimpleStringT@D@@QAEXABV1@@Z @375 NONAME
?Append@?$CMSimpleStringT@D@@QAEXPBD@Z @376 NONAME
?Append@?$CMSimpleStringT@D@@QAEXPBDH@Z @377 NONAME
@@ -500,8 +498,6 @@ mir_wstrcmpi @280
?SetString@?$CMSimpleStringT@D@@QAEXPBDH@Z @498 NONAME
?SetString@?$CMSimpleStringT@_W@@QAEXPB_W@Z @499 NONAME
?SetString@?$CMSimpleStringT@_W@@QAEXPB_WH@Z @500 NONAME
-?SetSysString@?$CMStringT@DV?$ChTraitsCRT@D@@@@QBEPA_WPAPA_W@Z @501 NONAME
-?SetSysString@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QBEPA_WPAPA_W@Z @502 NONAME
?SpanExcluding@?$CMStringT@DV?$ChTraitsCRT@D@@@@QBE?AV1@PBD@Z @503 NONAME
?SpanExcluding@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QBE?AV1@PB_W@Z @504 NONAME
?SpanIncluding@?$CMStringT@DV?$ChTraitsCRT@D@@@@QBE?AV1@PBD@Z @505 NONAME
@@ -731,8 +727,8 @@ mir_wstrcmpi @280
?DeleteItem@CCtrlTreeView@@QAEXPAU_TREEITEM@@@Z @731 NONAME
?DeleteString@CCtrlCombo@@QAEXH@Z @732 NONAME
?DeleteString@CCtrlListBox@@QAEXH@Z @733 NONAME
-?Detouch@?$CMStringT@DV?$ChTraitsCRT@D@@@@QBEPADXZ @734 NONAME
-?Detouch@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QBEPA_WXZ @735 NONAME
+?Detach@?$CMStringT@DV?$ChTraitsCRT@D@@@@QBEPADXZ @734 NONAME
+?Detach@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QBEPA_WXZ @735 NONAME
?Disable@CCtrlBase@@QAEXXZ @736 NONAME
?DlgProc@CDlgBase@@MAEHIIJ@Z @737 NONAME
?DlgProc@CProtoIntDlgBase@@MAEHIIJ@Z @738 NONAME
@@ -1242,3 +1238,4 @@ Proto_RegisterModule @1074 NONAME
?isnull@JSONNode@@QBE_NXZ @1245 NONAME
??BJSONNode@@QBE_NXZ @1246 NONAME
?as_mstring@JSONNode@@QBE?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@XZ @1247 NONAME
+BmpFilterGetStrings @1248
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index c75553762f..248599e8b9 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -372,8 +372,6 @@ mir_wstrcmpi @280
??Y?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QEAAAEAV0@PEBD@Z @370 NONAME
??Y?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QEAAAEAV0@PEB_W@Z @371 NONAME
??Y?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QEAAAEAV0@_W@Z @372 NONAME
-?AllocSysString@?$CMStringT@DV?$ChTraitsCRT@D@@@@QEBAPEA_WXZ @373 NONAME
-?AllocSysString@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QEBAPEA_WXZ @374 NONAME
?Append@?$CMSimpleStringT@D@@QEAAXAEBV1@@Z @375 NONAME
?Append@?$CMSimpleStringT@D@@QEAAXPEBD@Z @376 NONAME
?Append@?$CMSimpleStringT@D@@QEAAXPEBDH@Z @377 NONAME
@@ -500,8 +498,6 @@ mir_wstrcmpi @280
?SetString@?$CMSimpleStringT@D@@QEAAXPEBDH@Z @498 NONAME
?SetString@?$CMSimpleStringT@_W@@QEAAXPEB_W@Z @499 NONAME
?SetString@?$CMSimpleStringT@_W@@QEAAXPEB_WH@Z @500 NONAME
-?SetSysString@?$CMStringT@DV?$ChTraitsCRT@D@@@@QEBAPEA_WPEAPEA_W@Z @501 NONAME
-?SetSysString@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QEBAPEA_WPEAPEA_W@Z @502 NONAME
?SpanExcluding@?$CMStringT@DV?$ChTraitsCRT@D@@@@QEBA?AV1@PEBD@Z @503 NONAME
?SpanExcluding@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QEBA?AV1@PEB_W@Z @504 NONAME
?SpanIncluding@?$CMStringT@DV?$ChTraitsCRT@D@@@@QEBA?AV1@PEBD@Z @505 NONAME
@@ -731,8 +727,8 @@ mir_wstrcmpi @280
?DeleteItem@CCtrlTreeView@@QEAAXPEAU_TREEITEM@@@Z @731 NONAME
?DeleteString@CCtrlCombo@@QEAAXH@Z @732 NONAME
?DeleteString@CCtrlListBox@@QEAAXH@Z @733 NONAME
-?Detouch@?$CMStringT@DV?$ChTraitsCRT@D@@@@QEBAPEADXZ @734 NONAME
-?Detouch@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QEBAPEA_WXZ @735 NONAME
+?Detach@?$CMStringT@DV?$ChTraitsCRT@D@@@@QEBAPEADXZ @734 NONAME
+?Detach@?$CMStringT@_WV?$ChTraitsCRT@_W@@@@QEBAPEA_WXZ @735 NONAME
?Disable@CCtrlBase@@QEAAXXZ @736 NONAME
?DlgProc@CDlgBase@@MEAA_JI_K_J@Z @737 NONAME
?DlgProc@CProtoIntDlgBase@@MEAA_JI_K_J@Z @738 NONAME
@@ -1242,3 +1238,4 @@ Proto_RegisterModule @1074 NONAME
?isnull@JSONNode@@QEBA_NXZ @1245 NONAME
??BJSONNode@@QEBA_NXZ @1246 NONAME
?as_mstring@JSONNode@@QEBA?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@XZ @1247 NONAME
+BmpFilterGetStrings @1248
diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp
index dddc7b8ca0..cd9d061e20 100644
--- a/src/modules/utils/bmpfilter.cpp
+++ b/src/modules/utils/bmpfilter.cpp
@@ -138,101 +138,9 @@ static INT_PTR BmpFilterLoadBitmapW(WPARAM, LPARAM lParam)
///////////////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR BmpFilterGetStrings(WPARAM wParam, LPARAM lParam)
-{
- size_t bytesLeft = wParam;
- char *filter = (char*)lParam, *pfilter;
-
- mir_strncpy(filter, Translate("All bitmaps"), bytesLeft); bytesLeft -= mir_strlen(filter);
- mir_strncat(filter, " (*.bmp;*.jpg;*.gif;*.png)", bytesLeft);
- pfilter = filter + mir_strlen(filter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_strncpy(pfilter, "*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_strncpy(pfilter, Translate("Windows bitmaps"), bytesLeft); bytesLeft -= mir_strlen(pfilter);
- mir_strncat(pfilter, " (*.bmp;*.rle)", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_strncpy(pfilter, "*.BMP;*.RLE", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_strncpy(pfilter, Translate("JPEG bitmaps"), bytesLeft); bytesLeft -= mir_strlen(pfilter);
- mir_strncat(pfilter, " (*.jpg;*.jpeg)", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_strncpy(pfilter, "*.JPG;*.JPEG", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_strncpy(pfilter, Translate("GIF bitmaps"), bytesLeft); bytesLeft -= mir_strlen(pfilter);
- mir_strncat(pfilter, " (*.gif)", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_strncpy(pfilter, "*.GIF", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_strncpy(pfilter, Translate("PNG bitmaps"), bytesLeft); bytesLeft -= mir_strlen(pfilter);
- mir_strncat(pfilter, " (*.png)", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_strncpy(pfilter, "*.PNG", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_strncpy(pfilter, Translate("All files"), bytesLeft); bytesLeft -= mir_strlen(pfilter);
- mir_strncat(pfilter, " (*)", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_strncpy(pfilter, "*", bytesLeft);
- pfilter += mir_strlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- if (bytesLeft) *pfilter = '\0';
- return 0;
-}
-
-static INT_PTR BmpFilterGetStringsW(WPARAM wParam, LPARAM lParam)
-{
- size_t bytesLeft = wParam;
- TCHAR *filter = (TCHAR*)lParam, *pfilter;
-
- mir_tstrncpy(filter, TranslateT("All bitmaps"), bytesLeft); bytesLeft -= mir_tstrlen(filter);
- mir_tstrncat(filter, _T(" (*.bmp;*.jpg;*.gif;*.png)"), bytesLeft);
- pfilter = filter + mir_tstrlen(filter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_tstrncpy(pfilter, _T("*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_tstrncpy(pfilter, TranslateT("Windows bitmaps"), bytesLeft); bytesLeft -= mir_tstrlen(pfilter);
- mir_tstrncat(pfilter, _T(" (*.bmp;*.rle)"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_tstrncpy(pfilter, _T("*.BMP;*.RLE"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_tstrncpy(pfilter, TranslateT("JPEG bitmaps"), bytesLeft); bytesLeft -= mir_tstrlen(pfilter);
- mir_tstrncat(pfilter, _T(" (*.jpg;*.jpeg)"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_tstrncpy(pfilter, _T("*.JPG;*.JPEG"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_tstrncpy(pfilter, TranslateT("GIF bitmaps"), bytesLeft); bytesLeft -= mir_tstrlen(pfilter);
- mir_tstrncat(pfilter, _T(" (*.gif)"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_tstrncpy(pfilter, _T("*.GIF"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_tstrncpy(pfilter, TranslateT("PNG bitmaps"), bytesLeft); bytesLeft -= mir_tstrlen(pfilter);
- mir_tstrncat(pfilter, _T(" (*.png)"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_tstrncpy(pfilter, _T("*.PNG"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- mir_tstrncpy(pfilter, TranslateT("All files"), bytesLeft); bytesLeft -= mir_tstrlen(pfilter);
- mir_tstrncat(pfilter, _T(" (*)"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
- mir_tstrncpy(pfilter, _T("*"), bytesLeft);
- pfilter += mir_tstrlen(pfilter) + 1; bytesLeft = wParam - (pfilter - filter);
-
- if (bytesLeft) *pfilter = '\0';
- return 0;
-}
-
int InitBitmapFilter(void)
{
CreateServiceFunction(MS_UTILS_LOADBITMAP, BmpFilterLoadBitmap);
- CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGS, BmpFilterGetStrings);
- CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGSW, BmpFilterGetStringsW);
CreateServiceFunction(MS_UTILS_LOADBITMAPW, BmpFilterLoadBitmapW);
return 0;
}