diff --git a/addin.xcu b/addin.xcu index 0519e8e..f85efde 100644 --- a/addin.xcu +++ b/addin.xcu @@ -29,7 +29,7 @@ Returns an image from a given source. Provided by Lox365. Add-in - + Location Reference to the cell where the image is to be placed. diff --git a/pythonpath/imagefn.py b/pythonpath/imagefn.py index 9a275e5..59cd714 100644 --- a/pythonpath/imagefn.py +++ b/pythonpath/imagefn.py @@ -1,12 +1,11 @@ from com.sun.star.awt import Size - -def IMAGE(doc, out_cell, url): - drawpages = doc.DrawPages[int(out_cell.RangeAddress.Sheet)] +def IMAGE(doc, outCell, url): + drawpages = doc.DrawPages[int(outCell.RangeAddress.Sheet)] existing_images = [] def get_existing_images_at_position(): for item in drawpages: - if out_cell.Position != item.Position: continue + if outCell.Position != item.Position: continue existing_images.append(item) def remove_existing_images_at_position(): [item.dispose() for item in existing_images] @@ -26,7 +25,7 @@ def remove_existing_images_at_position(): url = '/'.join(current_dir) + '/' + url image = doc.createInstance('com.sun.star.drawing.GraphicObjectShape') - image.Position = out_cell.Position + image.Position = outCell.Position image.GraphicURL = url image.Name = f'Generated image' try: