def get_or_add_off(self): """ Return the <a:off> child element, newly added if not already present. """ off = self.off if off is None: off = Element('a:off') off.set('x', '0') off.set('y', '0') self.insert(0, off) return off
def get_or_add_ext(self): """ Return the <a:ext> child element, newly added if not already present. """ ext = self.ext if ext is None: ext = Element('a:ext') ext.set('cx', '0') ext.set('cy', '0') self.append(ext) return ext
def add_hlinkClick(self, rId): """ Add an <a:hlinkClick> child element with r:id attribute set to *rId*. """ assert self.find(qn("a:hlinkClick")) is None hlinkClick = Element("a:hlinkClick", nsmap("a", "r")) hlinkClick.set(qn("r:id"), rId) # find right insertion spot, will go away once xmlchemy comes in if self.find(qn("a:hlinkMouseOver")): successor = self.find(qn("a:hlinkMouseOver")) successor.addprevious(hlinkClick) elif self.find(qn("a:rtl")): successor = self.find(qn("a:rtl")) successor.addprevious(hlinkClick) elif self.find(qn("a:extLst")): successor = self.find(qn("a:extLst")) successor.addprevious(hlinkClick) else: self.append(hlinkClick) return hlinkClick