summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-09-28 18:34:31 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-20 13:20:41 +0200
commit889547390ceeb8b5474f4a6245c07120e513da3f (patch)
tree901b3df3d69ac39b7e8450ff3973c4003fc6fa75
parent991034aad06e7d2b6e8e00b7ccdd8f286b776da3 (diff)
tdf#55528 ww8export: export table width percent
Confirmed in MSO 2003 and MSO2013. Change-Id: I91362571294c3869ecd7c5fd37d2f781e2655fe6 Reviewed-on: https://gerrit.libreoffice.org/42919 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx1
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx9
2 files changed, 9 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index 88509caf81d6..94039067e58d 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -59,7 +59,6 @@ DECLARE_WW8EXPORT_TEST(testTdf55528_relativeTableWidth, "tdf55528_relativeTableW
uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
-if ( !mbExported )
CPPUNIT_ASSERT_EQUAL_MESSAGE("Table relative width percent", sal_Int16(98), getProperty<sal_Int16>(xTable, "RelativeWidth"));
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index ea0152abefdd..6781ac5576f5 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2414,6 +2414,15 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
SAL_INFO( "sw.ww8.level2", "<tclength>" << ( m_rWW8Export.pO->size() - npOCount ) << "</tclength>" );
}
+
+ int nWidthPercent = pFormat->GetFrameSize().GetWidthPercent();
+ // Width is in fiftieths of a percent. For sprmTTableWidth, must be non-negative and 600% max
+ if ( nWidthPercent > 0 && nWidthPercent <= 600 )
+ {
+ m_rWW8Export.InsUInt16( NS_sprm::sprmTTableWidth );
+ m_rWW8Export.pO->push_back( (sal_uInt8) /*ftsPercent*/ 2 );
+ m_rWW8Export.InsUInt16( (sal_uInt16) nWidthPercent * 50 );
+ }
}
ww8::GridColsPtr AttributeOutputBase::GetGridCols( ww8::WW8TableNodeInfoInner::Pointer_t const & pTableTextNodeInfoInner )