From 9d494462367b8ec052654ea98a2d951fc1b9bb75 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 1 Sep 2016 22:29:53 +0530 Subject: [PATCH] DOCX Input: Fix right-to-left alignment not working for footnotes. Fixes #1617254 [Left aligned footnotes appear right aligned](https://bugs.launchpad.net/calibre/+bug/1617254) --- src/calibre/ebooks/docx/block_styles.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/docx/block_styles.py b/src/calibre/ebooks/docx/block_styles.py index 552fe9820e..fe62ea7641 100644 --- a/src/calibre/ebooks/docx/block_styles.py +++ b/src/calibre/ebooks/docx/block_styles.py @@ -388,9 +388,10 @@ class ParagraphStyle(object): val = '%.3gpt' % val c[x.replace('_', '-')] = val ta = self.text_align - if self.bidi: - ta = {'left':'right', 'right':'left'}.get(ta, ta) - c['text-align'] = ta + if ta is not inherit: + if self.bidi is True: + ta = {'left':'right', 'right':'left'}.get(ta, ta) + c['text-align'] = ta return self._css