From 420db2513f558083f9b8c35315d7708b8a3700d8 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 1 Dec 2008 09:22:32 +0000 Subject: [PATCH 1/3] patch by: Matthias Clasen * gtkdoc-mkdb.in: Fix index-id generation for child and style properties. Fixes #562064. svn path=/trunk/; revision=621 (cherry picked from commit 455a93571bf807f0a273c57fda81bb4956e4bcca) --- ChangeLog | 7 +++++++ gtkdoc-mkdb.in | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b315ad5..63fa517 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-12-01 Stefan Kost + + patch by: Matthias Clasen + + * gtkdoc-mkdb.in: + Fix index-id generation for child and style properties. Fixes #562064. + 2008-11-16 Stefan Kost * HACKING: diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in index fa67316..bd2f465 100755 --- a/gtkdoc-mkdb.in +++ b/gtkdoc-mkdb.in @@ -311,6 +311,13 @@ for my $dir (@SOURCE_DIRS) { &ReadSourceDocumentation ($dir); } +# FIXME: can we scan for a common prefix? +# DEBUG +# check $Declarations{$key} to first '_', we would need to count +#my %prefixes = map { m/^(.*?)\_.*/;uc($1) => 1 } grep { m/\_/ } keys (%Declarations); +#foreach (keys %prefixes) { print "$_\n"; } +# DEBUG + my $changed = &OutputSGML ("$ROOT_DIR/$MODULE-sections.txt"); # If any of the DocBook SGML files have changed, update the timestamp file (so @@ -823,15 +830,15 @@ sub OutputIndex { $short_symbol = $symbol; } - my $xref = &MakeXRef ($symbol); my $curletter = uc(substr($short_symbol,0,1)); my $id = $apiindex{$symbol}; - + my $xref = &MakeXRef ($id, $symbol); + #print " add symbol $symbol with $id to index in section $curletter\n"; if ($curletter ne $lastletter) { $lastletter = $curletter; - + if ($divopen == 1) { print (OUTPUT "\n"); } @@ -2122,12 +2129,11 @@ EOF sub CreateValidSGMLID { my ($id) = $_[0]; - # Append ":CAPS" to all all-caps identifiers - # Special case, '_' would end up as '' so we use 'gettext-macro' instead. if ($id eq "_") { return "gettext-macro"; } - if ($id !~ /[a-z]/) { $id .= ":CAPS" }; + # Append ":CAPS" to all all-caps identifiers + if ($id !~ /[a-z]/ && $id !~ /-CAPS$/) { $id .= ":CAPS" }; $id =~ s/[_ ]/-/g; $id =~ s/[,\.]//g; -- 1.6.1.3