diff options
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf135672_tableGrows.doc | bin | 0 -> 10240 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 21 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.hxx | 3 |
4 files changed, 13 insertions, 22 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf135672_tableGrows.doc b/sw/qa/extras/ww8export/data/tdf135672_tableGrows.doc Binary files differnew file mode 100644 index 000000000000..a2ae57def0c1 --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf135672_tableGrows.doc diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 81dea2f98188..6f1731eddc71 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -225,6 +225,17 @@ DECLARE_WW8EXPORT_TEST(testTdf73056_cellMargins, "tdf73056_cellMargins.doc") CPPUNIT_ASSERT_EQUAL_MESSAGE( "bottom cell spacing to contents", sal_Int32(101), getProperty<sal_Int32>(xPropSet, "BottomBorderDistance" ) ); } + +DECLARE_WW8EXPORT_TEST(testTdf135672_tableGrows, "tdf135672_tableGrows.doc") +{ + auto const xTable(getParagraphOrTable(1)); + // This would shift left every round-trip. First time was -259, next -418. + CPPUNIT_ASSERT_EQUAL(sal_Int32(-101), getProperty<sal_Int32>(xTable, "LeftMargin")); + + // This would grow every round-trip. First time was 11118, next 11435 + //CPPUNIT_ASSERT_EQUAL(sal_Int32(10800), getProperty<sal_Int32>(xTable, "Width")); +} + DECLARE_WW8EXPORT_TEST(testTdf79435_legacyInputFields, "tdf79435_legacyInputFields.docx") { //using .docx input file to verify cross-format compatibility. 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; } |