Aric Stewart : usp10: Respect the presence or absence of the SSA_BREAK flag .

Alexandre Julliard julliard at winehq.org
Fri Sep 9 10:56:45 CDT 2011


Module: wine
Branch: master
Commit: dd4dd261f5fa10b4fcc9f7f2b02c59dfe1b147e8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dd4dd261f5fa10b4fcc9f7f2b02c59dfe1b147e8

Author: Aric Stewart <aric at codeweavers.com>
Date:   Thu Sep  8 12:50:03 2011 -0500

usp10: Respect the presence or absence of the SSA_BREAK flag.

---

 dlls/usp10/usp10.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 873d10b..e2a1756 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -324,6 +324,7 @@ typedef struct {
 
 typedef struct {
     HDC hdc;
+    DWORD dwFlags;
     BOOL invalid;
     int clip_len;
     ScriptCache *sc;
@@ -931,6 +932,7 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString,
     /* FIXME: handle clipping */
     analysis->clip_len = cString;
     analysis->hdc = hdc;
+    analysis->dwFlags = dwFlags;
 
     if (psState)
         sState = *psState;
@@ -959,10 +961,16 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString,
     }
     if (hr != S_OK) goto error;
 
-    if ((analysis->logattrs = heap_alloc(sizeof(SCRIPT_LOGATTR) * cString)))
-        ScriptBreak(pString, cString, (SCRIPT_STRING_ANALYSIS)analysis, analysis->logattrs);
-    else
-        goto error;
+    if (dwFlags & SSA_BREAK)
+    {
+        if ((analysis->logattrs = heap_alloc(sizeof(SCRIPT_LOGATTR) * cString)))
+        {
+            for (i = 0; i < analysis->numItems; i++)
+                ScriptBreak(&((LPWSTR)pString)[analysis->pItem[i].iCharPos], analysis->pItem[i+1].iCharPos - analysis->pItem[i].iCharPos, &analysis->pItem[i].a, &analysis->logattrs[analysis->pItem[i].iCharPos]);
+        }
+        else
+            goto error;
+    }
 
     if (!(analysis->glyphs = heap_alloc_zero(sizeof(StringGlyphs) * analysis->numItems)))
         goto error;
@@ -2351,6 +2359,7 @@ const SCRIPT_LOGATTR * WINAPI ScriptString_pLogAttr(SCRIPT_STRING_ANALYSIS ssa)
     TRACE("(%p)\n", ssa);
 
     if (!analysis) return NULL;
+    if (!(analysis->dwFlags & SSA_BREAK)) return NULL;
     return analysis->logattrs;
 }
 




More information about the wine-cvs mailing list