summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx14
-rw-r--r--writerfilter/source/dmapper/CellMarginHandler.cxx2
3 files changed, 12 insertions, 7 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 7fe5f86ff7ef..2c9812c121cf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -1071,6 +1071,9 @@ DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" )
aLeftBorder >>= aLeftBorderLine;
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Incorrect left spacing computed from docx cell margin",
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 );
}
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index c8e690ac7b9e..a9ef70d22119 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3144,6 +3144,13 @@ static void impl_cellMargins( FSHelperPtr const & pSerializer, const SvxBoxItem&
{
sal_Int32 nDist = sal_Int32( rBox.GetDistance( *pBrd ) );
+ if (pDefaultMargins)
+ {
+ // Skip output if cell margin == table default margin
+ if (sal_Int32( pDefaultMargins->GetDistance( *pBrd ) ) == nDist)
+ 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.
@@ -3153,13 +3160,6 @@ static void impl_cellMargins( FSHelperPtr const & pSerializer, const SvxBoxItem&
nDist -= pLn->GetWidth() * 0.5;
}
- if (pDefaultMargins)
- {
- // Skip output if cell margin == table default margin
- if (sal_Int32( pDefaultMargins->GetDistance( *pBrd ) ) == nDist)
- continue;
- }
-
if (!tagWritten) {
pSerializer->startElementNS( XML_w, tag, FSEND );
tagWritten = true;
diff --git a/writerfilter/source/dmapper/CellMarginHandler.cxx b/writerfilter/source/dmapper/CellMarginHandler.cxx
index d1e20d2ee3a8..194e9e2722ec 100644
--- a/writerfilter/source/dmapper/CellMarginHandler.cxx
+++ b/writerfilter/source/dmapper/CellMarginHandler.cxx
@@ -108,6 +108,7 @@ void CellMarginHandler::lcl_sprm(Sprm & rSprm)
createGrabBag("top");
break;
case NS_ooxml::LN_CT_TblCellMar_start:
+ case NS_ooxml::LN_CT_TcMar_start:
if( rtl )
{
m_nRightMargin = m_nValue;
@@ -133,6 +134,7 @@ void CellMarginHandler::lcl_sprm(Sprm & rSprm)
createGrabBag("bottom");
break;
case NS_ooxml::LN_CT_TblCellMar_end:
+ case NS_ooxml::LN_CT_TcMar_end:
if( rtl )
{
m_nLeftMargin = m_nValue;