Skip to content

Commit 7f97f7b

Browse files
author
Steve Canny
committed
oxml: convert CT_Picture to xmlchemy
1 parent 0af022a commit 7f97f7b

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

docs/dev/analysis/features/shapes-inline.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ Schema definitions
144144
<xsd:complexType name="CT_Inline">
145145
<xsd:sequence>
146146
<xsd:element name="extent" type="a:CT_PositiveSize2D"/>
147-
<xsd:element name="effectExtent" type="CT_EffectExtent" minOccurs="0"/>
147+
<xsd:element name="effectExtent" type="CT_EffectExtent" minOccurs="0"/>
148148
<xsd:element name="docPr" type="a:CT_NonVisualDrawingProps"/>
149149
<xsd:element name="cNvGraphicFramePr" type="a:CT_NonVisualGraphicFrameProperties" minOccurs="0"/>
150150
<xsd:element name="graphic" type="CT_GraphicalObject"/>
151151
</xsd:sequence>
152-
<xsd:attribute name="distT" type="ST_WrapDistance" use="optional"/>
153-
<xsd:attribute name="distB" type="ST_WrapDistance" use="optional"/>
154-
<xsd:attribute name="distL" type="ST_WrapDistance" use="optional"/>
155-
<xsd:attribute name="distR" type="ST_WrapDistance" use="optional"/>
152+
<xsd:attribute name="distT" type="ST_WrapDistance"/>
153+
<xsd:attribute name="distB" type="ST_WrapDistance"/>
154+
<xsd:attribute name="distL" type="ST_WrapDistance"/>
155+
<xsd:attribute name="distR" type="ST_WrapDistance"/>
156156
</xsd:complexType>
157157

158158
<xsd:complexType name="CT_PositiveSize2D">
@@ -175,9 +175,9 @@ Schema definitions
175175
</xsd:sequence>
176176
<xsd:attribute name="id" type="ST_DrawingElementId" use="required"/>
177177
<xsd:attribute name="name" type="xsd:string" use="required"/>
178-
<xsd:attribute name="descr" type="xsd:string" use="optional" default=""/>
179-
<xsd:attribute name="hidden" type="xsd:boolean" use="optional" default="false"/>
180-
<xsd:attribute name="title" type="xsd:string" use="optional" default=""/>
178+
<xsd:attribute name="descr" type="xsd:string" default=""/>
179+
<xsd:attribute name="hidden" type="xsd:boolean" default="false"/>
180+
<xsd:attribute name="title" type="xsd:string" default=""/>
181181
</xsd:complexType>
182182

183183
<xsd:complexType name="CT_NonVisualGraphicFrameProperties">

docx/oxml/shape.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ class CT_NonVisualDrawingProps(BaseOxmlElement):
105105
"""
106106
@classmethod
107107
def new(cls, nsptagname_str, shape_id, name):
108-
elt = OxmlElement(nsptagname_str)
109-
elt.set('id', str(shape_id))
110-
elt.set('name', name)
111-
return elt
108+
elm = OxmlElement(nsptagname_str)
109+
elm.set('id', str(shape_id))
110+
elm.set('name', name)
111+
return elm
112112

113113

114114
class CT_NonVisualPictureProperties(BaseOxmlElement):
@@ -125,9 +125,7 @@ class CT_Picture(BaseOxmlElement):
125125
"""
126126
``<pic:pic>`` element, a DrawingML picture
127127
"""
128-
@property
129-
def blipFill(self):
130-
return self.find(qn('pic:blipFill'))
128+
blipFill = OneAndOnlyOne('pic:blipFill')
131129

132130
@classmethod
133131
def new(cls, pic_id, filename, rId, cx, cy):

0 commit comments

Comments
 (0)