[RICHED20] Sync with Wine Staging 1.9.11. CORE-11368

svn path=/trunk/; revision=71586
This commit is contained in:
Amine Khaldi 2016-06-07 11:01:48 +00:00
parent 833c7dbc6e
commit 7dcb748d30
11 changed files with 171 additions and 161 deletions

View file

@ -216,8 +216,7 @@ int ME_SetSelection(ME_TextEditor *editor, int from, int to)
} }
static void void ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor,
ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor,
int *x, int *y, int *height) int *x, int *y, int *height)
{ {
ME_DisplayItem *row; ME_DisplayItem *row;
@ -390,7 +389,7 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start,
nCharsToDelete is a number of chars to delete from THIS run */ nCharsToDelete is a number of chars to delete from THIS run */
nChars -= nCharsToDelete; nChars -= nCharsToDelete;
shift -= nCharsToDelete; shift -= nCharsToDelete;
TRACE("Deleting %d (remaning %d) chars at %d in %s (%d)\n", TRACE("Deleting %d (remaining %d) chars at %d in %s (%d)\n",
nCharsToDelete, nChars, c.nOffset, nCharsToDelete, nChars, c.nOffset,
debugstr_run( run ), run->len); debugstr_run( run ), run->len);

View file

@ -541,11 +541,6 @@ void ME_RTFCharAttrHook(RTF_Info *info)
the same tags mean different things in different contexts */ the same tags mean different things in different contexts */
void ME_RTFParAttrHook(RTF_Info *info) void ME_RTFParAttrHook(RTF_Info *info)
{ {
PARAFORMAT2 fmt;
fmt.cbSize = sizeof(fmt);
fmt.dwMask = 0;
fmt.wEffects = 0;
switch(info->rtfMinor) switch(info->rtfMinor)
{ {
case rtfParDef: /* restores default paragraph attributes */ case rtfParDef: /* restores default paragraph attributes */
@ -553,18 +548,19 @@ void ME_RTFParAttrHook(RTF_Info *info)
info->borderType = RTFBorderParaLeft; info->borderType = RTFBorderParaLeft;
else /* v1.0 - 3.0 */ else /* v1.0 - 3.0 */
info->borderType = RTFBorderParaTop; info->borderType = RTFBorderParaTop;
fmt.dwMask = PFM_ALIGNMENT | PFM_BORDER | PFM_LINESPACING | PFM_TABSTOPS | info->fmt.dwMask = PFM_ALIGNMENT | PFM_BORDER | PFM_LINESPACING | PFM_TABSTOPS |
PFM_OFFSET | PFM_RIGHTINDENT | PFM_SPACEAFTER | PFM_SPACEBEFORE | PFM_OFFSET | PFM_RIGHTINDENT | PFM_SPACEAFTER | PFM_SPACEBEFORE |
PFM_STARTINDENT; PFM_STARTINDENT | PFM_RTLPARA;
/* TODO: numbering, shading */ /* TODO: numbering, shading */
fmt.wAlignment = PFA_LEFT; info->fmt.wAlignment = PFA_LEFT;
fmt.cTabCount = 0; info->fmt.cTabCount = 0;
fmt.dxOffset = fmt.dxStartIndent = fmt.dxRightIndent = 0; info->fmt.dxOffset = info->fmt.dxStartIndent = info->fmt.dxRightIndent = 0;
fmt.wBorderWidth = fmt.wBorders = 0; info->fmt.wBorderWidth = info->fmt.wBorders = 0;
fmt.wBorderSpace = 0; info->fmt.wBorderSpace = 0;
fmt.bLineSpacingRule = 0; info->fmt.bLineSpacingRule = 0;
fmt.dySpaceBefore = fmt.dySpaceAfter = 0; info->fmt.dySpaceBefore = info->fmt.dySpaceAfter = 0;
fmt.dyLineSpacing = 0; info->fmt.dyLineSpacing = 0;
info->fmt.wEffects &= ~PFE_RTLPARA;
if (!info->editor->bEmulateVersion10) /* v4.1 */ if (!info->editor->bEmulateVersion10) /* v4.1 */
{ {
if (info->tableDef && info->tableDef->tableRowStart && if (info->tableDef && info->tableDef->tableRowStart &&
@ -588,8 +584,8 @@ void ME_RTFParAttrHook(RTF_Info *info)
} }
} }
} else { /* v1.0 - v3.0 */ } else { /* v1.0 - v3.0 */
fmt.dwMask |= PFM_TABLE; info->fmt.dwMask |= PFM_TABLE;
fmt.wEffects &= ~PFE_TABLE; info->fmt.wEffects &= ~PFE_TABLE;
} }
break; break;
case rtfNestLevel: case rtfNestLevel:
@ -657,197 +653,168 @@ void ME_RTFParAttrHook(RTF_Info *info)
} }
return; return;
} else { /* v1.0 - v3.0 */ } else { /* v1.0 - v3.0 */
fmt.dwMask |= PFM_TABLE; info->fmt.dwMask |= PFM_TABLE;
fmt.wEffects |= PFE_TABLE; info->fmt.wEffects |= PFE_TABLE;
} }
break; break;
} }
case rtfFirstIndent: case rtfFirstIndent:
ME_GetSelectionParaFormat(info->editor, &fmt);
fmt.dwMask = PFM_STARTINDENT | PFM_OFFSET;
fmt.dxStartIndent += fmt.dxOffset + info->rtfParam;
fmt.dxOffset = -info->rtfParam;
break;
case rtfLeftIndent: case rtfLeftIndent:
if ((info->fmt.dwMask & (PFM_STARTINDENT | PFM_OFFSET)) != (PFM_STARTINDENT | PFM_OFFSET))
{
PARAFORMAT2 fmt;
fmt.cbSize = sizeof(fmt);
ME_GetSelectionParaFormat(info->editor, &fmt); ME_GetSelectionParaFormat(info->editor, &fmt);
fmt.dwMask = PFM_STARTINDENT; info->fmt.dwMask |= PFM_STARTINDENT | PFM_OFFSET;
fmt.dxStartIndent = info->rtfParam - fmt.dxOffset; info->fmt.dxStartIndent = fmt.dxStartIndent;
info->fmt.dxOffset = fmt.dxOffset;
}
if (info->rtfMinor == rtfFirstIndent)
{
info->fmt.dxStartIndent += info->fmt.dxOffset + info->rtfParam;
info->fmt.dxOffset = -info->rtfParam;
}
else
info->fmt.dxStartIndent = info->rtfParam - info->fmt.dxOffset;
break; break;
case rtfRightIndent: case rtfRightIndent:
fmt.dwMask = PFM_RIGHTINDENT; info->fmt.dwMask |= PFM_RIGHTINDENT;
fmt.dxRightIndent = info->rtfParam; info->fmt.dxRightIndent = info->rtfParam;
break; break;
case rtfQuadLeft: case rtfQuadLeft:
case rtfQuadJust: case rtfQuadJust:
fmt.dwMask = PFM_ALIGNMENT; info->fmt.dwMask |= PFM_ALIGNMENT;
fmt.wAlignment = PFA_LEFT; info->fmt.wAlignment = PFA_LEFT;
break; break;
case rtfQuadRight: case rtfQuadRight:
fmt.dwMask = PFM_ALIGNMENT; info->fmt.dwMask |= PFM_ALIGNMENT;
fmt.wAlignment = PFA_RIGHT; info->fmt.wAlignment = PFA_RIGHT;
break; break;
case rtfQuadCenter: case rtfQuadCenter:
fmt.dwMask = PFM_ALIGNMENT; info->fmt.dwMask |= PFM_ALIGNMENT;
fmt.wAlignment = PFA_CENTER; info->fmt.wAlignment = PFA_CENTER;
break; break;
case rtfTabPos: case rtfTabPos:
ME_GetSelectionParaFormat(info->editor, &fmt); if (!(info->fmt.dwMask & PFM_TABSTOPS))
if (!(fmt.dwMask & PFM_TABSTOPS))
{ {
fmt.cTabCount = 0; PARAFORMAT2 fmt;
fmt.cbSize = sizeof(fmt);
ME_GetSelectionParaFormat(info->editor, &fmt);
memcpy(info->fmt.rgxTabs, fmt.rgxTabs,
fmt.cTabCount * sizeof(fmt.rgxTabs[0]));
info->fmt.cTabCount = fmt.cTabCount;
info->fmt.dwMask |= PFM_TABSTOPS;
} }
if (fmt.cTabCount < MAX_TAB_STOPS && info->rtfParam < 0x1000000) if (info->fmt.cTabCount < MAX_TAB_STOPS && info->rtfParam < 0x1000000)
fmt.rgxTabs[fmt.cTabCount++] = info->rtfParam; info->fmt.rgxTabs[info->fmt.cTabCount++] = info->rtfParam;
fmt.dwMask = PFM_TABSTOPS;
break; break;
case rtfKeep: case rtfKeep:
fmt.dwMask = PFM_KEEP; info->fmt.dwMask |= PFM_KEEP;
fmt.wEffects = PFE_KEEP; info->fmt.wEffects |= PFE_KEEP;
break; break;
case rtfNoWidowControl: case rtfNoWidowControl:
fmt.dwMask = PFM_NOWIDOWCONTROL; info->fmt.dwMask |= PFM_NOWIDOWCONTROL;
fmt.wEffects = PFE_NOWIDOWCONTROL; info->fmt.wEffects |= PFE_NOWIDOWCONTROL;
break; break;
case rtfKeepNext: case rtfKeepNext:
fmt.dwMask = PFM_KEEPNEXT; info->fmt.dwMask |= PFM_KEEPNEXT;
fmt.wEffects = PFE_KEEPNEXT; info->fmt.wEffects |= PFE_KEEPNEXT;
break; break;
case rtfSpaceAfter: case rtfSpaceAfter:
fmt.dwMask = PFM_SPACEAFTER; info->fmt.dwMask |= PFM_SPACEAFTER;
fmt.dySpaceAfter = info->rtfParam; info->fmt.dySpaceAfter = info->rtfParam;
break; break;
case rtfSpaceBefore: case rtfSpaceBefore:
fmt.dwMask = PFM_SPACEBEFORE; info->fmt.dwMask |= PFM_SPACEBEFORE;
fmt.dySpaceBefore = info->rtfParam; info->fmt.dySpaceBefore = info->rtfParam;
break; break;
case rtfSpaceBetween: case rtfSpaceBetween:
fmt.dwMask = PFM_LINESPACING; info->fmt.dwMask |= PFM_LINESPACING;
if ((int)info->rtfParam > 0) if ((int)info->rtfParam > 0)
{ {
fmt.dyLineSpacing = info->rtfParam; info->fmt.dyLineSpacing = info->rtfParam;
fmt.bLineSpacingRule = 3; info->fmt.bLineSpacingRule = 3;
} }
else else
{ {
fmt.dyLineSpacing = info->rtfParam; info->fmt.dyLineSpacing = info->rtfParam;
fmt.bLineSpacingRule = 4; info->fmt.bLineSpacingRule = 4;
} }
break; break;
case rtfSpaceMultiply: case rtfSpaceMultiply:
fmt.dwMask = PFM_LINESPACING; info->fmt.dwMask |= PFM_LINESPACING;
fmt.dyLineSpacing = info->rtfParam * 20; info->fmt.dyLineSpacing = info->rtfParam * 20;
fmt.bLineSpacingRule = 5; info->fmt.bLineSpacingRule = 5;
break; break;
case rtfParBullet: case rtfParBullet:
fmt.dwMask = PFM_NUMBERING; info->fmt.dwMask |= PFM_NUMBERING;
fmt.wNumbering = PFN_BULLET; info->fmt.wNumbering = PFN_BULLET;
break; break;
case rtfParSimple: case rtfParSimple:
fmt.dwMask = PFM_NUMBERING; info->fmt.dwMask |= PFM_NUMBERING;
fmt.wNumbering = 2; /* FIXME: MSDN says it's not used ?? */ info->fmt.wNumbering = 2; /* FIXME: MSDN says it's not used ?? */
break; break;
case rtfParNumDecimal: case rtfParNumDecimal:
fmt.dwMask = PFM_NUMBERING; info->fmt.dwMask |= PFM_NUMBERING;
fmt.wNumbering = 2; /* FIXME: MSDN says it's not used ?? */ info->fmt.wNumbering = 2; /* FIXME: MSDN says it's not used ?? */
break; break;
case rtfParNumIndent: case rtfParNumIndent:
fmt.dwMask = PFM_NUMBERINGTAB; info->fmt.dwMask |= PFM_NUMBERINGTAB;
fmt.wNumberingTab = info->rtfParam; info->fmt.wNumberingTab = info->rtfParam;
break; break;
case rtfParNumStartAt: case rtfParNumStartAt:
fmt.dwMask = PFM_NUMBERINGSTART; info->fmt.dwMask |= PFM_NUMBERINGSTART;
fmt.wNumberingStart = info->rtfParam; info->fmt.wNumberingStart = info->rtfParam;
break; break;
case rtfBorderLeft: case rtfBorderLeft:
info->borderType = RTFBorderParaLeft; info->borderType = RTFBorderParaLeft;
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders |= 1;
if (!(fmt.dwMask & PFM_BORDER)) info->fmt.dwMask |= PFM_BORDER;
{
fmt.wBorderSpace = 0;
fmt.wBorderWidth = 1;
fmt.wBorders = 0;
}
fmt.wBorders |= 1;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderRight: case rtfBorderRight:
info->borderType = RTFBorderParaRight; info->borderType = RTFBorderParaRight;
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders |= 2;
if (!(fmt.dwMask & PFM_BORDER)) info->fmt.dwMask |= PFM_BORDER;
{
fmt.wBorderSpace = 0;
fmt.wBorderWidth = 1;
fmt.wBorders = 0;
}
fmt.wBorders |= 2;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderTop: case rtfBorderTop:
info->borderType = RTFBorderParaTop; info->borderType = RTFBorderParaTop;
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders |= 4;
if (!(fmt.dwMask & PFM_BORDER)) info->fmt.dwMask |= PFM_BORDER;
{
fmt.wBorderSpace = 0;
fmt.wBorderWidth = 1;
fmt.wBorders = 0;
}
fmt.wBorders |= 4;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderBottom: case rtfBorderBottom:
info->borderType = RTFBorderParaBottom; info->borderType = RTFBorderParaBottom;
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders |= 8;
if (!(fmt.dwMask & PFM_BORDER)) info->fmt.dwMask |= PFM_BORDER;
{
fmt.wBorderSpace = 0;
fmt.wBorderWidth = 1;
fmt.wBorders = 0;
}
fmt.wBorders |= 8;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderSingle: case rtfBorderSingle:
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders &= ~0x700;
/* we assume that borders have been created before (RTF spec) */ info->fmt.wBorders |= 1 << 8;
fmt.wBorders &= ~0x700; info->fmt.dwMask |= PFM_BORDER;
fmt.wBorders |= 1 << 8;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderThick: case rtfBorderThick:
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders &= ~0x700;
/* we assume that borders have been created before (RTF spec) */ info->fmt.wBorders |= 2 << 8;
fmt.wBorders &= ~0x700; info->fmt.dwMask |= PFM_BORDER;
fmt.wBorders |= 2 << 8;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderShadow: case rtfBorderShadow:
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders &= ~0x700;
/* we assume that borders have been created before (RTF spec) */ info->fmt.wBorders |= 10 << 8;
fmt.wBorders &= ~0x700; info->fmt.dwMask |= PFM_BORDER;
fmt.wBorders |= 10 << 8;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderDouble: case rtfBorderDouble:
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders &= ~0x700;
/* we assume that borders have been created before (RTF spec) */ info->fmt.wBorders |= 7 << 8;
fmt.wBorders &= ~0x700; info->fmt.dwMask |= PFM_BORDER;
fmt.wBorders |= 7 << 8;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderDot: case rtfBorderDot:
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorders &= ~0x700;
/* we assume that borders have been created before (RTF spec) */ info->fmt.wBorders |= 11 << 8;
fmt.wBorders &= ~0x700; info->fmt.dwMask |= PFM_BORDER;
fmt.wBorders |= 11 << 8;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderWidth: case rtfBorderWidth:
{ {
int borderSide = info->borderType & RTFBorderSideMask; int borderSide = info->borderType & RTFBorderSideMask;
RTFTable *tableDef = info->tableDef; RTFTable *tableDef = info->tableDef;
ME_GetSelectionParaFormat(info->editor, &fmt);
/* we assume that borders have been created before (RTF spec) */
fmt.wBorderWidth |= ((info->rtfParam / 15) & 7) << 8;
if ((info->borderType & RTFBorderTypeMask) == RTFBorderTypeCell) if ((info->borderType & RTFBorderTypeMask) == RTFBorderTypeCell)
{ {
RTFBorder *border; RTFBorder *border;
@ -857,14 +824,13 @@ void ME_RTFParAttrHook(RTF_Info *info)
border->width = info->rtfParam; border->width = info->rtfParam;
break; break;
} }
fmt.dwMask = PFM_BORDER; info->fmt.wBorderWidth = info->rtfParam;
info->fmt.dwMask |= PFM_BORDER;
break; break;
} }
case rtfBorderSpace: case rtfBorderSpace:
ME_GetSelectionParaFormat(info->editor, &fmt); info->fmt.wBorderSpace = info->rtfParam;
/* we assume that borders have been created before (RTF spec) */ info->fmt.dwMask |= PFM_BORDER;
fmt.wBorderSpace = info->rtfParam;
fmt.dwMask = PFM_BORDER;
break; break;
case rtfBorderColor: case rtfBorderColor:
{ {
@ -891,19 +857,14 @@ void ME_RTFParAttrHook(RTF_Info *info)
break; break;
} }
case rtfRTLPar: case rtfRTLPar:
fmt.dwMask = PFM_RTLPARA; info->fmt.dwMask |= PFM_RTLPARA;
fmt.wEffects = PFE_RTLPARA; info->fmt.wEffects |= PFE_RTLPARA;
break; break;
case rtfLTRPar: case rtfLTRPar:
fmt.dwMask = PFM_RTLPARA; info->fmt.dwMask = PFM_RTLPARA;
fmt.wEffects = 0; info->fmt.wEffects &= ~PFE_RTLPARA;
break; break;
} }
if (fmt.dwMask) {
RTFFlushOutputBuffer(info);
/* FIXME too slow ? how come ?*/
ME_SetSelectionParaFormat(info->editor, &fmt);
}
} }
void ME_RTFTblAttrHook(RTF_Info *info) void ME_RTFTblAttrHook(RTF_Info *info)
@ -3662,7 +3623,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
editor->hbrBackground = CreateSolidBrush(editor->rgbBackColor); editor->hbrBackground = CreateSolidBrush(editor->rgbBackColor);
} }
ITextHost_TxInvalidateRect(editor->texthost, NULL, TRUE); ITextHost_TxInvalidateRect(editor->texthost, NULL, TRUE);
ITextHost_TxViewChange(editor->texthost, TRUE);
return lColor; return lColor;
} }
case EM_GETMODIFY: case EM_GETMODIFY:

