diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-10-14 14:02:12 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-10-23 07:39:34 +0000 |
commit | 8110b255990baf650373dd88ef17390952a788a6 (patch) | |
tree | 9340c3b1aeb6e89818a2ab017a6e798e1017d558 | |
parent | e4acd26406056addac8c10e80d8cfaa48cedc7fc (diff) |
tdf#94386: envelope unit test completed
added check for different page styles with different size
to testTdf94386
Change-Id: I4eb1c8669661285d2c98f6c5e9993af26c005d45
Reviewed-on: https://gerrit.libreoffice.org/19371
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 6a54c5daffeb..c3091eb2162b 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -9,6 +9,7 @@ #include <swmodeltestbase.hxx> +#include <com/sun/star/awt/Size.hpp> #include <com/sun/star/form/validation/XValidatableFormComponent.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/drawing/TextVerticalAdjust.hpp> @@ -597,8 +598,28 @@ DECLARE_WW8EXPORT_TEST(testMoveRange, "fdo66304-1.odt") DECLARE_WW8EXPORT_TEST(testTdf94386, "tdf94386.odt") { - // TODO: assert here that the 2nd page has the right size even after - // the save as .doc + // check that the first and next page use different page styles + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier( + xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor( + xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + + xCursor->jumpToFirstPage(); + OUString firstPageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + xCursor->jumpToLastPage(); + OUString lastPageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + CPPUNIT_ASSERT_EQUAL(false, firstPageStyleName.equals(lastPageStyleName)); + + uno::Reference<beans::XPropertySet> xFirstPropertySet(getStyles("PageStyles")->getByName(firstPageStyleName), uno::UNO_QUERY); + awt::Size fSize; + xFirstPropertySet->getPropertyValue("Size") >>= fSize; + + uno::Reference<beans::XPropertySet> xNextPropertySet(getStyles("PageStyles")->getByName(lastPageStyleName), uno::UNO_QUERY); + awt::Size lSize; + xNextPropertySet->getPropertyValue("Size") >>= lSize; + bool isEqual = (fSize.Width == lSize.Width) || (fSize.Height == lSize.Height); + CPPUNIT_ASSERT_EQUAL(false, isEqual); } CPPUNIT_PLUGIN_IMPLEMENT(); |