diff --git a/dist/python-docx-1961rc1.tar.gz b/dist/python-docx-1961rc1.tar.gz new file mode 100644 index 000000000..2e00da528 Binary files /dev/null and b/dist/python-docx-1961rc1.tar.gz differ diff --git a/docx/oxml/table.py b/docx/oxml/table.py index 387b05063..436d7a929 100644 --- a/docx/oxml/table.py +++ b/docx/oxml/table.py @@ -805,6 +805,7 @@ class CT_TcPr(BaseOxmlElement): gridSpan = ZeroOrOne('w:gridSpan', successors=_tag_seq[3:]) tcBorders = ZeroOrOne('w:tcBorders', successors = ('w:tcPr',)) vMerge = ZeroOrOne('w:vMerge', successors=_tag_seq[5:]) + shd = ZeroOrOne('w:shd', successors=_tag_seq[7:]) vAlign = ZeroOrOne('w:vAlign', successors=_tag_seq[12:]) del _tag_seq diff --git a/docx/oxml/text/delrun.py b/docx/oxml/text/delrun.py index 9f897ca44..0245da98f 100644 --- a/docx/oxml/text/delrun.py +++ b/docx/oxml/text/delrun.py @@ -12,7 +12,7 @@ from ..ns import qn from ..simpletypes import ST_BrClear, ST_BrType -from ..xmlchemy import (BaseOxmlElement, OptionalAttribute, ZeroOrMore, ZeroOrOne) +from ..xmlchemy import (BaseOxmlElement, OptionalAttribute, ZeroOrMore, ZeroOrOne, OxmlElement) class CT_DR(BaseOxmlElement): @@ -46,14 +46,16 @@ def text(self): @text.setter def text(self, text): self.clear_content() - _RunContentAppender.append_to_run_from_text(self, text) + new_run = OxmlElement("w:r") + new_run.add_dt(text) + self.append(new_run) def clear_content(self): """ Remove all child elements except the ```` element if present. """ - content_child_elms = self[1:] if self.rPr is not None else self[:] - for child in content_child_elms: + # content_child_elms = self[1:] if self.rPr is not None else self[:] + for child in self[:]: self.remove(child) def copy_rpr(self,rprCopy): diff --git a/docx/oxml/text/insrun.py b/docx/oxml/text/insrun.py index 4b65d001b..5b0e24014 100644 --- a/docx/oxml/text/insrun.py +++ b/docx/oxml/text/insrun.py @@ -12,7 +12,7 @@ from ..ns import qn from ..simpletypes import ST_BrClear, ST_BrType -from ..xmlchemy import (BaseOxmlElement, OptionalAttribute, ZeroOrMore, ZeroOrOne) +from ..xmlchemy import (BaseOxmlElement, OptionalAttribute, ZeroOrMore, ZeroOrOne, OxmlElement) class CT_IR(BaseOxmlElement): @@ -47,7 +47,9 @@ def text(self): @text.setter def text(self, text): self.clear_content() - _RunContentAppender.append_to_run_from_text(self, text) + new_run = OxmlElement("w:r") + new_run.text = text + self.append(new_run) def copy_rpr(self,rprCopy): rPr = self._r.get_or_add_rPr() @@ -86,8 +88,8 @@ def clear_content(self): """ Remove all child elements except the ```` element if present. """ - content_child_elms = self[1:] if self.rPr is not None else self[:] - for child in content_child_elms: + # content_child_elms = self[1:] if self.rPr is not None else self[:] + for child in self[:]: self.remove(child)