View file

@ -227,6 +227,7 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start, int nChars,
int ME_GetTextLength(ME_TextEditor *editor) DECLSPEC_HIDDEN; int ME_GetTextLength(ME_TextEditor *editor) DECLSPEC_HIDDEN;
int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how) DECLSPEC_HIDDEN; int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how) DECLSPEC_HIDDEN;
ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN; ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN;
void ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, int *x, int *y, int *height) DECLSPEC_HIDDEN;
/* context.c */ /* context.c */
void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC) DECLSPEC_HIDDEN; void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC) DECLSPEC_HIDDEN;

View file

@ -956,7 +956,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph)
rc.right = rc.left + run->nWidth; rc.right = rc.left + run->nWidth;
rc.top = c->pt.y + para->pt.y + run->pt.y; rc.top = c->pt.y + para->pt.y + run->pt.y;
rc.bottom = rc.top + height; rc.bottom = rc.top + height;
TRACE("rc = (%d, %d, %d, %d)\n", rc.left, rc.top, rc.right, rc.bottom); TRACE("rc = %s\n", wine_dbgstr_rect(&rc));
FrameRect(c->hDC, &rc, GetSysColorBrush(COLOR_GRAYTEXT)); FrameRect(c->hDC, &rc, GetSysColorBrush(COLOR_GRAYTEXT));
} }
if (visible) if (visible)

