diff options
author | Justin Luth <justin_luth@sil.org> | 2015-09-07 08:19:22 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2015-10-17 13:50:51 +0000 |
commit | fbd1c167851a04c60d91daa830cf93e5b2ad7b4d (patch) | |
tree | 4805db732536a2a2819ad2565bc1ffd22300cea0 /sw/qa | |
parent | 1769074bd556e21e0c6ed29d9059960f998e28d1 (diff) |
tdf#36117 .doc preserve page vertical alignment after RT
MSWord has a page-style vertical alignment (center/bottom/justify)
setting that was lost after round-tripping through LibreOffice.
Writer does not currently have the ability to vertically align text
outside of a frame, but the setting should be preserved for
interoperability.
Change-Id: I91ae841b91ca2f2dd1b68212fdcdf830c7cef22a
Reviewed-on: https://gerrit.libreoffice.org/18480
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf36117_verticalAdjustment.doc | bin | 0 -> 27648 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf36117_verticalAdjustment.doc b/sw/qa/extras/ww8export/data/tdf36117_verticalAdjustment.doc Binary files differnew file mode 100644 index 000000000000..f7afd4191576 --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf36117_verticalAdjustment.doc diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 6c9b0077cbfd..6a54c5daffeb 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -11,6 +11,7 @@ #include <com/sun/star/form/validation/XValidatableFormComponent.hpp> #include <com/sun/star/frame/XStorable.hpp> +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> @@ -19,6 +20,7 @@ #include <com/sun/star/text/GraphicCrop.hpp> #include <com/sun/star/text/XFormField.hpp> #include <com/sun/star/view/DocumentZoomType.hpp> +#include <pagedesc.hxx> #include <sfx2/bindings.hxx> #include <sfx2/request.hxx> @@ -498,6 +500,31 @@ DECLARE_WW8EXPORT_TEST(testCommentedTable, "commented-table.doc") CPPUNIT_ASSERT_EQUAL(OUString("fore." SAL_NEWLINE_STRING "A1" SAL_NEWLINE_STRING "B1" SAL_NEWLINE_STRING "Afte"), xField->getAnchor()->getString()); } +DECLARE_WW8EXPORT_TEST(testTextVerticalAdjustment, "tdf36117_verticalAdjustment.doc") +{ + //Preserve the page vertical alignment setting for .doc + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT(pDoc); + + SwPageDesc &Desc = pDoc->GetPageDesc( 0 ); + drawing::TextVerticalAdjust nVA = Desc.GetVerticalAdjustment(); + CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_CENTER, nVA ); + + Desc = pDoc->GetPageDesc( 1 ); + nVA = Desc.GetVerticalAdjustment(); + CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_TOP, nVA ); + + Desc = pDoc->GetPageDesc( 2 ); + nVA = Desc.GetVerticalAdjustment(); + CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_BOTTOM, nVA ); + + Desc = pTextDoc->GetDocShell()->GetDoc()->GetPageDesc( 3 ); + nVA = Desc.GetVerticalAdjustment(); + CPPUNIT_ASSERT_EQUAL( drawing::TextVerticalAdjust_BLOCK, nVA ); +} + DECLARE_WW8EXPORT_TEST(testCommentExport, "comment-export.odt") { struct TextPortionInfo { |