Index: oup/current/Helper/WhatLinksHere.dfm
===================================================================
--- oup/current/Helper/WhatLinksHere.dfm	(revision 113)
+++ oup/current/Helper/WhatLinksHere.dfm	(revision 114)
@@ -4,7 +4,9 @@
   BorderStyle = bsSizeToolWin
   Caption = 'What links here?'
-  ClientHeight = 296
-  ClientWidth = 421
+  ClientHeight = 232
+  ClientWidth = 404
   Color = clBtnFace
+  Constraints.MinHeight = 232
+  Constraints.MinWidth = 275
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
@@ -17,34 +19,106 @@
   PixelsPerInch = 96
   TextHeight = 13
-  object label_what: TLabel
-    AlignWithMargins = True
-    Left = 3
-    Top = 3
-    Width = 415
-    Height = 16
+  object Splitter1: TSplitter
+    Left = 0
+    Top = 100
+    Width = 404
+    Height = 8
+    Cursor = crVSplit
     Align = alTop
-    AutoSize = False
-    Caption = 'What links to:'
-    Font.Charset = DEFAULT_CHARSET
-    Font.Color = clWindowText
-    Font.Height = -11
-    Font.Name = 'Tahoma'
-    Font.Style = [fsBold]
-    ParentFont = False
+    AutoSnap = False
+    Beveled = True
+    MinSize = 100
+    ExplicitTop = 171
+    ExplicitWidth = 655
   end
-  object list: TListBox
-    AlignWithMargins = True
-    Left = 3
-    Top = 25
-    Width = 415
-    Height = 268
+  object Panel1: TPanel
+    Left = 0
+    Top = 0
+    Width = 404
+    Height = 100
+    Align = alTop
+    BevelOuter = bvNone
+    TabOrder = 0
+    ExplicitWidth = 267
+    object label_what: TLabel
+      AlignWithMargins = True
+      Left = 3
+      Top = 3
+      Width = 398
+      Height = 16
+      Align = alTop
+      AutoSize = False
+      Caption = 'What links to:'
+      Font.Charset = DEFAULT_CHARSET
+      Font.Color = clWindowText
+      Font.Height = -11
+      Font.Name = 'Tahoma'
+      Font.Style = [fsBold]
+      ParentFont = False
+      ExplicitLeft = 10
+      ExplicitTop = 11
+      ExplicitWidth = 415
+    end
+    object list_from: TListBox
+      AlignWithMargins = True
+      Left = 3
+      Top = 25
+      Width = 398
+      Height = 72
+      Align = alClient
+      ItemHeight = 13
+      TabOrder = 0
+      OnDblClick = list_fromDblClick
+      ExplicitLeft = 38
+      ExplicitTop = 65
+      ExplicitWidth = 415
+      ExplicitHeight = 84
+    end
+  end
+  object Panel2: TPanel
+    Left = 0
+    Top = 108
+    Width = 404
+    Height = 124
     Align = alClient
-    ItemHeight = 13
-    TabOrder = 0
-    OnDblClick = listDblClick
-    ExplicitLeft = 4
-    ExplicitTop = 52
-    ExplicitWidth = 414
-    ExplicitHeight = 237
+    BevelOuter = bvNone
+    TabOrder = 1
+    ExplicitLeft = 28
+    ExplicitTop = 212
+    ExplicitWidth = 337
+    ExplicitHeight = 169
+    object label_to: TLabel
+      AlignWithMargins = True
+      Left = 3
+      Top = 3
+      Width = 398
+      Height = 16
+      Align = alTop
+      AutoSize = False
+      Caption = 'File links to:'
+      Font.Charset = DEFAULT_CHARSET
+      Font.Color = clWindowText
+      Font.Height = -11
+      Font.Name = 'Tahoma'
+      Font.Style = [fsBold]
+      ParentFont = False
+      ExplicitLeft = 6
+      ExplicitWidth = 179
+    end
+    object list_to: TListBox
+      AlignWithMargins = True
+      Left = 3
+      Top = 25
+      Width = 398
+      Height = 96
+      Align = alClient
+      ItemHeight = 13
+      TabOrder = 0
+      OnDblClick = list_fromDblClick
+      ExplicitLeft = -230
+      ExplicitTop = -43
+      ExplicitWidth = 415
+      ExplicitHeight = 84
+    end
   end
 end
