MCPcopy Index your code
hub / github.com/python-openxml/python-docx / _move_content_to

Method _move_content_to

src/docx/oxml/table.py:616–630  ·  view source on GitHub ↗

Append the content of this cell to `other_tc`. Leaves this cell with a single empty `` `` element.

(self, other_tc: CT_Tc)

Source from the content-addressed store, hash-verified

614 return isinstance(only_item, CT_P) and len(only_item.r_lst) == 0
615
616 def _move_content_to(self, other_tc: CT_Tc):
617 """Append the content of this cell to `other_tc`.
618
619 Leaves this cell with a single empty ``<w:p>`` element.
620 """
621 if other_tc is self:
622 return
623 if self._is_empty:
624 return
625 other_tc._remove_trailing_empty_p()
626 # -- appending moves each element from self to other_tc --
627 for block_element in self.iter_block_items():
628 other_tc.append(block_element)
629 # -- add back the required minimum single empty <w:p> element --
630 self.append(self._new_p())
631
632 def _new_tbl(self) -> None:
633 raise NotImplementedError(

Callers 3

_span_to_widthMethod · 0.95
_swallow_next_tcMethod · 0.80

Calls 3

iter_block_itemsMethod · 0.95
appendMethod · 0.80

Tested by 1