Commit Graph

23 Commits

Author SHA1 Message Date
Christian Lohmaier
ab465b90f6 bin/rename-sw-abbreviations.sh
renames the most annoying abbreviations in Writer (and partially
in the shared code too).

Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-05-20 13:05:49 +02:00
Miklos Vajna
9101ccfa40 SwAnchoredObjectPosition::_GetHoriAlignmentValues: fix position of textboxes
The problem was that the right edge of the textbox was outside the parent
draw shape, which is unexpected for rectangle shapes.

Change-Id: I5154a61b07d3d8d894491e76923b3b017aa3ce8e
2014-11-28 14:15:39 +01:00
Miklos Vajna
01fc08c0b5 fdo#85554 SwXShape: fix getting ZOrder property when doc contains TextBoxes
Change-Id: I9b6b83f0f6d627bb14a880a19769ee70564cf52b
2014-11-20 16:57:49 +01:00
Miklos Vajna
6606313d6e Add a SwTextBoxHelper::findTextBoxes() variant that takes an SwNode
This method is called by the ODF export for each paragraph, so limiting
the result for TextBoxes anchored to a single paragraph helps to avoid
iterating over all the frames for each paragraph.

For a test document of 2000 mail merge records and 16 frames, the times for
css::text::MailMerge::execute() are 8m18.811s -> 7m53.575s.

Change-Id: I7a9cd7b23a3e903059ec0ae3a6a8f8309681bb2e
2014-10-31 16:53:25 +01:00
Miklos Vajna
0606ab6a73 SwTextBoxHelper::findTextBoxes: return a set of const pointers
Change-Id: I8e3ea996959bad72e6d15dc9c980ea9d18d31fb3
2014-08-15 16:48:57 +02:00
Miklos Vajna
615d3e319c SwTextBoxHelper::findTextBox: take a const SwFrmFmt
Change-Id: I531a5864f61ab6c9bfcfc44f7fcacef58ad78489
2014-08-15 16:48:57 +02:00
Miklos Vajna
0da4e600e6 Let SwTextBoxHelper::findTextBoxes() return a set
The intention was to have a container where it's fast to look elements
up, and list is a linked list, so it doesn't fit.

Change-Id: I3196c8dee96ecd4a6f464b74fd5141b27f1773b8
2014-06-25 15:54:21 +02:00
Miklos Vajna
7596e26fd2 Add SwTextBoxHelper::findShapes
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
2014-06-24 17:47:40 +02:00
Miklos Vajna
8ba6d7a809 SwDoc::SetFlyFrmAttr: sync position between draw shape and its textbox
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
2014-06-19 17:16:32 +02:00
Miklos Vajna
db6f15ab21 SwXShape: add ChainName UNO property
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
2014-06-13 20:07:16 +02:00
Miklos Vajna
02f2d886c8 SwDoc::CopyFlyInFlyImpl: factor out textbox code into SwTextBoxHelper
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
2014-06-13 10:58:17 +02:00
Miklos Vajna
ff1c74f53a SwTextBoxHelper::findTextBox: add an UNO version
Export filters don't have access to SwXShape, and it's probably good to
have that way.

Change-Id: I039bafec10d2fde7c7acdcfad5b07068a2a519f1
2014-06-06 14:24:26 +02:00
Miklos Vajna
24d8bcc763 SwTextBoxHelper: handle size when it's set before CustomShapeGeometry
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
2014-05-30 18:04:23 +02:00
Miklos Vajna
6823b19257 SwTextBoxHelper::syncProperty(): no need to pass the property name
Change-Id: Ic2f6ae15fd81826d2bc6f8796e33c3c93b34e240
2014-05-29 14:43:44 +02:00
Miklos Vajna
3e26685360 SwTextBoxHelper::create(): initialize position
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
2014-05-29 14:43:44 +02:00
Miklos Vajna
31c4c834b8 SwTextBoxHelper: extract getTextRectangle() from syncProperty()
Change-Id: I6265247593571ffba4cbda7f87bdde1e943aff51
2014-05-28 15:57:11 +02:00
Miklos Vajna
0f884b27fd let SwTextBoxHelper::findTextBoxes() take a const SwDoc
Change-Id: Icb1540b93f4117999b755d4d5fd387f1228250aa
2014-05-27 09:32:45 +02:00
Miklos Vajna
69578bf06d SwXDrawPage::getByIndex(): ignore textboxes
Change-Id: I643ca4268e15af1882adb168af152835ef216cd9
2014-05-27 09:32:44 +02:00
Miklos Vajna
f1dae10ca5 SwXDrawPage::getCount(): ignore textboxes
Change-Id: I579cc0242f6901175162b169813e4465d52952a0
2014-05-27 09:32:44 +02:00
Miklos Vajna
ae59502b20 SwXShape: return the right XText implementaation in the TextBox case
Change-Id: Iac31bd4b3b1918f857feff9045df473e9b1d3d2b
2014-05-27 09:32:44 +02:00
Miklos Vajna
f8ef170acf SwXShape: allow setting TextBox property to false
Change-Id: I23d79fc3f5c020c86296bfc84bb0824e1ca68228
2014-05-27 09:32:44 +02:00
Miklos Vajna
f1ada85a95 SwXShape: new bool TextBox property
Change-Id: Iae588c817ea17b6b2c2d3f2818ee5f94ed6f4e96
2014-05-27 09:32:43 +02:00
Miklos Vajna
72159041cb Initial SwTextBoxHelper
Change-Id: I2674d72a2ba7bf49f102e09ed8435445c9687bb2
2014-05-27 09:32:42 +02:00