summaryrefslogtreecommitdiff
path: root/plugins/mTextControl
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-06-15 18:52:16 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-06-15 18:52:16 +0000
commit58973a21a30bf95427fd43c456e41e35c386218c (patch)
tree1413fba069ecd351b2c99fa5a53e52c68d8a662c /plugins/mTextControl
parent55b5cf8a5506f03350e5c80ac86f5717425e4d10 (diff)
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@434 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/mTextControl')
-rw-r--r--plugins/mTextControl/src/FormattedTextDraw.cpp18
-rw-r--r--plugins/mTextControl/src/headers.h11
-rw-r--r--plugins/mTextControl/src/richeditutils.cpp6
-rw-r--r--plugins/mTextControl/src/services.cpp12
-rw-r--r--plugins/mTextControl/src/textcontrol.cpp8
5 files changed, 14 insertions, 41 deletions
diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp
index be42fade65..f40edb1d00 100644
--- a/plugins/mTextControl/src/FormattedTextDraw.cpp
+++ b/plugins/mTextControl/src/FormattedTextDraw.cpp
@@ -78,7 +78,7 @@ HRESULT CFormattedTextDraw::putRTFTextA(char *newVal)
HRESULT CFormattedTextDraw::putRTFTextW(WCHAR *newVal)
{
-#ifdef UNICODE
+
HRESULT hr;
LRESULT lResult = 0;
EDITSTREAM editStream;
@@ -95,9 +95,7 @@ HRESULT CFormattedTextDraw::putRTFTextW(WCHAR *newVal)
editStream.pfnCallback = (EDITSTREAMCALLBACK)EditStreamInCallback;
hr = m_spTextServices->TxSendMessage(EM_STREAMIN, (WPARAM)(SF_RTF|SF_UNICODE), (LPARAM)&editStream, &lResult);
return S_OK;
-#else
- return E_FAIL;
-#endif
+
}
HRESULT CFormattedTextDraw::putTextA(char *newVal)
@@ -130,7 +128,7 @@ HRESULT CFormattedTextDraw::putTextA(char *newVal)
HRESULT CFormattedTextDraw::putTextW(WCHAR *newVal)
{
-#ifdef UNICODE
+
HRESULT hr;
LRESULT lResult = 0;
EDITSTREAM editStream;
@@ -155,9 +153,7 @@ HRESULT CFormattedTextDraw::putTextW(WCHAR *newVal)
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
-#else
- return E_FAIL;
-#endif
+
}
HRESULT CFormattedTextDraw::Draw(void *hdcDraw, RECT *prc)
@@ -510,11 +506,9 @@ HRESULT CFormattedTextDraw::CharFormatFromHFONT(CHARFORMAT2W* pCF, HFONT hFont)
pCF->bCharSet = lf.lfCharSet;
pCF->bPitchAndFamily = lf.lfPitchAndFamily;
-#ifdef UNICODE
+
lstrcpyW(pCF->szFaceName, lf.lfFaceName);
-#else
- MultiByteToWideChar(CP_ACP, 0, lf.lfFaceName, LF_FACESIZE, pCF->szFaceName, LF_FACESIZE);
-#endif
+
return S_OK;
}
diff --git a/plugins/mTextControl/src/headers.h b/plugins/mTextControl/src/headers.h
index a2ff0df6ab..cbe1d455c1 100644
--- a/plugins/mTextControl/src/headers.h
+++ b/plugins/mTextControl/src/headers.h
@@ -20,17 +20,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef __headers_h__
#define __headers_h__
-#if defined(UNICODE) && !defined(_UNICODE)
- #define _UNICODE
-#elif defined(_UNICODE) && !defined(UNICODE)
- #define UNICODE
-#endif
-
-#ifndef UNICODE
- #define OLE2ANSI
-#elif defined(OLE2ANSI)
- #undef OLE2ANSI
-#endif
#define _CRT_SECURE_NO_DEPRECATE
diff --git a/plugins/mTextControl/src/richeditutils.cpp b/plugins/mTextControl/src/richeditutils.cpp
index 28a267654b..ca361bc371 100644
--- a/plugins/mTextControl/src/richeditutils.cpp
+++ b/plugins/mTextControl/src/richeditutils.cpp
@@ -83,11 +83,9 @@ public:
MultiByteToWideChar(CP_ACP, 0, szName, -1, szwName, sizeof(szwName) / sizeof(szwName[0]));
if (this->pictStg == NULL)
return STG_E_MEDIUMFULL;
-#ifdef UNICODE
+
return this->pictStg->CreateStorage(szwName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
-#else
- return this->pictStg->CreateStorage(szName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
-#endif
+
}
HRESULT STDMETHODCALLTYPE QueryAcceptData(LPDATAOBJECT lpdataobj, CLIPFORMAT * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict)
diff --git a/plugins/mTextControl/src/services.cpp b/plugins/mTextControl/src/services.cpp
index 8970969ec4..3d2a9c0bee 100644
--- a/plugins/mTextControl/src/services.cpp
+++ b/plugins/mTextControl/src/services.cpp
@@ -143,7 +143,7 @@ INT_PTR MText_Create(WPARAM wParam, LPARAM lParam) {
// allocate text object (unicode)
HANDLE DLL_CALLCONV
MTI_MTextCreateW (HANDLE userHandle, WCHAR *text) {
-#ifdef UNICODE
+
TextObject *result = new TextObject;
result->options = TextUserGetOptions(userHandle);
result->ftd = new CFormattedTextDraw;
@@ -155,19 +155,15 @@ MTI_MTextCreateW (HANDLE userHandle, WCHAR *text) {
MText_InitFormatting1(result);
return (HANDLE)result;
-#else
- return 0;
-#endif
+
}
INT_PTR MText_CreateW(WPARAM wParam, LPARAM lParam) {
-#ifdef UNICODE
+
//HANDLE userHandle = (HANDLE)wParam;
//WCHAR *wtext = (WCHAR *)lParam;
return (INT_PTR)(HANDLE)MTI_MTextCreateW ((HANDLE)wParam, (WCHAR *)lParam);
-#else
- return 0;
-#endif
+
}
//---------------------------------------------------------------------------
diff --git a/plugins/mTextControl/src/textcontrol.cpp b/plugins/mTextControl/src/textcontrol.cpp
index 29caf2eb0a..19b837349c 100644
--- a/plugins/mTextControl/src/textcontrol.cpp
+++ b/plugins/mTextControl/src/textcontrol.cpp
@@ -84,12 +84,8 @@ LRESULT CALLBACK MTextControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
int textLength = GetWindowTextLength(hwnd);
data->text = new TCHAR[textLength+1];
GetWindowText(hwnd, data->text, textLength+1);
- #if defined(UNICODE) || defined (_UNICODE)
- data->mtext = MTI_MTextCreateW(data->htu, data->text);
- #else
- data->mtext = MTI_MTextCreate(data->htu, data->text);
- #endif
-
+ data->mtext = MTI_MTextCreateW(data->htu, data->text);
+
RECT rc; GetClientRect(hwnd, &rc);
MTI_MTextSetParent(data->mtext, hwnd, rc);