src/reportlab/pdfbase/pdfdoc.py
changeset 3226 cd06c1172678
parent 3198 683ca9eb6b18
child 3246 7087d203eb88
--- a/src/reportlab/pdfbase/pdfdoc.py	Mon Sep 21 15:09:15 2009 +0000
+++ b/src/reportlab/pdfbase/pdfdoc.py	Mon Sep 21 15:10:33 2009 +0000
@@ -319,11 +319,12 @@
         return PDFObjectReference(internalname)
 
     def addColor(self,cmyk):
-        name = PDFName(cmyk.spotName)[1:]
+        sname = cmyk.spotName
+        name = PDFName(sname)[1:]
         if name not in self.idToObject:
             sep = PDFSeparationCMYKColor(cmyk).value()  #PDFArray([/Separation /name /DeviceCMYK tint_tf])
             self.Reference(sep,name)
-        return name
+        return name,sname
 
     def setTitle(self, title):
         "embeds in PDF file"
@@ -1103,7 +1104,7 @@
     hasImages = 0
     compression = 0
     XObjects = None
-    _colorsUsed = []
+    _colorsUsed = {}
     Trans = None
     # transitionstring?
     # xobjects?
@@ -1860,8 +1861,8 @@
         self.Font = PDFObjectReference(BasicFonts)
 
     def setColorSpace(self,colorsUsed):
-        for c in colorsUsed:
-            self.ColorSpace[c] = PDFObjectReference(c)
+        for c,s in colorsUsed.iteritems():
+            self.ColorSpace[s] = PDFObjectReference(c)
 
     def format(self, document):
         D = {}