Thanks, fixed.  I was following the current format, but you're right.

-Jason

Pino Toscano wrote:
> Alle 01:50, mercoledì 13 giugno 2007, Jason Kivlighn ha scritto:
>   
>>         PROP_VIEWER_PREFERENCES,
>>         PROP_PERMISSIONS,
>> +       PROP_METADATA,
>>  };
>>     
>
> Please avoid the comma after the definition of the last element of an enum.
> AFAIK it's not C/C++, only C99 (incompatible with C++) allows it.
> Though I can't find the exact reference at the moment.
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> poppler mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/poppler
>   

Index: glib/poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-document.cc,v
retrieving revision 1.42
diff -u -r1.42 poppler-document.cc
--- glib/poppler-document.cc	25 Apr 2007 19:59:10 -0000	1.42
+++ glib/poppler-document.cc	13 Jun 2007 18:47:35 -0000
@@ -50,6 +50,7 @@
 	PROP_PAGE_MODE,
 	PROP_VIEWER_PREFERENCES,
 	PROP_PERMISSIONS,
+	PROP_METADATA
 };
 
 typedef struct _PopplerDocumentClass PopplerDocumentClass;
@@ -691,6 +692,17 @@
 	flag |= POPPLER_PERMISSIONS_OK_TO_ADD_NOTES;
       g_value_set_flags (value, flag);
       break;
+    case PROP_METADATA:
+      catalog = document->doc->getCatalog ();
+      if (catalog && catalog->isOk ())
+	{
+	  GooString *s = catalog->readMetadata ();
+	  if ( s != NULL ) {
+	  	g_value_set_string (value, s->getCString());
+	  	delete s;
+	  }
+	}
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -833,6 +845,15 @@
 			       POPPLER_TYPE_PERMISSIONS,
 			       POPPLER_PERMISSIONS_FULL,
 			       G_PARAM_READABLE));
+
+  g_object_class_install_property
+	  (G_OBJECT_CLASS (klass),
+	   PROP_METADATA,
+	   g_param_spec_string ("metadata",
+				"XML Metadata",
+				"Embedded XML metadata",
+				NULL,
+				G_PARAM_READABLE));
 }
 
 static void
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to