diff options
author | George Hazan <ghazan@miranda.im> | 2017-05-01 11:58:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-05-01 11:58:04 +0300 |
commit | 28d98a38c756991d461301efb483e4980a2def69 (patch) | |
tree | d317b4a941832d3cc4137a6f597c029757913987 /plugins/TabSRMM | |
parent | d75d5e8706b06457b799831448f282818233abe9 (diff) |
Utils_IsRtl - core function to detect RTL direcction
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sendqueue.cpp | 22 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sendqueue.h | 1 |
3 files changed, 1 insertions, 24 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index ec495316bc..9ce6c0605a 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1122,7 +1122,7 @@ void CSrmmWindow::onClick_Ok(CCtrlButton*) int flags = 0;
if (pf2.wEffects & PFE_RTLPARA)
- if (SendQueue::RTL_Detect(decoded))
+ if (Utils_IsRtl(decoded))
flags |= PREF_RTL;
SendMessage(hwndEdit, WM_SETREDRAW, TRUE, 0);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 787e815da8..4292b89b9c 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -412,28 +412,6 @@ void SendQueue::recallFailed(CTabBaseDlg *dat, int iEntry) const SendDlgItemMessage(dat->GetHwnd(), IDC_SRMM_MESSAGE, EM_SETSEL, -1, -1); } -///////////////////////////////////////////////////////////////////////////////////////// -// searches string for characters typical for RTL text(hebrew and other RTL languages - -int SendQueue::RTL_Detect(const wchar_t *pszwText) -{ - size_t iLen = mir_wstrlen(pszwText); - - WORD *infoTypeC2 = (WORD*)mir_calloc(sizeof(WORD) * (iLen + 2)); - if (infoTypeC2 == nullptr) - return 0; - - GetStringTypeW(CT_CTYPE2, pszwText, (int)iLen, infoTypeC2); - - int n = 0; - for (size_t i = 0; i < iLen; i++) - if (infoTypeC2[i] == C2_RIGHTTOLEFT) - n++; - - mir_free(infoTypeC2); - return(n >= 2 ? 1 : 0); -} - int SendQueue::ackMessage(CTabBaseDlg *dat, WPARAM wParam, LPARAM lParam) { ACKDATA *ack = (ACKDATA *)lParam; diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h index 603ced7c2b..f6e48e769e 100644 --- a/plugins/TabSRMM/src/sendqueue.h +++ b/plugins/TabSRMM/src/sendqueue.h @@ -98,7 +98,6 @@ public: int doSendLater(int iIndex, CTabBaseDlg *dat, MCONTACT hContact = 0, bool fIsSendLater = true);
// static members
- static int TSAPI RTL_Detect(const wchar_t *pszwText);
static LRESULT TSAPI WarnPendingJobs(unsigned int uNrMessages);
private:
|