summaryrefslogtreecommitdiff
path: root/plugins/Msg_Export
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2017-02-05 23:40:55 +0100
committerRobert Pösel <robyer@seznam.cz>2017-02-06 00:05:35 +0100
commit98518865f72ccb25e3f5a061508aff98ffb59493 (patch)
tree83a97d558ebf11a45affe7ba6b8f13145ec269a0 /plugins/Msg_Export
parent5a3ac5642a0e4bf770d399ae015dd9e65b34cf71 (diff)
Msg_Export: Allow entering "0" for no limit of line width
Diffstat (limited to 'plugins/Msg_Export')
-rwxr-xr-xplugins/Msg_Export/res/resource.rc21
-rwxr-xr-xplugins/Msg_Export/src/main.cpp2
-rwxr-xr-xplugins/Msg_Export/src/options.cpp4
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp4
4 files changed, 18 insertions, 13 deletions
diff --git a/plugins/Msg_Export/res/resource.rc b/plugins/Msg_Export/res/resource.rc
index fdb1471f81..be7e33ec6f 100755
--- a/plugins/Msg_Export/res/resource.rc
+++ b/plugins/Msg_Export/res/resource.rc
@@ -8,6 +8,7 @@
// Generated from the TEXTINCLUDE 2 resource.
//
#include <winres.h>
+
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -24,18 +25,18 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"..\\src\\resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include <winres.h>\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -63,11 +64,11 @@ BEGIN
COMBOBOX IDC_FILE_VIEWER,11,75,125,89,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Browse",IDC_FILE_VIEWER_BROWSE,141,74,43,14
EDITTEXT IDC_MAX_CLOUMN_WIDTH,259,11,39,14,ES_AUTOHSCROLL | ES_NUMBER
- COMBOBOX IDC_EXPORT_TIMEFORMAT,241,29,57,122,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- CONTROL "Use UTF8 in new files",IDC_USE_UTF8_IN_NEW_FILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,46,104,10
- CONTROL "Append extra new line",IDC_APPEND_NEWLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,59,104,10
+ COMBOBOX IDC_EXPORT_TIMEFORMAT,241,38,57,122,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Use UTF8 in new files",IDC_USE_UTF8_IN_NEW_FILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,55,104,10
+ CONTROL "Append extra new line",IDC_APPEND_NEWLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,68,104,10
CONTROL "Use << and >>",IDC_USE_LESS_AND_GREATER_IN_EXPORT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,72,104,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,81,104,10
CONTROL "List1",IDC_MAP_USER_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_EDITLABELS | WS_BORDER | WS_TABSTOP,5,100,299,114
PUSHBUTTON "Auto filename",IDC_AUTO_FILENAME,5,218,63,14
PUSHBUTTON "Clear all",IDC_CLEAR_ALL,86,218,63,14
@@ -75,7 +76,8 @@ BEGIN
PUSHBUTTON "Export all history",IDC_EXPORTALL,235,218,63,14
GROUPBOX "Export directory",IDC_STATIC,5,0,181,46
LTEXT "Max column width",IDC_STATIC,194,14,58,8
- LTEXT "Time format",IDC_STATIC,194,31,38,8
+ LTEXT "Note: 0 = no limit",IDC_STATIC,194,26,104,8
+ LTEXT "Time format",IDC_STATIC,194,40,38,8
GROUPBOX "Export format",IDC_STATIC,190,0,114,94
LTEXT "Default file",IDC_STATIC,11,32,34,8
GROUPBOX "File viewer",IDC_STATIC,5,49,181,45
@@ -96,7 +98,7 @@ STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_
CAPTION "History file for %s (%s format %s)"
FONT 8, "MS Sans Serif"
BEGIN
- CONTROL "",IDC_RICHEDIT,"RichEdit50W",TCS_HOTTRACK | TCS_VERTICAL | TCS_BUTTONS | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,6,7,333,224
+ CONTROL "",IDC_RICHEDIT,"RichEdit50W",WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP | 0x9c4,6,7,333,224
PUSHBUTTON "&Find...",IDC_FV_FIND,46,238,50,14
PUSHBUTTON "&External",IDC_FV_EXTERNAL,142,238,50,14
DEFPUSHBUTTON "&Close",IDOK,246,238,50,14
@@ -228,3 +230,4 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp
index 72d24735dc..379d25f4ec 100755
--- a/plugins/Msg_Export/src/main.cpp
+++ b/plugins/Msg_Export/src/main.cpp
@@ -189,7 +189,7 @@ extern "C" __declspec(dllexport) int Load()
HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
nMaxLineWidth = db_get_w(NULL, MODULE, "MaxLineWidth", nMaxLineWidth);
- if (nMaxLineWidth < 5)
+ if (nMaxLineWidth > 0 && nMaxLineWidth < 5)
nMaxLineWidth = 5;
sExportDir = _DBGetString(NULL, MODULE, "ExportDir", L"%dbpath%\\MsgExport\\");
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp
index d2a027545e..7ae57f3afe 100755
--- a/plugins/Msg_Export/src/options.cpp
+++ b/plugins/Msg_Export/src/options.cpp
@@ -339,8 +339,8 @@ BOOL bApplyChanges(HWND hwndDlg)
wchar_t szTemp[500];
int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE);
- if (!bTrans || nTmp < 5) {
- mir_snwprintf(szTemp, TranslateT("Max line width must be at least %d"), 5);
+ if (!bTrans || (nTmp > 0 && nTmp < 5)) {
+ mir_snwprintf(szTemp, TranslateT("Max line width must be at least %d. Or use 0 for no limit."), 5);
MessageBox(hwndDlg, szTemp, MSG_BOX_TITEL, MB_OK);
bRet = false;
}
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index 6f0a26d065..f3296752ed 100755
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -1308,7 +1308,9 @@ bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const wchar_t *pszSrc, bool
if (pszSrc[nLineLen] == '\n' || pszSrc[nLineLen] == '\r')
break;
- if (nLineLen >= nMaxLineWidth) { // ok the line was not broken. we need to force a break
+ // if user set nMaxLineWidth to 0, we don't break anything, otherwise check the length
+ if (nMaxLineWidth != 0 && nLineLen >= nMaxLineWidth) {
+ // ok the line was not broken. we need to force a break
// we will scan backwards again to finde a space !!
// then we will look for a ? and so on.