* Add context info to unresolved links, for better error info

git-svn-id: trunk@23471 -
This commit is contained in:
michael 2013-01-21 10:55:00 +00:00
parent 5783f6d172
commit 1c9ad777d3

View File

@ -47,7 +47,7 @@ resourcestring
SErrDescrTagUnknown = 'Warning: Unknown tag "%s" in description'; SErrDescrTagUnknown = 'Warning: Unknown tag "%s" in description';
SErrUnknownEntityReference = 'Warning: Unknown entity reference "&%s;" found'; SErrUnknownEntityReference = 'Warning: Unknown entity reference "&%s;" found';
SErrUnknownLinkID = 'Warning: Target ID of <link> in unit "%s" is unknown: "%s"'; SErrUnknownLinkID = 'Warning: Target ID of <link> in unit "%s", element "%s", is unknown: "%s"';
SErrUnknownPrintShortID = 'Warning: Target ID of <printshort> is unknown: "%s"'; SErrUnknownPrintShortID = 'Warning: Target ID of <printshort> is unknown: "%s"';
SErrUnknownLink = 'Could not resolve link to "%s"'; SErrUnknownLink = 'Could not resolve link to "%s"';
SErralreadyRegistered = 'Class for output format "%s" already registered'; SErralreadyRegistered = 'Class for output format "%s" already registered';
@ -75,6 +75,7 @@ type
FEmitNotes: Boolean; FEmitNotes: Boolean;
FEngine : TFPDocEngine; FEngine : TFPDocEngine;
FPackage : TPasPackage; FPackage : TPasPackage;
FContext : TPasElement;
FTopics : TList; FTopics : TList;
FImgExt : String; FImgExt : String;
FBeforeEmitNote : TWriterNoteEvent; FBeforeEmitNote : TWriterNoteEvent;
@ -159,6 +160,7 @@ type
procedure DescrEndTableRow; virtual; abstract; procedure DescrEndTableRow; virtual; abstract;
procedure DescrBeginTableCell; virtual; abstract; procedure DescrBeginTableCell; virtual; abstract;
procedure DescrEndTableCell; virtual; abstract; procedure DescrEndTableCell; virtual; abstract;
Property CurrentContext : TPasElement Read FContext ;
public public
Constructor Create(APackage: TPasPackage; AEngine: TFPDocEngine); virtual; Constructor Create(APackage: TPasPackage; AEngine: TFPDocEngine); virtual;
destructor Destroy; override; destructor Destroy; override;
@ -491,7 +493,8 @@ begin
Result := False; Result := False;
if not Assigned(El) then if not Assigned(El) then
exit; exit;
FContext:=AContext;
try
Node := El.FirstChild; Node := El.FirstChild;
while Assigned(Node) do while Assigned(Node) do
begin begin
@ -505,6 +508,9 @@ begin
Node := Node.NextSibling; Node := Node.NextSibling;
end; end;
Result := True; Result := True;
finally
FContext:=Nil;
end;
end; end;
function TFPDocWriter.ConvertNotes(AContext: TPasElement; El: TDOMElement function TFPDocWriter.ConvertNotes(AContext: TPasElement; El: TDOMElement
@ -732,6 +738,8 @@ var
Node, Child: TDOMNode; Node, Child: TDOMNode;
ParaCreated: Boolean; ParaCreated: Boolean;
begin begin
FContext:=AContext;
try
if AutoInsertBlock then if AutoInsertBlock then
if IsExtShort(El.FirstChild) then if IsExtShort(El.FirstChild) then
DescrBeginParagraph DescrBeginParagraph
@ -779,6 +787,9 @@ begin
end else end else
if AutoInsertBlock then if AutoInsertBlock then
DescrEndParagraph; DescrEndParagraph;
finally
FContext:=Nil;
end;
end; end;
procedure TFPDocWriter.ConvertExtShortOrNonSectionBlocks(AContext: TPasElement; procedure TFPDocWriter.ConvertExtShortOrNonSectionBlocks(AContext: TPasElement;