Index: oup/current/Helper/WhatLinksHere.pas
===================================================================
--- oup/current/Helper/WhatLinksHere.pas	(revision 113)
+++ oup/current/Helper/WhatLinksHere.pas	(revision 114)
@@ -3,13 +3,18 @@
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, StdCtrls, Template;
+  Dialogs, StdCtrls, Template, ExtCtrls;
 
 type
   TForm_WhatLinksHere = class(TForm)
-    list: TListBox;
+    Panel1: TPanel;
+    list_from: TListBox;
     label_what: TLabel;
+    Panel2: TPanel;
+    label_to: TLabel;
+    list_to: TListBox;
+    Splitter1: TSplitter;
     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     procedure FormShow(Sender: TObject);
-    procedure listDblClick(Sender: TObject);
+    procedure list_fromDblClick(Sender: TObject);
   private
   public
@@ -42,25 +47,50 @@
   i: Integer;
   fullname: String;
+  links_to: TDatLinkList;
 begin
   Form_Main.Enabled := False;
-  list.Items.Clear;
+  list_from.Items.Clear;
+  list_to.Items.Clear;
   fileinfo := ConManager.Connection[ConID].GetFileInfo(FileID);
   label_what.Caption := FormatNumber(fileinfo.ID, 5, '0') + '-' +
       fileinfo.Name + '.' + fileinfo.Extension;
-  links := TAccess_OUP_ADB(ConManager.Connection[ConID]).GetLinksToFile(fileinfo.ID);
-  if Length(links.ByID) > 0 then
-    for i := 0 to High(links.ByID) do
+  links_to := ConManager.Connection[ConID].GetDatLinks(fileinfo.ID);
+  if ConManager.Connection[ConID] is TAccess_OUP_ADB then begin
+    links := TAccess_OUP_ADB(ConManager.Connection[ConID]).GetLinksToFile(fileinfo.ID);
+    if Length(links.ByID) > 0 then
+      for i := 0 to High(links.ByID) do
+      begin
+        fileinfo := ConManager.Connection[ConID].GetFileInfo(links.ByID[i].Destination);
+        fullname := FormatNumber(fileinfo.ID, 5, '0') + '-' + fileinfo.Name + '.' + fileinfo.Extension;
+        list_from.Items.Add(fullname + ' (Offset 0x' + IntToHex(links.ByID[i].SrcOffset, 8) + ')');
+      end;
+  end;
+  if Length(links_to) > 0 then
+  begin
+    for i := 0 to High(links_to) do
     begin
-      fileinfo := ConManager.Connection[ConID].GetFileInfo(links.ByID[i].Destination);
-      fullname := FormatNumber(fileinfo.ID, 5, '0') + '-' + fileinfo.Name + '.' + fileinfo.Extension;
-      list.Items.Add(fullname + ' (Offset 0x' + IntToHex(links.ByID[i].SrcOffset, 8) + ')');
+      if links_to[i].DestID >= 0 then
+      begin
+        fileinfo := ConManager.Connection[ConID].GetFileInfo(links_to[i].DestID);
+        fullname := FormatNumber(fileinfo.ID, 5, '0') + '-' + fileinfo.Name + '.' + fileinfo.Extension;
+      end else
+        fullname := 'no link';
+      list_to.Items.Add(fullname + ' (Offset 0x' + IntToHex(links_to[i].SrcOffset, 8) + ')');
     end;
+  end;
 end;
 
-procedure TForm_WhatLinksHere.listDblClick(Sender: TObject);
+procedure TForm_WhatLinksHere.list_fromDblClick(Sender: TObject);
 var
   id: Integer;
+  box: TListBox;
+  name: String;
 begin
-  id := ConManager.Connection[ConID].ExtractFileIDOfName(list.Items.Strings[list.ItemIndex]);
+  box := TListBox(Sender);
+  name := box.Items.Strings[box.ItemIndex];
+  if Pos('no link', name) > 0 then
+    Exit
+  else
+    id := ConManager.Connection[ConID].ExtractFileIDOfName(name);
   SenderForm.SelectFileID(ConID, id);
   Form_Main.Enabled := True;
