richmemo: win32 fix style selection on internal change.

modified Internal change. Only allow if styles is fully modified.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4526 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2016-02-29 04:48:34 +00:00
parent 5f4b958da5
commit 5804937f58
2 changed files with 13 additions and 3 deletions

View File

@ -383,6 +383,8 @@ class function TRichEditManager.SetSelectedTextStyle(RichEditWnd: Handle;
var
w : WPARAM;
fmt : TCHARFORMAT2;
const
CFM_STYLESONLY = CFM_BOLD or CFM_ITALIC or CFM_UNDERLINE or CFM_STRIKEOUT or CFM_SUBSCRIPT or CFM_SUPERSCRIPT;
begin
if RichEditWnd = 0 then begin
Result := false;
@ -411,7 +413,7 @@ begin
end;
if not useMask or (tmm_Styles in AModifyMask) then begin
fmt.dwMask := fmt.dwMask or CFM_EFFECTS or CFM_SUBSCRIPT or CFM_SUPERSCRIPT;
fmt.dwMask := fmt.dwMask or CFM_STYLESONLY;
fmt.dwEffects := FontStylesToEffects(Params.Style) or VScriptPosToEffects(Params.VScriptPos);
end;