'Ensure padding and text-indent properties are respected'

def process_block(self, tag, tag_css):

    text_properties = self.text_properties(tag_css)
    block_properties = self.block_properties(tag_css)
    indent = ((float(text_properties['parindent']) / 10) * (self.profile.dpi / 72.0))
    margin = float(block_properties['sidemargin'])
    if ((indent < 0) and ((margin + indent) < 0)):
        text_properties['parindent'] = int((((- margin) * (72.0 / self.profile.dpi)) * 10))
    align = self.get_alignment(tag_css)
    def fill_out_properties(props, default):
        for key in default.keys():
            if (not props.has_key(key)):
                props[key] = default[key]
    fill_out_properties(block_properties, self.book.defaultBlockStyle.attrs)
    fill_out_properties(text_properties, self.book.defaultTextStyle.attrs)
    def properties_different(dict1, dict2):
        for key in dict1.keys():
            if (dict1[key] != dict2[key]):
                return True
        return False
    if (properties_different(self.current_block.blockStyle.attrs, block_properties) or properties_different(self.current_block.textStyle.attrs, text_properties) or (align != self.current_block.textStyle.attrs['align'])):
        ts = self.current_block.textStyle.copy()
        ts.attrs.update(text_properties)
        ts.attrs['align'] = align
        bs = self.current_block.blockStyle.copy()
        if (not self.preserve_block_style):
            bs.attrs.update(block_properties)
        self.current_block.append_to(self.current_page)
        try:
            index = self.text_styles.index(ts)
            ts = self.text_styles[index]
        except ValueError:
            self.text_styles.append(ts)
        try:
            index = self.block_styles.index(bs)
            bs = self.block_styles[index]
        except ValueError:
            self.block_styles.append(bs)
        self.current_block = self.book.create_text_block(blockStyle=bs, textStyle=ts)
        return True
    return False
