diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-16 16:23:13 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-08-16 19:53:32 +0200 |
commit | cea495b0dbb6dcace3a3b46f88f7084d127c0482 (patch) | |
tree | 16689645a8accc41b17abd4ae8605b3504880099 /sw | |
parent | eeae7bf241ce34ac5b946a6b55a53c3f3a1c3d12 (diff) |
DOCX export: implement wrap distance of Writer textframes
Change-Id: Ia4a36f18495de9f8a2fb0d2b6691231c7bcbcce4
Diffstat (limited to 'sw')
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/table-floating-margins.docx | bin | 0 -> 14346 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 4 |
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/table-floating-margins.docx b/sw/qa/extras/ooxmlexport/data/table-floating-margins.docx Binary files differnew file mode 100755 index 000000000000..81f6f6cf1ffa --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-floating-margins.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index fc55bb973e70..c5b141973d7a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -107,6 +107,7 @@ public: void testFdo64350(); void testFdo67013(); void testParaShadow(); + void testTableFloatingMargins(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -190,6 +191,7 @@ void Test::run() {"fdo64350.docx", &Test::testFdo64350}, {"fdo67013.docx", &Test::testFdo67013}, {"para-shadow.docx", &Test::testParaShadow}, + {"table-floating-margins.docx", &Test::testTableFloatingMargins}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -1146,6 +1148,16 @@ void Test::testParaShadow() CPPUNIT_ASSERT_EQUAL(sal_Int16(TWIP_TO_MM100(24/8*20)), aShadow.ShadowWidth); } +void Test::testTableFloatingMargins() +{ + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + // These were 0, due to lack of import/export. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xFrame, "TopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2000), getProperty<sal_Int32>(xFrame, "BottomMargin")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a6904cec1898..dd88b386b9f2 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4681,6 +4681,8 @@ void DocxAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) if (m_bTextFrameSyntax) { + m_aTextFrameStyle.append(";mso-wrap-distance-left:").append(double(rLRSpace.GetLeft()) / 20).append("pt"); + m_aTextFrameStyle.append(";mso-wrap-distance-right:").append(double(rLRSpace.GetRight()) / 20).append("pt"); } else if ( m_rExport.bOutFlyFrmAttrs ) { @@ -4735,6 +4737,8 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) if (m_bTextFrameSyntax) { + m_aTextFrameStyle.append(";mso-wrap-distance-top:").append(double(rULSpace.GetUpper()) / 20).append("pt"); + m_aTextFrameStyle.append(";mso-wrap-distance-bottom:").append(double(rULSpace.GetLower()) / 20).append("pt"); } else if ( m_rExport.bOutFlyFrmAttrs ) { |