Logo Search packages:      
Sourcecode: calibre version File versions

def odf::odf2xhtml::ODF2XHTML::s_style_style (   self,
  tag,
  attrs 
)

Collect the formatting for the style.
    Styles have scope. The same name can be used for both paragraph and
    character styles Since CSS has no scope we use a prefix. (Not elegant)
    In ODF a style can have a parent, these parents can be chained.
    We may not have encountered the parent yet, but if we have, we resolve it.

Definition at line 878 of file odf2xhtml.py.

00878                                        :
        """ Collect the formatting for the style.
            Styles have scope. The same name can be used for both paragraph and
            character styles Since CSS has no scope we use a prefix. (Not elegant)
            In ODF a style can have a parent, these parents can be chained.
            We may not have encountered the parent yet, but if we have, we resolve it.
        """
        name = attrs[(STYLENS,'name')]
        name = name.replace(".","_")
        family = attrs[(STYLENS,'family')]
        htmlfamily = self.familymap.get(family,'unknown')
        sfamily = self.familyshort.get(family,'X')
        name = "%s%s-%s" % (self.autoprefix, sfamily, name)
        parent = attrs.get( (STYLENS,'parent-style-name') )
        self.currentstyle = special_styles.get(name,"."+name)
        self.stylestack.append(self.currentstyle)
        if not self.styledict.has_key(self.currentstyle):
            self.styledict[self.currentstyle] = {}

        self.styledict[self.currentstyle]['__style-family'] = htmlfamily

        # Then load the parent style if we find it
        if parent:
            parent = "%s-%s" % (sfamily, parent)
            parent = special_styles.get(parent, "."+parent)
            if self.styledict.has_key( parent ):
                styles = self.styledict[parent]
                for style, val in styles.items():
                    self.styledict[self.currentstyle][style] = val
            else:
                self.styledict[self.currentstyle]['__parent-style-name'] = parent

    def e_style_style(self, tag, attrs):


Generated by  Doxygen 1.6.0   Back to index