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>
The idea is that each class only dumps itself & what it owns, otherwise
the same info is dumped multiple times.
Change-Id: Ib21bd2d31aa0d70d58b2b8aa453e0ede788c7144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146511
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
In Hide Changes mode, Undo of insertion of CH_TXT_TRACKED_DUMMY_CHAR
(workaround of the deletion of empty table rows), resulted a crash
because of inconsistency of table and redline nodes. As a workaround,
skip that insertion from the Undo.
Regression from commit a74c51025f
"tdf#146962 sw: hide deleted row at deletion in Hide Changes".
Change-Id: I0666d7bcbbf08d84386cea64c1807f69f751479d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145737
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Add a 3rd kind of hiding to SwRootFrame and CheckParaRedlineMerge().
This is quite simple as only consecutive paragraphs are merged.
There is an existing similar feature described in
http://www.openoffice.org/specs/writer/hidden_text/hidden_text.sxw
which results in 0-height text frames if all text is hidden
- but that is unconditional, while Word shows the paragraph when
control chars are shown, and hides it otherwise *iff* its paragraph
marker is hidden (and there's no page break on it).
Change-Id: I8290962ea58278e17b8f84bf6b2ca4bb2325aa8f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145162
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
The one in SwSectionData seems to the section name visible on the UI.
SwSectionFormat also has a name, but it looks like even the UI doesn't
bother with maintaining that on section rename, so that's not really
used anywhere, and only that was visible in the dump previously.
Change-Id: I9a7444561cee0e42d23eaf06cb4d53171603c0df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145259
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
as a step towards switching away from using SwPosition inside
SwFormatAnchor (because SwFormatAnchor wants to do weird stuff with the
internals of SwPosition)
Change-Id: I1527b6585d1e130b46e1e51b1e40eea043339d8f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143205
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
the parameter is purely an "out" parameter, so unless we need the
result, there is no need to pass anything in it.
Change-Id: Ic4eda8790edb1a6cb8837fe5b6c97c9c61cc25a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141089
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
that takes a SwPosition and keeps the nNode and nContent fields there in
sync.
this is part of the process of hiding the internals of SwPosition.
Change-Id: I1996e588703ca2400fa84e979c72cc5382e5b700
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140435
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
because they need to hook themselves into global rings, which results in
a lot of unnecessary pointer chasing
Change-Id: I27173c5f0d5e2998fdbfbb7781e2cbd1be6d14b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140065
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
entirely possible the divide by zero happens in a case where that
result isn't needed anyway
Change-Id: I3d4732903663f6cd76f525b46550b778790b05a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139724
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
It was not possible to delete tracked table row insertions,
if only those were selected, or if they were own insertions.
Regression from commit 95213407df
"tdf#146622 sw crash fix: don't delete already deleted rows".
Change-Id: Idd3bc78bca1c76bceba63cf339c6d8c73f8f9508
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139575
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>