It builds a textbox -> shape map, so methods interested to pick the
shape instead of a shape's textbox can call it and act accordingly if
their textbox is in the map.
Change-Id: I0f30d64a284eb461f462ed6c0a36c88271153f04
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
class A {
struct X x;
public X* getX() { return &x; }
}
which can be:
public X& getX() { return x; }
Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
The effect of this is that if you move around a shape (having a textbox)
with the keyboard or mouse, then the position of the textbox is now also
adjusted as you would expect it, as a user.
Change-Id: Ie079f8c7b76e9a97095e4233eded5bda514cf405
Shapes may not have a unique name, but TextFrames always have. So in
order to be able to link shapes with textboxes, provide a ChainName
property that's the name of the underlying TextFrame. This kills two
birds with one stone:
- we can have a unique name for each shape
- the names can be used for TextFrame linking, as they are valid
TextFrame names
Change-Id: Ie96f267d392d9fe5388c5eacff9b873f1639054c
At the moment it's only possible to set this property, and it only sets
the same property of the underlying textbox, if there is any.
Change-Id: I9f168f69a8e92a1b26f21e653a05c97e2e32297c
The TextRange property of a shape is its anchor position: if that's
adjusted, then also set the textbox's RES_ANCHOR to the new position.
Without this, e.g. shapes anchored in headers have their textboxes
anchored in the body text, CppunitTest_sw_ooxmlexport's testfdo78420 is
a reproducer.
Change-Id: I83ed09875c3f0360c581c331507ad2b9d05ffb3a
Also, let the new SwTextBoxHelper::restoreLinks() restore also the
RES_CNTNT of the *old* draw formats, not only the link between the new
draw and fly formats.
This allows properly preserving the link between draw and fly formats,
when they are in the header (and so copied in and out variously).
Change-Id: I101ff06533e2ea27abea8bed171ed69c9649ebe8
This is required by the ODF import, as that sets the CustomShapeGeometry
after setting other properties (like Transformation, which includes the
position/size).
Change-Id: I299a1b302d55b3753a0a6b2142ea173f5f134b39
E.g. the ODF import won't set an explicit size, it'll just set a
Transformation property, and a CustomShapeGeometry one, which contains
the textbox rectangle.
Change-Id: I9ac7ab5a324dc9c7c5ce3196fee8d257b7426f41
The situation is a bit more complicated here,
drawing::XCustomShapeEngine returns the text rectangle in absolute
coordinates, but that's on the drawpage. So count the relative
coordinates, and then just adjust the position we got from the original
shape.
Change-Id: Ibfbc183e5170037c8c281d61ce802a19a7acda17
On import, syncProperty() takes care of this, but in case the user
interactively adds a textbox, when we need to handle the size in
create() as well.
Change-Id: I9428a682dbf70550bdfd081900e8098aeb64d38f