'Create a new TextBlock only if necessary as indicated by css
@type css: dict'

def process_alignment(self, css):

    align = self.get_alignment(css)
    if (align != self.current_block.textStyle.attrs['align']):
        self.current_para.append_to(self.current_block)
        self.current_block.append_to(self.current_page)
        ts = self.book.create_text_style(**self.current_block.textStyle.attrs)
        ts.attrs['align'] = align
        try:
            index = self.text_styles.index(ts)
            ts = self.text_styles[index]
        except ValueError:
            self.text_styles.append(ts)
        self.current_block = self.book.create_text_block(blockStyle=self.current_block.blockStyle, textStyle=ts)
        self.current_para = Paragraph()
        return True
    return False
