Skip to content

Commit ce1711d

Browse files
author
Steve Canny
committed
oxml: convert CT_Row to xmlchemy
1 parent d49c0f5 commit ce1711d

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

docx/oxml/table.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,17 @@
1111
from .ns import qn
1212
from .shared import CT_String
1313
from .text import CT_P
14-
from .xmlchemy import BaseOxmlElement
14+
from .xmlchemy import BaseOxmlElement, ZeroOrMore
1515

1616

1717
class CT_Row(BaseOxmlElement):
1818
"""
1919
``<w:tr>`` element
2020
"""
21-
def add_tc(self):
22-
"""
23-
Return a new <w:tc> element that has been added at the end of any
24-
existing tc elements.
25-
"""
26-
tc = CT_Tc.new()
27-
return self._append_tc(tc)
21+
tc = ZeroOrMore('w:tc')
22+
23+
def _new_tc(self):
24+
return CT_Tc.new()
2825

2926
@classmethod
3027
def new(cls):
@@ -33,20 +30,6 @@ def new(cls):
3330
"""
3431
return OxmlElement('w:tr')
3532

36-
@property
37-
def tc_lst(self):
38-
"""
39-
Sequence containing the ``<w:tc>`` child elements in this ``<w:tr>``.
40-
"""
41-
return self.findall(qn('w:tc'))
42-
43-
def _append_tc(self, tc):
44-
"""
45-
Return *tc* after appending it to end of tc sequence.
46-
"""
47-
self.append(tc)
48-
return tc
49-
5033

5134
class CT_Tbl(BaseOxmlElement):
5235
"""

0 commit comments

Comments
 (0)