summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-08-22 21:11:24 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-09-04 17:49:47 +0200
commit76ec8b52da8ffe8a21c223937c7dbe960f12ebda (patch)
treecff4036b0f5a5264401dd17bfaa9a07a277341c3 /sw/source/filter/ww8
parentf68f809261ca2c42227e0da3e0edd399f4955ae4 (diff)
tdf#135672 doc import: fix left table position
On round-tripping, the table was creeping left on each save. A follow-up commit handles growth creep. Why this specially added code is now wrong is unknown to me. I'm guessing that for docx, Writer was changed and doc format never picked up on that change. It looks like this probably happened already in OOo based on bibisect seeing this creep and table growth as far back as I can test. I really don't like just ripping out code like this, but the proof is in the pudding. Now several documents round-trip at the same position and size. Who can complain? See the bug report, which questions why this was added: commit 53d67a4e9f26689dbcce07f045ef6222bfadc27e Author: Caolán McNamara on Tue Oct 16 11:42:32 2001 +0000 #93253# Fix borders and positioning Change-Id: I3914bc84143a62f518542c10d19461e1edfadd17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101187 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx21
-rw-r--r--sw/source/filter/ww8/ww8par2.hxx3
2 files changed, 2 insertions, 22 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index d80ffa6f885d..74719297255b 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1772,7 +1772,6 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
m_nDefaultSwCols(0),
m_nBands(0),
m_nMinLeft(0),
- m_nConvertedLeft(0),
m_nMaxRight(0),
m_nSwWidth(0),
m_nPreferredWidth(0),
@@ -2231,9 +2230,7 @@ void WW8TabDesc::CalcDefaults()
// Non existent cells can reduce the number of columns.
// 3. pass: Replace border with defaults if needed
- m_nConvertedLeft = m_nMinLeft;
-
- short nLeftMaxThickness = 0, nRightMaxThickness=0;
+ short nRightMaxThickness=0;
for( pR = m_pFirstBand ; pR; pR = pR->pNextBand )
{
if( !pR->pTCs )
@@ -2292,26 +2289,10 @@ void WW8TabDesc::CalcDefaults()
if (nThickness > nRightMaxThickness)
nRightMaxThickness = nThickness;
}
-
- /*
- The left space of the table is in nMinLeft, but again this
- does not consider the margin thickness to its left in the
- placement value, so get the thickness of the left border,
- half is placed to the left of the nominal left side, and
- half to the right.
- */
- if ( ! pR->pTCs[0].rgbrc[1].fShadow() )
- {
- short nThickness = pR->pTCs[0].rgbrc[1].
- DetermineBorderProperties();
- if (nThickness > nLeftMaxThickness)
- nLeftMaxThickness = nThickness;
- }
}
}
m_nSwWidth = m_nSwWidth + nRightMaxThickness;
m_nMaxRight = m_nMaxRight + nRightMaxThickness;
- m_nConvertedLeft = m_nMinLeft-(nLeftMaxThickness/2);
for( pR = m_pFirstBand; pR; pR = pR->pNextBand )
{
diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx
index ba22f768232e..bd3de34179b4 100644
--- a/sw/source/filter/ww8/ww8par2.hxx
+++ b/sw/source/filter/ww8/ww8par2.hxx
@@ -220,7 +220,6 @@ class WW8TabDesc
short m_nDefaultSwCols;
short m_nBands;
short m_nMinLeft;
- short m_nConvertedLeft;
short m_nMaxRight;
short m_nSwWidth;
short m_nPreferredWidth;
@@ -278,7 +277,7 @@ public:
void ParkPaM();
void FinishSwTable();
void MergeCells();
- short GetMinLeft() const { return m_nConvertedLeft; }
+ short GetMinLeft() const { return m_nMinLeft; }
~WW8TabDesc();
const WW8_TCell* GetCurrentWWCell() const { return m_pCurrentWWCell; }