[CMF-checkins] CVS: CMF/CMFDefault - Document.py:1.55

Yvo Schubbe schubbe@web.de
Fri, 14 Mar 2003 11:38:46 -0500


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv25307/CMFDefault

Modified Files:
	Document.py 
Log Message:
Merged yuppie-collector140-branch:
-Fixed setFormat('text/plain'). (Collector #140)

=== CMF/CMFDefault/Document.py 1.54 => 1.55 ===
--- CMF/CMFDefault/Document.py:1.54	Thu Feb 13 03:35:28 2003
+++ CMF/CMFDefault/Document.py	Fri Mar 14 11:38:15 2003
@@ -10,7 +10,7 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##############################################################################
-""" Basic textual content object, supporting both HTML and STX.
+""" Basic textual content object, supporting HTML, STX and plain text.
 
 $Id$
 """
@@ -323,12 +323,16 @@
         else:
             return 'text/plain'
     
-
     security.declareProtected(ModifyPortalContent, 'setFormat')
     def setFormat(self, format):
+        """ Set text format and Dublin Core resource format.
+        """
         value = str(format)
         if value == 'text/html' or value == 'html':
             self.text_format = 'html'
+        elif value == 'text/plain':
+            if self.text_format not in ('structured-text', 'plain'):
+                self.text_format = 'structured-text'
         elif value == 'plain':
             self.text_format = 'plain'
         else: