summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-06-15 09:07:31 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-06-15 09:07:31 +0200
commitd0bedaf9eface97d17787931457f3ffc89ac4216 (patch)
treeb84c96129de1a912087cfc9cc0e806d82b00d920 /sw
parent97d3624d56323431939f28593da405adb1f39480 (diff)
tdf#84832 RTF export: fix handling of custom table cell margins
Change-Id: I3ed42ae4dc007c15d4649f57e1691534088549fc
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf84832.docxbin0 -> 11875 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx7
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx6
3 files changed, 8 insertions, 5 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf84832.docx b/sw/qa/extras/rtfexport/data/tdf84832.docx
new file mode 100644
index 000000000000..0e0da12635e8
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf84832.docx
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 33d6ca41f6d2..51274966e6f7 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -658,6 +658,13 @@ DECLARE_RTFEXPORT_TEST(testFdo74709, "fdo74709.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(360)), getProperty<sal_Int32>(xCell, "RightBorderDistance"));
}
+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)), getProperty<sal_Int32>(xCell, "LeftBorderDistance"));
+}
+
DECLARE_RTFEXPORT_TEST(testRelsize, "relsize.rtf")
{
uno::Reference<drawing::XShape> xShape = getShape(1);
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index a9061abc5aff..a09246a7e6ac 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -631,9 +631,6 @@ void RtfAttributeOutput::TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer
* called for each cell.
*/
- const SwTableBox* pTableBox = pTableTextNodeInfoInner->getTableBox();
- SwFrameFormat* pFormat = pTableBox->GetFrameFormat();
- const SvxBoxItem& rDefault = pFormat->GetBox();
const SwWriteTableRows& aRows = m_pTableWrt->GetRows();
SwWriteTableRow* pRow = aRows[ pTableTextNodeInfoInner->getRow() ];
const SwWriteTableCell* pCell = &pRow->GetCells()[ pTableTextNodeInfoInner->getCell() ];
@@ -664,8 +661,7 @@ void RtfAttributeOutput::TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer
{
if (const editeng::SvxBorderLine* pLn = rBox.GetLine(aBorders[i]))
m_aRowDefs.append(OutTBLBorderLine(m_rExport, pLn, aBorderNames[i]));
- if (rDefault.GetDistance(aBorders[i]) !=
- rBox.GetDistance(aBorders[i]))
+ if (rBox.GetDistance(aBorders[i]))
{
m_aRowDefs.append(aCellPadUnits[i]);
m_aRowDefs.append((sal_Int32)3);