sw btlr writing mode: implement initial layout

Desktop / LibreOffice - Miklos Vajna [collabora.com] - 12 February 2019 17:18 EST

The bulk of this commit is reasonably straightforward, the interesting parts are:

- SwFrame::CheckDir() is where the layout reads the doc model, i.e. sets the new SwFrame::mbVertLRBT.

- We had 3 text directions previously: horizontal, vertical (implicitly RL) and
vertical LR (implicitly TB). This adds a 4th text direction for the LRBT case.

- SwTextFrame::SwitchHorizontalToVertical() is responsible for re-locating the origo of a string to be painted from the top left to the bottom left corner (in addition to the height/width swap that's done for all vertical directions).

- Finally MapDirection() is the place where we map Writer's new btlr mode (with no character rotation) to VCL's 900 (90 degrees) rotated direction.

No functional changes intended for existing text directions. Lots of places are still not yet adapted, but this is good enough to paint a single word in a table cell at the correct position with the correct direction.

Change-Id: I465c62db6562d8a2be140c3d37473e590830139e Reviewed-on: https://gerrit.libreoffice.org/67740

e8b9572bf89f sw btlr writing mode: implement initial layout
sw/source/core/inc/frame.hxx | 15 ++++++++--
sw/source/core/inc/swfont.hxx | 3 +-
sw/source/core/layout/calcmove.cxx | 2 +-
sw/source/core/layout/colfrm.cxx | 2 +-
sw/source/core/layout/findfrm.cxx | 1 +
sw/source/core/layout/newfrm.cxx | 61 ++++++++++++++++++++++++++++++++++++++
sw/source/core/layout/paintfrm.cxx | 4 +--
sw/source/core/layout/ssfrm.cxx | 4 +--
sw/source/core/layout/wsfrm.cxx | 14 ++++++---
sw/source/core/text/itratr.cxx | 9 ++++--
sw/source/core/text/itratr.hxx | 3 +-
sw/source/core/text/redlnitr.cxx | 16 ++++++++--
sw/source/core/text/txtfrm.cxx | 15 ++++++++++
sw/source/core/txtnode/swfont.cxx | 11 ++++---
14 files changed, 135 insertions(+), 25 deletions(-)

Upstream: cgit.freedesktop.org


  • Share