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/Scriver | |
parent | d75d5e8706b06457b799831448f282818233abe9 (diff) |
Utils_IsRtl - core function to detect RTL direcction
Diffstat (limited to 'plugins/Scriver')
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 21 | ||||
-rw-r--r-- | plugins/Scriver/src/msglog.cpp | 3 |
2 files changed, 2 insertions, 22 deletions
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index b270d3fac1..fb9c8ed2f0 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -91,25 +91,6 @@ static wchar_t* GetQuotedTextW(wchar_t *text) return out;
}
-int RTL_Detect(WCHAR *pszwText)
-{
- size_t iLen = mir_wstrlen(pszwText);
-
- WORD *infoTypeC2 = (WORD *)mir_calloc(sizeof(WORD) * (iLen + 2));
- if (infoTypeC2) {
- GetStringTypeW(CT_CTYPE2, pszwText, (int)iLen, infoTypeC2);
-
- for (size_t i = 0; i < iLen; i++) {
- if (infoTypeC2[i] == C2_RIGHTTOLEFT) {
- mir_free(infoTypeC2);
- return 1;
- }
- }
- mir_free(infoTypeC2);
- }
- return 0;
-}
-
static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t* szFilename)
{
*pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(wchar_t*));
@@ -465,7 +446,7 @@ void CSrmmWindow::onClick_Ok(CCtrlButton *pButton) gt.cb = bufSize * sizeof(wchar_t);
gt.codepage = 1200; // Unicode
m_message.SendMsg(EM_GETTEXTEX, (WPARAM)>, ptszUnicode);
- if (RTL_Detect(ptszUnicode))
+ if (Utils_IsRtl(ptszUnicode))
msi.flags |= PREF_RTL;
msi.sendBuffer = mir_utf8encodeW(ptszUnicode);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index a96257bef1..f2beec5ee5 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define LOGICON_MSG_OUT 1
#define LOGICON_MSG_NOTICE 2
-extern int RTL_Detect(WCHAR *pszwText);
static int logPixelSY;
static char* pLogIconBmpBits[3];
static HIMAGELIST g_hImageList;
@@ -157,7 +156,7 @@ EventData* getEventFromDB(CSrmmWindow *dat, MCONTACT hContact, MEVENT hDbEvent) }
else evt->pszTextT = DbEvent_GetTextW(&dbei, CP_UTF8);
- if (!dat->m_bUseRtl && RTL_Detect(evt->pszTextT))
+ if (!dat->m_bUseRtl && Utils_IsRtl(evt->pszTextT))
evt->dwFlags |= IEEDF_RTL;
mir_free(dbei.pBlob);
|