From 28d98a38c756991d461301efb483e4980a2def69 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 1 May 2017 11:58:04 +0300 Subject: Utils_IsRtl - core function to detect RTL direcction --- src/core/stdmsg/src/msgdialog.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/core') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index d66a15cc00..e8e58a5fdc 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -35,26 +35,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static const UINT sendControls[] = { IDC_SRMM_MESSAGE }; -static int RTL_Detect(const wchar_t *ptszText) -{ - int iLen = (int)mir_wstrlen(ptszText); - WORD *infoTypeC2 = (WORD*)alloca(sizeof(WORD)* (iLen + 2)); - GetStringTypeEx(LOCALE_USER_DEFAULT, CT_CTYPE2, ptszText, iLen, infoTypeC2); - - for (int i = 0; i < iLen; i++) - if (infoTypeC2[i] == C2_RIGHTTOLEFT) - return 1; - - return 0; -} - int SendMessageDirect(const wchar_t *szMsg, MCONTACT hContact) { if (hContact == 0) return 0; int flags = 0; - if (RTL_Detect(szMsg)) + if (Utils_IsRtl(szMsg)) flags |= PREF_RTL; T2Utf sendBuffer(szMsg); -- cgit v1.2.3