summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-11-15 22:33:02 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-11-15 22:33:02 +0000
commite8a00a4784c157eb10e876c29200077eb8600f26 (patch)
treed985a505e85a9bfd24427db7acebb2cacecbbe60
parentf617f08b03894142ffaab097150c7c49d2adbde2 (diff)
downloadfpc-e8a00a4784c157eb10e876c29200077eb8600f26.tar.gz
Merged revisions 11884,11979,12035,12054,12056,12060,12066 via svnmerge from
svn+ssh://marco@svn.freepascal.org/FPC/svn/fpc/trunk ........ r11884 | marco | 2008-10-12 12:02:18 +0200 (Sun, 12 Oct 2008) | 2 lines * avoid double free when reusing chmsitemap objects ........ r11979 | marco | 2008-10-26 23:15:47 +0100 (Sun, 26 Oct 2008) | 2 lines * removed some 1.0 defines ........ r12035 | marco | 2008-11-08 14:58:46 +0100 (Sat, 08 Nov 2008) | 2 lines * splitting of long lines when copying a TStringlist to a dos (shortstring) eq. ........ r12054 | marco | 2008-11-12 18:38:18 +0100 (Wed, 12 Nov 2008) | 2 lines * fix for win32 chm use. ........ r12056 | marco | 2008-11-12 18:53:13 +0100 (Wed, 12 Nov 2008) | 2 lines * Fixing result, no mode Delphi. ........ r12060 | marco | 2008-11-12 21:16:59 +0100 (Wed, 12 Nov 2008) | 1 line * fixed another whtmlhlp ........ r12066 | marco | 2008-11-13 09:53:50 +0100 (Thu, 13 Nov 2008) | 1 line * fix for 12619, security_descriptor_min_length now a sizeof as in the winsdk headers. (win64) ........ git-svn-id: http://svn.freepascal.org/svn/fpc/branches/fixes_2_2@12116 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--ide/globdir.inc2
-rw-r--r--ide/wchmhwrap.pas45
-rw-r--r--ide/whtmlhlp.pas19
-rw-r--r--packages/chm/src/chmsitemap.pas5
-rw-r--r--packages/fv/src/drivers.pas12
-rw-r--r--packages/fv/src/unixsmsg.inc12
-rw-r--r--rtl/win/wininc/defines.inc25
-rw-r--r--rtl/win/wininc/struct.inc3
8 files changed, 79 insertions, 44 deletions
diff --git a/ide/globdir.inc b/ide/globdir.inc
index c3b060ba36..fb8f2d4d19 100644
--- a/ide/globdir.inc
+++ b/ide/globdir.inc
@@ -129,10 +129,8 @@
{$define HASOUTLINE}
{ Use inlining for small functions }
-{$ifndef VER1_0}
{$inline on}
{.$define USEINLINE}
-{$endif}
{$define TEST_PARTIAL_SYNTAX}
{ $ undef UNDO}
diff --git a/ide/wchmhwrap.pas b/ide/wchmhwrap.pas
index fc3a77ea75..91a78a2b41 100644
--- a/ide/wchmhwrap.pas
+++ b/ide/wchmhwrap.pas
@@ -144,6 +144,44 @@ begin
result:=true;
end;
+procedure splitline(idestream:PMemoryTextFile;s:ansistring);
+
+function scanvalue:integer; // searches for a possible breaking point left of char 255.
+var n,i : integer;
+ lastpoint:integer;
+ inquote : boolean;
+begin
+ lastpoint:=-1;
+ n:=length(s);
+ if n>250 then n:=250;
+ i:=1; inquote:=false;
+ while (i<=n) do
+ begin
+ while (s[i]<>' ') and (s[i]<>'"') and (i<=n) do inc(i);
+ if (s[i]=' ') and not inquote then lastpoint:=i;
+ if (s[i]='"') then inquote:=not inquote;
+ inc(i);
+ end;
+ scanvalue:=lastpoint;
+end;
+
+var position : longint;
+
+begin
+ position:=0;
+ while (length(s)>250) and (position<>-1) do
+ begin
+ position:=scanvalue;
+ if position<>-1 then
+ begin
+ idestream.addline(copy(s,1,position-1));
+ delete(s,1,position);
+ end;
+ end;
+ if length(s)<>0 then
+ idestream.addline(s);
+end;
+
function TChmWrapper.GetTopic(name:string):PMemoryTextFile;
var
@@ -170,7 +208,12 @@ begin
linedata.loadfromstream(m);
result:=new(PMemoryTextFile,Init);
for i:=0 to linedata.count-1 do
- result.addline(linedata[i]);
+ begin
+ if length(linedata[i])>250 Then
+ splitline(result,linedata[i])
+ else
+ result.addline(linedata[i]);
+ end;
finally
m.free;
linedata.free;
diff --git a/ide/whtmlhlp.pas b/ide/whtmlhlp.pas
index 8efb76a091..7daa638d22 100644
--- a/ide/whtmlhlp.pas
+++ b/ide/whtmlhlp.pas
@@ -159,6 +159,7 @@ type
function GetTopicInfo(T: PTopic) : string; virtual;
function SearchTopic(HelpCtx: THelpCtx): PTopic; virtual;
function ReadTopic(T: PTopic): boolean; virtual;
+ function FormatLink(const s:String):string; virtual;
private
DefaultFileName: string;
CurFileName: string;
@@ -183,6 +184,7 @@ type
function ReadTopic(T: PTopic): boolean; virtual;
function GetTopicInfo(T: PTopic) : string; virtual;
function SearchTopic(HelpCtx: THelpCtx): PTopic; virtual;
+ function FormatLink(const s:String):string; virtual;
private
Chmw: TCHMWrapper;
end;
@@ -1362,6 +1364,11 @@ begin
SearchTopic:=P;
end;
+function TCustomHTMLHelpFile.FormatLink(const s:String):string;
+begin
+ formatlink:=formatpath(s);
+end;
+
function TCustomHTMLHelpFile.GetTopicInfo(T: PTopic) : string;
var OK: boolean;
Name: string;
@@ -1384,7 +1391,7 @@ begin
DebugMessageS({$i %file%},'(Topicinfo) Link before formatpath "'+link+'"',{$i %line%},'1',0,0);
{$ENDIF WDEBUG}
- Link:=FormatPath(Link);
+ Link:=FormatLink(Link);
{$IFDEF WDEBUG}
DebugMessageS({$i %file%},'(Topicinfo) Link after formatpath "'+link+'"',{$i %line%},'1',0,0);
{$ENDIF WDEBUG}
@@ -1598,6 +1605,12 @@ begin
loadindex:=chmw.loadindex(id,TopicLinks,IndexEntries,helpfacility);
end;
+function TCHMHelpFile.FormatLink(const s:String):string;
+// do not reformat for chms, we assume them internally consistent.
+begin
+ formatlink:=s;
+end;
+
function TChmHelpFile.SearchTopic(HelpCtx: THelpCtx): PTopic;
function MatchCtx(P: PTopic): boolean;
begin
@@ -1683,9 +1696,9 @@ begin
{$IFDEF WDEBUG}
DebugMessageS({$i %file%},' Looking for "'+Link+'"',{$i %line%},'1',0,0);
{$endif WDEBUG}
- Link:=FormatPath(Link);
+ Link:=FormatLink(Link);
{$IFDEF WDEBUG}
- DebugMessageS({$i %file%},' Looking for (after formatpath) "'+Link+'"',{$i %line%},'1',0,0);
+ DebugMessageS({$i %file%},' Looking for (after formatlink) "'+Link+'"',{$i %line%},'1',0,0);
{$endif WDEBUG}
P:=Pos('#',Link);
if P>0 then
diff --git a/packages/chm/src/chmsitemap.pas b/packages/chm/src/chmsitemap.pas
index 85a4a03073..886dfc546b 100644
--- a/packages/chm/src/chmsitemap.pas
+++ b/packages/chm/src/chmsitemap.pas
@@ -277,6 +277,7 @@ begin
FSiteMapType := AType;
FSiteMapTags := [smtNone];
FSiteMapBodyTags := [smbtNone];
+ FHTMLParser:=nil;
FItems := TChmSiteMapItems.Create(Self, nil); ;
end;
@@ -302,7 +303,7 @@ begin
FHTMLParser.OnFoundTag := @FoundTag;
FHTMLParser.OnFoundText := @FoundText;
FHTMLParser.Exec;
- FHTMLParser.Free;
+ FreeAndNil(FHTMLParser);
end;
procedure TChmSiteMap.LoadFromStream(AStream: TStream);
@@ -316,7 +317,7 @@ begin
FHTMLParser.OnFoundTag := @FoundTag;
FHTMLParser.OnFoundText := @FoundText;
FHTMLParser.Exec;
- FHTMLParser.Free;
+ FreeAndNil(FHTMLParser);
end;
end;
diff --git a/packages/fv/src/drivers.pas b/packages/fv/src/drivers.pas
index 4a385b4d43..ee9673f3c4 100644
--- a/packages/fv/src/drivers.pas
+++ b/packages/fv/src/drivers.pas
@@ -83,11 +83,7 @@ USES
{$ENDIF}
{$IFDEF OS_UNIX}
- {$ifdef VER1_0}
- linux,
- {$else}
baseunix,unix,
- {$endif}
{$ENDIF}
{$IFDEF OS_NETWARE_LIBC}
@@ -733,14 +729,8 @@ Function GetDosTicks:longint; { returns ticks at 18.2 Hz, just like DOS }
tv : TimeVal;
{ tz : TimeZone;}
begin
- {$ifdef ver1_0}
- GetTimeOfDay(tv{,tz});
- GetDosTicks:=((tv.Sec mod 86400) div 60)*1092+((tv.Sec mod 60)*1000000+tv.USec) div 54945;
- {$else}
FPGetTimeOfDay(@tv,nil{,tz});
GetDosTicks:=((tv.tv_Sec mod 86400) div 60)*1092+((tv.tv_Sec mod 60)*1000000+tv.tv_USec) div 54945;
-
- {$endif}
end;
{$ENDIF OS_UNIX}
{$IFDEF OS_WINDOWS}
@@ -784,7 +774,7 @@ end;
begin
req.tv_sec:=0;
req.tv_nsec:=10000000;{ 10 ms }
- {$ifdef ver1_0}nanosleep(req,rem){$else}fpnanosleep(@req,@rem){$endif};
+ fpnanosleep(@req,@rem);
end;
{$ENDIF}
{$IFDEF OS_OS2}
diff --git a/packages/fv/src/unixsmsg.inc b/packages/fv/src/unixsmsg.inc
index 7872ebafe8..f40f9d97a0 100644
--- a/packages/fv/src/unixsmsg.inc
+++ b/packages/fv/src/unixsmsg.inc
@@ -24,11 +24,7 @@
it should use ioctl to get information about resizing of windows }
uses
-{$ifdef VER1_0}
- linux;
-{$else}
BaseUnix,termio;
-{$endif}
Const
SystemEventActive : Boolean = false;
@@ -48,11 +44,7 @@ begin
PendingSystemEvents:=0;
FillChar(LastSystemEvent,sizeof(TSystemEvent),0);
FillChar(WinSize,sizeof(WinSize),0);
-{$ifdef VER1_0}
- ioctl(stdinputhandle,TIOCGWINSZ,@winsize);
-{$else}
fpioctl(stdinputhandle,TIOCGWINSZ,@winsize);
-{$endif}
LastXSize:=WinSize.ws_row;
LastYSize:=WinSize.ws_col;
If LastXSize=0 then
@@ -103,11 +95,7 @@ begin
else
begin
FillChar(WinSize,sizeof(WinSize),0);
-{$ifdef VER1_0}
- ioctl(stdinputhandle,TIOCGWINSZ,@winsize);
-{$else}
fpioctl(stdinputhandle,TIOCGWINSZ,@winsize);
-{$endif}
if (winsize.ws_col<>0) and (winsize.ws_row<>0) and
((winsize.ws_row<>lastxsize) or (winsize.ws_col<>lastysize)) then
begin
diff --git a/rtl/win/wininc/defines.inc b/rtl/win/wininc/defines.inc
index e3f03d733f..c474e6a22b 100644
--- a/rtl/win/wininc/defines.inc
+++ b/rtl/win/wininc/defines.inc
@@ -893,7 +893,7 @@
DC_EXTRA = 9;
DC_FIELDS = 1;
DC_FILEDEPENDENCIES = 14;
-
+
DC_MAXEXTENT = 5;
DC_MINEXTENT = 4;
DC_ORIENTATION = 17;
@@ -1136,7 +1136,7 @@
{ EnumCalendarInfo }
ENUM_ALL_CALENDARS = dword(-1);
ENUM_CURRENT_SETTINGS = dword(-1);
- ENUM_REGISTRY_SETTINGS = dword(-2);
+ ENUM_REGISTRY_SETTINGS = dword(-2);
{ EnumDateFormats }
DATE_SHORTDATE = 1;
DATE_LONGDATE = 2;
@@ -2539,7 +2539,7 @@ Type
OCR_SIZEWE = 32644;
OCR_SIZENS = 32645;
OCR_SIZEALL = 32646;
- OCR_ICOCUR = 32647; // OBSOLETE: use OIC_WINLOGO
+ OCR_ICOCUR = 32647; // OBSOLETE: use OIC_WINLOGO
OCR_NO = 32648;
OCR_APPSTARTING = 32650;
OCR_HAND = 32649;
@@ -4347,7 +4347,6 @@ Type
FAILED_ACCESS_ACE_FLAG = $80;
{ SECURITY_DESCRIPTOR_CONTROL }
{SECURITY_DESCRIPTOR_REVISION = 1;already defined above }
- SECURITY_DESCRIPTOR_MIN_LENGTH = 20;
SE_OWNER_DEFAULTED = 1;
SE_GROUP_DEFAULTED = 2;
SE_DACL_PRESENT = 4;
@@ -4361,11 +4360,11 @@ Type
SE_PRIVILEGE_USED_FOR_ACCESS = $80000000;
PRIVILEGE_SET_ALL_NECESSARY = $1;
{ OPENFILENAME structure }
-
-
+
+
OFN_READONLY = $1;
OFN_OVERWRITEPROMPT = $2;
- OFN_HIDEREADONLY = $4;
+ OFN_HIDEREADONLY = $4;
OFN_NOCHANGEDIR = $8;
OFN_SHOWHELP = $10;
OFN_ENABLEHOOK = $20;
@@ -4382,19 +4381,19 @@ Type
OFN_NOTESTFILECREATE = $10000;
OFN_NONETWORKBUTTON = $20000;
OFN_NOLONGNAMES = $40000;
- OFN_EXPLORER = $80000;
+ OFN_EXPLORER = $80000;
OFN_NODEREFERENCELINKS = $100000;
OFN_LONGNAMES = $200000;
OFN_ENABLEINCLUDENOTIFY = $00400000;
OFN_ENABLESIZING = $00800000;
OFN_DONTADDTORECENT = $02000000;
- OFN_FORCESHOWHIDDEN = $10000000;
-
+ OFN_FORCESHOWHIDDEN = $10000000;
+
{ SHAREVISTRING message }
OFN_SHAREFALLTHROUGH = $2;
OFN_SHARENOWARN = $1;
OFN_SHAREWARN = 0;
-
+
OFN_EX_NOPLACESBAR = $00000001;
{ Open/Save notifications }
CDN_INITDONE = $fffffda7;
@@ -5627,8 +5626,8 @@ const
GA_ROOT = 2; { The window's root window }
GA_ROOTOWNER = 3; { The window's owner }
- AC_SRC_OVER = $00;
- AC_SRC_ALPHA = $01;
+ AC_SRC_OVER = $00;
+ AC_SRC_ALPHA = $01;
DMDO_DEFAULT = 0;
DMDO_90 = 1;
diff --git a/rtl/win/wininc/struct.inc b/rtl/win/wininc/struct.inc
index 6058adc303..831ea995e9 100644
--- a/rtl/win/wininc/struct.inc
+++ b/rtl/win/wininc/struct.inc
@@ -7421,6 +7421,9 @@ type
PGRADIENT_RECT = ^_GRADIENT_RECT;
LPGRADIENT_RECT = PGRADIENT_RECT;
+const
+ SECURITY_DESCRIPTOR_MIN_LENGTH = SIZEOF(SECURITY_DESCRIPTOR);
+
{$endif read_interface}