Skip to content

Commit c429673

Browse files
committed
test_text: fixed some errors
1 parent f414e48 commit c429673

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

docx/oxml/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
register_custom_element_class('w:dstrike', CT_OnOff)
6464
register_custom_element_class('w:emboss', CT_OnOff)
6565
register_custom_element_class('w:i', CT_OnOff)
66+
register_custom_element_class('w:u', CT_String)
6667
register_custom_element_class('w:iCs', CT_OnOff)
6768
register_custom_element_class('w:imprint', CT_OnOff)
6869
register_custom_element_class('w:noProof', CT_OnOff)

docx/oxml/table.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,22 @@ def gridSpan(self):
297297
"""
298298
return self.find(qn('w:gridSpan'))
299299

300+
def add_gridSpan(self, span):
301+
"""
302+
Return a new <w:gridSpan> element newly inserted in sequence among
303+
the existing child elements.gridSpan
304+
"""
305+
gridSpan = CT_String.new('w:gridSpan', str(span))
306+
self.append(gridSpan) # append or insert?
307+
return gridSpan
308+
309+
@property
310+
def gridSpan(self):
311+
"""
312+
Optional <w:gridSpan> child element, or |None| if not present.
313+
"""
314+
return self.find(qn('w:gridSpan'))
315+
300316

301317

302318

tests/test_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
absolute_import, division, print_function, unicode_literals
99
)
1010

11-
from docx.enum.text import WD_BREAK
11+
from docx.enum.text import WD_BREAK, WD_UNDERLINE
1212
from docx.oxml.text import CT_P, CT_R
1313
from docx.text import Paragraph, Run
1414

0 commit comments

Comments
 (0)