diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-16 18:00:45 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-16 19:53:32 +0200 |
commit | 5d0c83fd4cf91083805f60f49e4fafd3d6ac73d4 (patch) | |
tree | 98fc6da2e4507d2de93da9c2d848b9c23feb76de /sw | |
parent | c8b68f7d63df9335ab4ef90441d3d2815bb4ddd6 (diff) |
tdf#119885: OOXML import: try to get cell paddings as Word does
Change-Id: I7abd715b6bb71d6e2e01939c4cf849d94eb6a103
Reviewed-on: https://gerrit.libreoffice.org/61843
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 13 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 9 |
3 files changed, 13 insertions, 11 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 4db28720e0fa..794a76245525 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -1160,7 +1160,18 @@ DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" ) cellLeftMarginFromOffice[i], aLeftMargin - 0.5 * aLeftBorderLine.LineWidth, 1 ); // The 'a' in the fourth table should not be partly hidden by the border if ( i == 3 ) - CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Incorrect cell padding", 0.5 * aLeftBorderLine.LineWidth, aLeftMargin, 1 ); + { + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect cell left padding", + 0.5 * aLeftBorderLine.LineWidth, aLeftMargin, 1); + // tdf#119885: cell's edit area must touch right border + sal_Int32 aRightMargin = -1; + xPropSet->getPropertyValue("RightBorderDistance") >>= aRightMargin; + uno::Any aRightBorder = xPropSet->getPropertyValue("RightBorder"); + table::BorderLine2 aRightBorderLine; + aRightBorder >>= aRightBorderLine; + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect cell right padding", + 0.5 * aRightBorderLine.LineWidth, aRightMargin, 1); + } } } diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 009cd00eb14d..8b6ecdb27f85 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -754,7 +754,7 @@ DECLARE_RTFEXPORT_TEST(testTdf84832, "tdf84832.docx") { uno::Reference<table::XCell> xCell = getCell(getParagraphOrTable(2), "A1"); // This was 0, as left padding wasn't exported. - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(113)), + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(108)), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0c9e4a04c63b..3d539978f096 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3175,15 +3175,6 @@ static void impl_cellMargins( FSHelperPtr const & pSerializer, const SvxBoxItem& continue; } - if ( aBorders[i] == SvxBoxItemLine::LEFT ) { - // Office's cell margin is measured from the right of the border. - // While LO's cell spacing is measured from the center of the border. - // So we add half left-border width to tblIndent value - const SvxBorderLine* pLn = rBox.GetLine( *pBrd ); - if (pLn) - nDist -= pLn->GetWidth() * 0.5; - } - if (!tagWritten) { pSerializer->startElementNS( XML_w, tag, FSEND ); tagWritten = true; |