File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed
pydocx/openxml/wordprocessing
tests/openxml/wordprocessing Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change
1
+ **0.9.10 **
2
+
3
+ - No longer error when processing margin positions with decimal points.
4
+
1
5
**0.9.9 **
2
6
3
7
- Rect elements now correctly handle image data
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ def start_margin_position(self):
35
35
# ignored.
36
36
start_margin = 0
37
37
if self .indentation_left :
38
- start_margin += int (self .indentation_left )
38
+ start_margin += int (float ( self .indentation_left ) )
39
39
if self .indentation_hanging :
40
- start_margin -= int (self .indentation_hanging )
40
+ start_margin -= int (float ( self .indentation_hanging ) )
41
41
elif self .indentation_first_line :
42
- start_margin += int (self .indentation_first_line )
42
+ start_margin += int (float ( self .indentation_first_line ) )
43
43
if start_margin :
44
44
return start_margin
45
45
return 0
Original file line number Diff line number Diff line change @@ -105,3 +105,21 @@ def test_returns_left_minus_hanging_ignoring_first_line(self):
105
105
'''
106
106
properties = self ._load_from_xml (xml )
107
107
self .assertEqual (properties .start_margin_position , 100 )
108
+
109
+ def test_allow_decimal_indentation_for_hanging (self ):
110
+ xml = '''
111
+ <pPr>
112
+ <ind left="123.1" hanging="23.2" />
113
+ </pPr>
114
+ '''
115
+ properties = self ._load_from_xml (xml )
116
+ self .assertEqual (properties .start_margin_position , 100 )
117
+
118
+ def test_allow_decimal_indentation_for_first_line (self ):
119
+ xml = '''
120
+ <pPr>
121
+ <ind left="123.3" firstLine="50.4" />
122
+ </pPr>
123
+ '''
124
+ properties = self ._load_from_xml (xml )
125
+ self .assertEqual (properties .start_margin_position , 173 )
You can’t perform that action at this time.
0 commit comments