File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,12 +79,12 @@ def _tblPr(self):
7979 return self ._tbl .tblPr
8080
8181
82- class _Cell (object ):
82+ class _Cell (Parented ):
8383 """
8484 Table cell
8585 """
86- def __init__ (self , tc ):
87- super (_Cell , self ).__init__ ()
86+ def __init__ (self , tc , parent ):
87+ super (_Cell , self ).__init__ (parent )
8888 self ._tc = tc
8989
9090 @property
@@ -159,12 +159,12 @@ def __getitem__(self, idx):
159159 msg = "cell index [%d] is out of range" % idx
160160 raise IndexError (msg )
161161 tc = tr .tc_lst [self ._col_idx ]
162- return _Cell (tc )
162+ return _Cell (tc , self )
163163
164164 def __iter__ (self ):
165165 for tr in self ._tr_lst :
166166 tc = tr .tc_lst [self ._col_idx ]
167- yield _Cell (tc )
167+ yield _Cell (tc , self )
168168
169169 def __len__ (self ):
170170 return len (self ._tr_lst )
@@ -250,10 +250,10 @@ def __getitem__(self, idx):
250250 except IndexError :
251251 msg = "cell index [%d] is out of range" % idx
252252 raise IndexError (msg )
253- return _Cell (tc )
253+ return _Cell (tc , self )
254254
255255 def __iter__ (self ):
256- return (_Cell (tc ) for tc in self ._tr .tc_lst )
256+ return (_Cell (tc , self ) for tc in self ._tr .tc_lst )
257257
258258 def __len__ (self ):
259259 return len (self ._tr .tc_lst )
Original file line number Diff line number Diff line change @@ -142,13 +142,13 @@ def it_can_replace_its_content_with_a_string_of_text(
142142 ])
143143 def text_set_fixture (self , request ):
144144 tc_cxml , new_text , expected_cxml = request .param
145- cell = _Cell (element (tc_cxml ))
145+ cell = _Cell (element (tc_cxml ), None )
146146 expected_xml = xml (expected_cxml )
147147 return cell , new_text , expected_xml
148148
149149 @pytest .fixture
150150 def paragraphs_fixture (self ):
151- return _Cell (element ('w:tc/(w:p, w:p)' ))
151+ return _Cell (element ('w:tc/(w:p, w:p)' ), None )
152152
153153
154154class Describe_Column (object ):
You can’t perform that action at this time.
0 commit comments