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:
Kovid Goyal 2011-08-23 09:51:46 -06:00
parent b3f5484cbe
commit ec32d0f3f1
2 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -290,7 +290,10 @@ class DatabaseException(Exception):
def __init__(self, err, tb):
tb = '\n\t'.join(('\tRemote'+tb).splitlines())
msg = unicode(err) +'\n' + tb
try:
msg = unicode(err) +'\n' + tb
except:
msg = repr(err) + '\n' + tb
Exception.__init__(self, msg)
self.orig_err = err
self.orig_tb = tb