【发布时间】:2020-01-26 19:59:10
【问题描述】:
【问题讨论】:
标签: libreoffice libreoffice-basic openoffice-impress
【问题讨论】:
标签: libreoffice libreoffice-basic openoffice-impress
获取当前选中的形状:
oSel = ThisComponent.getCurrentController.getSelection()
oShape = oSel.getByIndex(0)
Print oShape.getString()
要遍历幻灯片中的所有形状,请从 ThisComponent.getDrawPages() 开始,然后使用 XrayTool。
您还可能会发现以下 python 代码的 sn-p 很有帮助:
def iterate_draw_shapes():
oDrawPage = oDrawPages.getByIndex(1)
for oShape in oDrawPage:
if oShape.supportsService("com.sun.star.drawing.TextShape"):
oTexts = oShape.createEnumeration()
while oTexts.hasMoreElements():
oText = oTexts.nextElement()
oTextPortions = oText.createEnumeration()
while oTextPortions.hasMoreElements():
oTextPortion = oTextPortions.nextElement()
【讨论】: