lcl: TCustomForm.UpdateDockCaption: fixed repair garbage

git-svn-id: trunk@37461 -
This commit is contained in:
mattias 2012-05-30 08:01:43 +00:00
parent 42312bafc2
commit 3bfe2eecf6
2 changed files with 5 additions and 12 deletions

View File

@ -38,11 +38,10 @@ interface
{$DEFINE HasDefaultValues} {$DEFINE HasDefaultValues}
uses uses
Classes, SysUtils, Types, TypInfo, Math, Classes, SysUtils, Types, TypInfo, Math, AvgLvlTree, Maps, LCLVersion,
AvgLvlTree, Maps, LCLVersion, LCLStrConsts, LCLType, LCLProc, LCLIntf, LCLStrConsts, LCLType, LCLProc, LCLIntf, FileUtil, LazUTF8, InterfaceBase,
FileUtil, InterfaceBase, LResources, GraphType, Graphics, Menus, LMessages, LResources, GraphType, Graphics, Menus, LMessages, CustomTimer, ActnList,
CustomTimer, ActnList, ClipBrd, CustApp, HelpIntfs, LCLClasses, Controls, ClipBrd, CustApp, HelpIntfs, LCLClasses, Controls, ImgList, Themes
ImgList, Themes
{$ifndef wince},gettext{$endif}// remove ifdefs when gettext is fixed and a new fpc is released {$ifndef wince},gettext{$endif}// remove ifdefs when gettext is fixed and a new fpc is released
; ;

View File

@ -3009,13 +3009,7 @@ begin
CtrlCaption:=GetDockCaption(AControl); CtrlCaption:=GetDockCaption(AControl);
if CtrlCaption='' then continue; if CtrlCaption='' then continue;
// do not put garbage in the title // do not put garbage in the title
p:=FindInvalidUTF8Character(PChar(CtrlCaption),length(CtrlCaption),true); UTF8FixBroken(CtrlCaption);
if p>=0 then
begin
CtrlCaption:=copy(CtrlCaption,1,p+1);
if CtrlCaption='' then
CtrlCaption:='?';
end;
if not (AControl is TCustomForm) then if not (AControl is TCustomForm) then
begin begin
// non controls like tmemo can have very long captions => cut them // non controls like tmemo can have very long captions => cut them