Hans Leidekker : mlang: Improve IMLangLineBreakConsole:: BreakLineA for the ASCII codepage.
Alexandre Julliard
julliard at winehq.org
Fri Jan 10 14:44:56 CST 2014
Module: wine
Branch: stable
Commit: 791b047b9f864b64f2a56196b26da08d50e62573
URL: http://source.winehq.org/git/wine.git/?a=commit;h=791b047b9f864b64f2a56196b26da08d50e62573
Author: Hans Leidekker <hans at codeweavers.com>
Date: Wed Nov 27 10:59:23 2013 +0100
mlang: Improve IMLangLineBreakConsole::BreakLineA for the ASCII codepage.
(cherry picked from commit 8c08faba490d821c61033eaec606e8862fe0964b)
---
dlls/mlang/mlang.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c
index d28f811..72c136d 100644
--- a/dlls/mlang/mlang.c
+++ b/dlls/mlang/mlang.c
@@ -36,6 +36,7 @@
#include "objbase.h"
#include "rpcproxy.h"
#include "mlang.h"
+#include "mimeole.h"
#include "wine/unicode.h"
#include "wine/debug.h"
@@ -44,8 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang);
#include "initguid.h"
-#define CP_UNICODE 1200
-
static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj);
static HRESULT MLangConvertCharset_create(IUnknown *outer, void **obj);
static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum);
@@ -3484,10 +3483,28 @@ static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineA(
LONG* pcchLine,
LONG* pcchSkip)
{
+ LONG i, line = cchSrc, skip = 0;
+
FIXME("(%p)->%i %i %s %i %i %p %p\n", iface, locale, uCodePage, debugstr_an(pszSrc,cchSrc), cchSrc, cMaxColumns, pcchLine, pcchSkip);
- *pcchLine = cchSrc;
- *pcchSkip = 0;
+ if (uCodePage == CP_USASCII && cchSrc > cMaxColumns)
+ {
+ for (line = cMaxColumns, i = cMaxColumns - 1; i >= 0; i--)
+ {
+ if (pszSrc[i] == ' ')
+ {
+ while (i >= 0 && pszSrc[i] == ' ')
+ {
+ i--;
+ line--;
+ skip++;
+ }
+ break;
+ }
+ }
+ }
+ *pcchLine = line;
+ *pcchSkip = skip;
return S_OK;
}
More information about the wine-cvs
mailing list