I decided to start a new thread as the old one was getting too long to be useful, and this is kind of a new, but related, problem.
I’m writing a C# program using the LibreOffice SDK that inserts, scales, and centers images “in” spreadsheet cells. It’s working (!) but there are a few things I want to clean up. When I’m done I will post the program for others to use as a resource.
If I insert an image “into” a cell using the LibreOffice GUI, using “Insert->Image…”, it displays a small “Anchor” symbol in the upper left corner of the cell. However, if I insert an image with my program, it doesn’t show the “Anchor” symbol. After some exploring, I am starting to think that this difference is the tip of a very big iceberg.
I used MRI to look at the two different cells (the manually-inserted one and the programmatically-inserted one), along with the shapes containing the images, and what I think is the anchor (what I get if I click on the “Anchor” property in the shape). The cells and shapes are pretty much identical, but the anchors are very different, as if they’ve been created by entirely different things.
I don’t actually create anchors in my program; I think that what’s there gets generated when I create a new shape containing a new image. Maybe there is a way to specify the type of anchor to create, or to create the right kind of anchor explicitly, but endless searching in the documentation has not yielded anything.
I may not be able to do what I want, which is to have my program insert an image that is identical to one created with “Insert->Image…”. I realize I’m working outside the bounds of what the SDK can reasonably do, so maybe I should not worry about this. My program does insert images and they display properly in the spreadsheet (or at least appear to). They just don’t display the anchor symbol, and probably have other non-obvious differences that would cause trouble if one were to try to do something fancy.
So what I’m asking here is whether anyone knows about anchors and how to generate a proper one when I insert an image. If not, I’ll just have to not worry about it.
Thanks, as always…
-jimc