mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When adding a text indent to paragraphs as part of the remove spacing between paragraphs transformation, do not add an indent to paragraphs that are directly centerd or right aligned. Fixes #830439 ([Enhancement]Indenting should ignore centered text)
This commit is contained in:
parent
b3f5484cbe
commit
ec32d0f3f1
@ -320,7 +320,8 @@ class CSSFlattener(object):
|
||||
if self.context.insert_blank_line:
|
||||
cssdict['margin-top'] = cssdict['margin-bottom'] = \
|
||||
'%fem'%self.context.insert_blank_line_size
|
||||
if self.context.remove_paragraph_spacing:
|
||||
if (self.context.remove_paragraph_spacing and
|
||||
cssdict.get('text-align', None) not in ('center', 'right')):
|
||||
cssdict['text-indent'] = "%1.1fem" % self.context.remove_paragraph_spacing_indent_size
|
||||
|
||||
if cssdict:
|
||||
|
@ -290,7 +290,10 @@ class DatabaseException(Exception):
|
||||
|
||||
def __init__(self, err, tb):
|
||||
tb = '\n\t'.join(('\tRemote'+tb).splitlines())
|
||||
try:
|
||||
msg = unicode(err) +'\n' + tb
|
||||
except:
|
||||
msg = repr(err) + '\n' + tb
|
||||
Exception.__init__(self, msg)
|
||||
self.orig_err = err
|
||||
self.orig_tb = tb
|
||||
|
Loading…
x
Reference in New Issue
Block a user