View file

@ -506,7 +506,7 @@ void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048])
DUMP(PFM_STYLE, "Text style:", "%d", sStyle); DUMP(PFM_STYLE, "Text style:", "%d", sStyle);
DUMP(PFM_LINESPACING, "Line spacing rule:", "%u", bLineSpacingRule); DUMP(PFM_LINESPACING, "Line spacing rule:", "%u", bLineSpacingRule);
/* bOutlineLevel should be 0 */ /* bOutlineLevel should be 0 */
DUMP(PFM_SHADING, "Shading Weigth:", "%u", wShadingWeight); DUMP(PFM_SHADING, "Shading Weight:", "%u", wShadingWeight);
DUMP(PFM_SHADING, "Shading Style:", "%u", wShadingStyle); DUMP(PFM_SHADING, "Shading Style:", "%u", wShadingStyle);
DUMP(PFM_NUMBERINGSTART, "Numbering Start:", "%u", wNumberingStart); DUMP(PFM_NUMBERINGSTART, "Numbering Start:", "%u", wNumberingStart);
DUMP(PFM_NUMBERINGSTYLE, "Numbering Style:", "0x%x", wNumberingStyle); DUMP(PFM_NUMBERINGSTYLE, "Numbering Style:", "0x%x", wNumberingStyle);

