~ubuntu-branches/ubuntu/utopic/gramps/utopic

« back to all changes in this revision

Viewing changes to src/plugins/lib/libodfbackend.py

  • Committer: Package Import Robot
  • Author(s): James A. Treacy
  • Date: 2012-05-22 17:18:36 UTC
  • mfrom: (39.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120522171836-35fi62lp4w7jnrd7
Tags: 3.4.0-1
* New upstream version
* Updated desktop file. Closes: #667472

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
20
#
21
21
 
22
 
# $Id: libodfbackend.py 16210 2010-11-18 20:19:50Z bmcage $
 
22
# $Id: libodfbackend.py 18765 2012-01-24 16:00:11Z kulath $
23
23
 
24
24
"""File and File format management for the openoffice reports
25
25
"""
121
121
        """
122
122
        if tagtype not in self.SUPPORTED_MARKUP:
123
123
            return None
 
124
        # The ODF validator does not like spaces or hash in style-names. the
 
125
        # font name needs to have the spaces restored, we just hope that the
 
126
        # name did not have a hyphen in it originally. The colour is represented
 
127
        # without the leading hash, this can be replaced when used in the text-
 
128
        # property font colour
124
129
        if ( tagtype == DocBackend.FONTCOLOR ):
125
130
            return ('<text:span text:style-name=\"FontColor__%s__\">' % 
126
 
                                self.ESCAPE_FUNC()(value), 
 
131
                                value.replace("#", ""),
127
132
                    '</text:span>')
128
133
        elif ( tagtype == DocBackend.FONTFACE ):
129
 
            return ('<text:span text:style-name=\"FontFace__%s__\">' % 
130
 
                                self.ESCAPE_FUNC()(value), 
 
134
            return ('<text:span text:style-name=\"FontFace__%s__\">' %
 
135
                                self.ESCAPE_FUNC()(value).replace(" ", "-"),
131
136
                    '</text:span>')
132
137
        elif ( tagtype == DocBackend.FONTSIZE ):
133
 
            return ('<text:span text:style-name=\"FontSize__%s__\">' % 
134
 
                                self.ESCAPE_FUNC()(value), 
 
138
            return ('<text:span text:style-name=\"FontSize__%d__\">' % value,
135
139
                    '</text:span>')
136
140
        else: #elif ( tagtype == DocBackend.HIGHLIGHT ):
137
141
            return ('<text:span text:style-name=\"FontHighlight__%s__\">' % 
138
 
                                self.ESCAPE_FUNC()(value), 
 
142
                                value.replace("#", ""),
139
143
                    '</text:span>')
140
144
 
141
145
    def format_link(self, value):