office-gobmx/editeng
Michael Stahl a0875d09d9 editeng: remove SvxLRSpaceItem::nTxtLeft
Several parts of SvxLRSpaceItem appear to maintain an invariant of the
3 members nTxtLeft/nLeftMargin/nFirstLineOffset: nLeftMargin is either
equal to nTxtLeft if nFirstLineOffset is positive, otherwise equal to
nTxtLeft + nFirstLineOffset.

But not every part maintains it: there are functions SetLeftValue() and
SetLeft() which simply write into nLeftMargin regardless, and a
constructor that takes 3 separate numbers without any checks.

The constructor calls violate the invariant in 2 ways: nTxtLeft is
simply set to 0 (many cases), and one case in OutlineView::OutlineView()
that sets nTxtLeft to 2000 but the other 2 at 0.

Another odd thing is that the UNO services that expose SvxLRSpaceItem
either expose a property for MID_L_MARGIN or for MID_TXT_LMARGIN but
never both.

It looks like there are 2 distinct usages of SvxLRSpaceItem:
for anything that's applied to paragraphs, all 3 members are used;
for anything else, nTxtLeft is unused.

Try to simplify this by removing the nTxtLeft member, instead
GetTextLeft() simply calculates it.

Also assert in SetLeftValue()/SetLeft() that nFirstLineOffset is 0.

Change-Id: Ida900c6ff04ef78e92e8914beda1cc731a695b06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146643
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-02-08 11:03:36 +00:00
..
inc
qa
source editeng: remove SvxLRSpaceItem::nTxtLeft 2023-02-08 11:03:36 +00:00
uiconfig/ui
AllLangMoTarget_editeng.mk
CppunitTest_editeng_borderline.mk
CppunitTest_editeng_core.mk
CppunitTest_editeng_lookuptree.mk
CustomTarget_generated.mk
IwyuFilter_editeng.yaml
Library_editeng.mk
Makefile
Module_editeng.mk
README.md
UIConfig_editeng.mk

Edit Engine

In OpenOffice.org build DEV300m72 this module was split off from svx but it has no dependencies on svx (nor on sfx2) while in turn svx depends on editeng

Read more in the mailing list post: http://www.mail-archive.com/dev@openoffice.org/msg13237.html

If you build LibreOffice with dbgutil, you have some extended debug keys:

  • Ctrl+Alt+F1 - draws the paragraph rectangles in different colors
  • Ctrl+Alt+F11 - toggles dumping the edit engine state to the "editenginedump.log" on draw
  • Ctrl+Alt+F12 - dumps the current edit engine state to "editenginedump.log"