[glibmm] gmmproc: Quote the property docs to avoid losing text after commas.



commit 3b643e509757fb2c15c55bd7a1d0707096fa4506
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Tue May 4 18:53:07 2010 -0400

    	gmmproc: Quote the property docs to avoid losing text after commas.
    
    	* tools/pm/Output.pm: Quote the property docs for the _PROPERTY_PROXY
    	macros by first changing the quotes, quoting the docs and then
    	changing the quotes back.  This avoids losing the contents after
    	possible commas in property docs.  (Using the standard m4 quotes
    	leaves trailing single quotes for some reason).
    
    	Fixes Bug #603930 (Jonatan Olofsson).

 ChangeLog          |   12 ++++++++++++
 tools/pm/Output.pm |   21 +++++++++++++++++----
 2 files changed, 29 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d569683..ee0ea2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-05-05  José Alburquerque  <jaalburqu svn gnome org>
+
+	gmmproc: Quote the property docs to avoid losing text after commas.
+
+	* tools/pm/Output.pm: Quote the property docs for the _PROPERTY_PROXY
+	macros by first changing the quotes, quoting the docs and then
+	changing the quotes back.  This avoids losing the contents after
+	possible commas in property docs.  (Using the standard m4 quotes
+	leaves trailing single quotes for some reason).
+
+	Fixes Bug #603930 (Jonatan Olofsson).
+	
 2010-05-03  Murray Cumming  <murrayc murrayc-x61>
 
 	Documentation: Add more links to main page, and mention giomm.
diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm
index 40a381f..ea59ef5 100644
--- a/tools/pm/Output.pm
+++ b/tools/pm/Output.pm
@@ -618,7 +618,14 @@ sub output_wrap_property($$$$$$)
     my $name_underscored = $name;
     $name_underscored =~ tr/-/_/;
 
-    my $str = sprintf("_PROPERTY_PROXY(%s,%s,%s,%s,%s)dnl\n",
+      # For the docs of the property (the final argument of the sprintf), the
+      # m4 quotes are changed, the new quotes are then used to quote the docs
+      # and then the quotes are changed back to the standard quotes.  This is
+      # done so that if there are commas in the docs, the contents after the
+      # docs are not lost (m4 thinks the contents after the comma is another
+      # agument to the macro).  Using the standard quotes leaves a trailing
+      # single quote for some undetermined reason.
+    my $str = sprintf("_PROPERTY_PROXY(%s,%s,%s,%s,changequote([,])[%s]changequote(`,'))dnl\n",
       $name,
       $name_underscored,
       $cpp_type,
@@ -631,7 +638,15 @@ sub output_wrap_property($$$$$$)
     # If the property is not already read-only, and the property can be read, then add a second const accessor for a read-only propertyproxy:
     if( ($proxy_suffix ne "_ReadOnly") && ($objProperty->get_readable()) )
     {
-      my $str = sprintf("_PROPERTY_PROXY(%s,%s,%s,%s,%s)dnl\n",
+
+      # For the docs of the property (the final argument of the sprintf), the
+      # m4 quotes are changed, the new quotes are then used to quote the docs
+      # and then the quotes are changed back to the standard quotes.  This is
+      # done so that if there are commas in the docs, the contents after the
+      # docs are not lost (m4 thinks the contents after the comma is another
+      # agument to the macro).  Using the standard quotes leaves a trailing
+      # single quote for some undetermined reason.
+      my $str = sprintf("_PROPERTY_PROXY(%s,%s,%s,%s,changequote([,])[%s]changequote(`,'))dnl\n",
         $name,
         $name_underscored,
         $cpp_type,
@@ -640,8 +655,6 @@ sub output_wrap_property($$$$$$)
       );
       $self->append($str);
     }
-
-    
   }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]