summaryrefslogtreecommitdiff
path: root/plugins/Msg_Export/src
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/src
parent5a3ac5642a0e4bf770d399ae015dd9e65b34cf71 (diff)
Msg_Export: Allow entering "0" for no limit of line width
Diffstat (limited to 'plugins/Msg_Export/src')
-rwxr-xr-xplugins/Msg_Export/src/main.cpp2
-rwxr-xr-xplugins/Msg_Export/src/options.cpp4
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp4
3 files changed, 6 insertions, 4 deletions
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.