View file

@ -258,6 +258,9 @@ void RTFInit(RTF_Info *info)
info->nestingLevel = 0; info->nestingLevel = 0;
info->canInheritInTbl = FALSE; info->canInheritInTbl = FALSE;
info->borderType = 0; info->borderType = 0;
memset(&info->fmt, 0, sizeof(info->fmt));
info->fmt.cbSize = sizeof(info->fmt);
} }
/* /*
@ -2505,6 +2508,10 @@ static void SpecialChar (RTF_Info *info)
case rtfPage: case rtfPage:
case rtfSect: case rtfSect:
case rtfPar: case rtfPar:
RTFFlushOutputBuffer(info);
ME_SetSelectionParaFormat(info->editor, &info->fmt);
memset(&info->fmt, 0, sizeof(info->fmt));
info->fmt.cbSize = sizeof(info->fmt);
RTFPutUnicodeChar (info, '\r'); RTFPutUnicodeChar (info, '\r');
if (info->editor->bEmulateVersion10) RTFPutUnicodeChar (info, '\n'); if (info->editor->bEmulateVersion10) RTFPutUnicodeChar (info, '\n');
break; break;
@ -2526,6 +2533,12 @@ static void SpecialChar (RTF_Info *info)
case rtfEnDash: case rtfEnDash:
RTFPutUnicodeChar (info, 0x2013); RTFPutUnicodeChar (info, 0x2013);
break; break;
case rtfEmSpace:
RTFPutUnicodeChar (info, ' ');
break;
case rtfEnSpace:
RTFPutUnicodeChar (info, ' ');
break;
case rtfLQuote: case rtfLQuote:
RTFPutUnicodeChar (info, 0x2018); RTFPutUnicodeChar (info, 0x2018);
break; break;
@ -2538,6 +2551,18 @@ static void SpecialChar (RTF_Info *info)
case rtfRDblQuote: case rtfRDblQuote:
RTFPutUnicodeChar (info, 0x201D); RTFPutUnicodeChar (info, 0x201D);
break; break;
case rtfLTRMark:
RTFPutUnicodeChar (info, 0x200E);
break;
case rtfRTLMark:
RTFPutUnicodeChar (info, 0x200F);
break;
case rtfNoWidthJoiner:
RTFPutUnicodeChar (info, 0x200D);
break;
case rtfNoWidthNonJoiner:
RTFPutUnicodeChar (info, 0x200C);
break;
} }
} }

View file

@ -2445,14 +2445,30 @@ static HRESULT WINAPI ITextRange_fnSetPoint(ITextRange *me, LONG x, LONG y, LONG
static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG value) static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG value)
{ {
ITextRangeImpl *This = impl_from_ITextRange(me); ITextRangeImpl *This = impl_from_ITextRange(me);
ME_TextEditor *editor;
ME_Cursor cursor;
int x, y, height;
FIXME("(%p)->(%d): stub\n", This, value); TRACE("(%p)->(%d)\n", This, value);
if (!This->child.reole) if (!This->child.reole)
return CO_E_RELEASED; return CO_E_RELEASED;
editor = This->child.reole->editor;
switch (value)
{
case tomStart:
ME_CursorFromCharOfs(editor, This->start, &cursor);
ME_GetCursorCoordinates(editor, &cursor, &x, &y, &height);
break;
default:
FIXME("bStart value %d not handled\n", value);
return E_NOTIMPL; return E_NOTIMPL;
} }
ME_ScrollAbs(editor, x, y);
return S_OK;
}
static HRESULT WINAPI ITextRange_fnGetEmbeddedObject(ITextRange *me, IUnknown **ppv) static HRESULT WINAPI ITextRange_fnGetEmbeddedObject(ITextRange *me, IUnknown **ppv)
{ {

View file

@ -1171,6 +1171,8 @@ struct _RTF_Info {
int nestingLevel; int nestingLevel;
BOOL canInheritInTbl; BOOL canInheritInTbl;
int borderType; /* value corresponds to the RTFBorder constants. */ int borderType; /* value corresponds to the RTFBorder constants. */
PARAFORMAT2 fmt; /* Accumulated para fmt for current paragraph. */
}; };

