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}
uses
Classes, SysUtils, Types, TypInfo, Math,
AvgLvlTree, Maps, LCLVersion, LCLStrConsts, LCLType, LCLProc, LCLIntf,
FileUtil, InterfaceBase, LResources, GraphType, Graphics, Menus, LMessages,
CustomTimer, ActnList, ClipBrd, CustApp, HelpIntfs, LCLClasses, Controls,
ImgList, Themes
Classes, SysUtils, Types, TypInfo, Math, AvgLvlTree, Maps, LCLVersion,
LCLStrConsts, LCLType, LCLProc, LCLIntf, FileUtil, LazUTF8, InterfaceBase,
LResources, GraphType, Graphics, Menus, LMessages, CustomTimer, ActnList,
ClipBrd, CustApp, HelpIntfs, LCLClasses, Controls, ImgList, Themes
{$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);
if CtrlCaption='' then continue;
// do not put garbage in the title
p:=FindInvalidUTF8Character(PChar(CtrlCaption),length(CtrlCaption),true);
if p>=0 then
begin
CtrlCaption:=copy(CtrlCaption,1,p+1);
if CtrlCaption='' then
CtrlCaption:='?';
end;
UTF8FixBroken(CtrlCaption);
if not (AControl is TCustomForm) then
begin
// non controls like tmemo can have very long captions => cut them