Menu

Commit [r2058]  Maximize  Restore  History

Changed code that displays snippet names to use snippet display names instead.

delphidabbler 2012-07-14

changed /trunk/Src/FmDependenciesDlg.pas
changed /trunk/Src/FrSelectSnippetsBase.pas
changed /trunk/Src/UDetailPageHTML.pas
changed /trunk/Src/UHTMLDetailUtils.pas
changed /trunk/Src/USnippetHTML.pas
changed /trunk/Src/UView.pas
/trunk/Src/FmDependenciesDlg.pas Diff Switch to side-by-side view
--- a/trunk/Src/FmDependenciesDlg.pas
+++ b/trunk/Src/FmDependenciesDlg.pas
@@ -178,7 +178,9 @@
   for RequiredSnippet in DependsList do
   begin
     // Add node for snippet from dependency list
-    ChildNode := tvDependencies.Items.AddChild(Parent, RequiredSnippet.Name);
+    ChildNode := tvDependencies.Items.AddChild(
+      Parent, RequiredSnippet.DisplayName
+    );
     ChildNode.Data := RequiredSnippet;  // reference to associated snippet
     // Check for circular reference. If detetected display warning otherwise
     // recursively add child nodes for snippet's dependency list
@@ -356,6 +358,7 @@
 var
   Dependents: ISnippetIDList;
   SnippetID: TSnippetID;
+  Snippet: TSnippet;
 begin
   Dependents := (Database as IDatabaseEdit).GetDependents(
     Database.Snippets.Find(fSnippetID)
@@ -366,9 +369,14 @@
     if tiRequiredBy in fTabs then
     begin
       for SnippetID in Dependents do
+      begin
+        Snippet := Database.Snippets.Find(SnippetID);
+        Assert(Assigned(Snippet),
+          ClassName + '.PopulateRequiredByList: Snippet id not found');
         lbDependents.Items.AddObject(
-          SnippetID.Name, TBox<Boolean>.Create(SnippetID.UserDefined)
+          Snippet.DisplayName, TBox<Boolean>.Create(Snippet.UserDefined)
         );
+      end;
     end;
   finally
     lbDependents.Items.EndUpdate;
/trunk/Src/FrSelectSnippetsBase.pas Diff Switch to side-by-side view
--- a/trunk/Src/FrSelectSnippetsBase.pas
+++ b/trunk/Src/FrSelectSnippetsBase.pas
@@ -24,7 +24,7 @@
  * The Initial Developer of the Original Code is Peter Johnson
  * (http://www.delphidabbler.com/).
  *
- * Portions created by the Initial Developer are Copyright (C) 2009-2011 Peter
+ * Portions created by the Initial Developer are Copyright (C) 2009-2012 Peter
  * Johnson. All Rights Reserved.
  *
  * Contributor(s)
@@ -173,7 +173,7 @@
       CatNode := AddNode(nil, Group.Title, Cat);
       for Snippet in Group.SnippetList do
         if CanAddSnippetNode(Snippet) then
-          AddNode(CatNode, Snippet.Name, Snippet);
+          AddNode(CatNode, Snippet.DisplayName, Snippet);
     end;
   finally
     FreeAndNil(Grouping);
/trunk/Src/UDetailPageHTML.pas Diff Switch to side-by-side view
--- a/trunk/Src/UDetailPageHTML.pas
+++ b/trunk/Src/UDetailPageHTML.pas
@@ -502,7 +502,9 @@
     Result := MakeCompoundTag(
       'tr',
       MakeCompoundTag(
-        'td', NameCellAttrs, SnippetALink(Snippet.Name, Snippet.UserDefined)
+        'td',
+        NameCellAttrs,
+        SnippetALink(Snippet.Name, Snippet.DisplayName, Snippet.UserDefined)
       )
       + MakeCompoundTag('td', DescCellAttrs, SnippetHTML.Description)
     );
/trunk/Src/UHTMLDetailUtils.pas Diff Switch to side-by-side view
Loading...
/trunk/Src/USnippetHTML.pas Diff Switch to side-by-side view
Loading...
/trunk/Src/UView.pas Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.