View file

@ -404,10 +404,7 @@ HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, I
ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl; ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl;
ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE, ES_LEFT); ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE, ES_LEFT);
ITextImpl->editor->exStyleFlags = 0; ITextImpl->editor->exStyleFlags = 0;
ITextImpl->editor->rcFormat.left = 0; SetRectEmpty(&ITextImpl->editor->rcFormat);
ITextImpl->editor->rcFormat.top = 0;
ITextImpl->editor->rcFormat.right = 0;
ITextImpl->editor->rcFormat.bottom = 0;
if (pUnkOuter) if (pUnkOuter)
ITextImpl->outer_unk = pUnkOuter; ITextImpl->outer_unk = pUnkOuter;

View file

@ -746,6 +746,11 @@ static HRESULT itemize_para( ME_Context *c, ME_DisplayItem *p )
assert( p->type == diParagraph ); assert( p->type == diParagraph );
if (para->pFmt->dwMask & PFM_RTLPARA && para->pFmt->wEffects & PFE_RTLPARA)
state.uBidiLevel = 1;
TRACE( "Base embedding level %d\n", state.uBidiLevel );
while (1) while (1)
{ {
hr = ScriptItemize( para->text->szData, para->text->nLen, items_passed, &control, hr = ScriptItemize( para->text->szData, para->text->nLen, items_passed, &control,
@ -874,6 +879,11 @@ static void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp) {
wc.nFirstMargin = ME_twips2pointsX(c, dxStartIndent); wc.nFirstMargin = ME_twips2pointsX(c, dxStartIndent);
wc.nLeftMargin = wc.nFirstMargin + ME_twips2pointsX(c, pFmt->dxOffset); wc.nLeftMargin = wc.nFirstMargin + ME_twips2pointsX(c, pFmt->dxOffset);
wc.nRightMargin = ME_twips2pointsX(c, pFmt->dxRightIndent); wc.nRightMargin = ME_twips2pointsX(c, pFmt->dxRightIndent);
if (wc.nFirstMargin < 0)
wc.nFirstMargin = 0;
if (wc.nLeftMargin < 0)
wc.nLeftMargin = 0;
} }
if (c->editor->bEmulateVersion10 && /* v1.0 - 3.0 */ if (c->editor->bEmulateVersion10 && /* v1.0 - 3.0 */
pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE)

View file

@ -161,7 +161,7 @@ reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.9.4
reactos/dll/win32/query # Synced to WineStaging-1.9.4 reactos/dll/win32/query # Synced to WineStaging-1.9.4
reactos/dll/win32/rasapi32 # Synced to WineStaging-1.9.4 reactos/dll/win32/rasapi32 # Synced to WineStaging-1.9.4
reactos/dll/win32/resutils # Synced to WineStaging-1.9.4 reactos/dll/win32/resutils # Synced to WineStaging-1.9.4
reactos/dll/win32/riched20 # Synced to WineStaging-1.9.4 reactos/dll/win32/riched20 # Synced to WineStaging-1.9.11
reactos/dll/win32/riched32 # Synced to WineStaging-1.9.4 reactos/dll/win32/riched32 # Synced to WineStaging-1.9.4
reactos/dll/win32/rpcrt4 # Synced to WineStaging-1.9.4 reactos/dll/win32/rpcrt4 # Synced to WineStaging-1.9.4
reactos/dll/win32/rsabase # Synced to WineStaging-1.9.4 reactos/dll/win32/rsabase # Synced to WineStaging-1.9.4