summaryrefslogtreecommitdiff
path: root/docview/src/frm_main.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-25 15:09:18 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-25 15:09:18 +0200
commitcf1428f68037b818cce655ddc9b76ab33d0441e1 (patch)
tree5835a6df8b3256910251221e7ac9e94da90dcbb5 /docview/src/frm_main.pas
parent695e46e5bf96e49bcdda2c5fac43282a137c8d1d (diff)
downloadfpGUI-cf1428f68037b818cce655ddc9b76ab33d0441e1.tar.xz
docview: Added some extra error checking code to prevent exception errors.
Diffstat (limited to 'docview/src/frm_main.pas')
-rw-r--r--docview/src/frm_main.pas11
1 files changed, 10 insertions, 1 deletions
diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas
index a6e8a8b6..a7a4d8cc 100644
--- a/docview/src/frm_main.pas
+++ b/docview/src/frm_main.pas
@@ -881,7 +881,8 @@ begin
// the "no results" place holder
exit;
Topic := lbSearchResults.Items.Objects[lbSearchResults.FocusItem] as TTopic;
- DisplayTopic( Topic );
+ if Topic <> nil then
+ DisplayTopic(Topic);
end;
procedure TMainForm.NavigateToHistoryIndex(AIndex: integer);
@@ -1802,8 +1803,16 @@ begin
//writeln('-----------------------------');
RichView.AddText(PChar(lText));
+ if CurrentTopic.ShowInContents then
+ begin
tvContents.Selection := tvContents.RootNode.FindSubNode(CurrentTopic, True);
tvContents.Invalidate;
+ end
+ else
+ begin
+ tvContents.Selection := nil;
+ tvContents.Invalidate;
+ end;
SaveNavigatePoint;
UpdateLocationPanel;
end;