[JEDI.NET-commits] main/run Jedi.Strings.pas,1.1,1.2
Status: Pre-Alpha
Brought to you by:
jedi_mbe
From: Marcel B. <jed...@us...> - 2004-11-27 13:47:48
|
Update of /cvsroot/jedidotnet/main/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2279/main/run Modified Files: Jedi.Strings.pas Log Message: * Added exception throwing in StringUtils.TabSet ctor if defaultWidth parameter less than zero. * Added checks to deal with potential null reference of tabs parameter in StringUtils.TabSet ctor. Index: Jedi.Strings.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.Strings.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Jedi.Strings.pas 24 Nov 2004 10:31:41 -0000 1.1 --- Jedi.Strings.pas 27 Nov 2004 13:47:23 -0000 1.2 *************** *** 434,446 **** idx: Integer; begin inherited Create; ! FTabs := ArrayList.Create(&Array(tabs).Length); FDefaultWidth := defaultWidth; ! BeginUpdate; ! try ! for idx := 0 to High(tabs) do ! Add(tabs[idx]); ! finally ! EndUpdate; end; end; --- 434,454 ---- idx: Integer; begin + if defaultWidth < 0 then + raise ArgumentOutOfRangeException.Create('defaultWidth', defaultWidth, 'DefaultWidth must be zero or positive.'); inherited Create; ! if not Assigned(tabs) then ! FTabs := ArrayList.Create ! else ! FTabs := ArrayList.Create(&Array(tabs).Length); FDefaultWidth := defaultWidth; ! if Assigned(tabs) then ! begin ! BeginUpdate; ! try ! for idx := 0 to High(tabs) do ! Add(tabs[idx]); ! finally ! EndUpdate; ! end; end; end; |