diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-09-11 12:28:10 +0200 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2015-09-28 14:45:36 +0000 |
commit | ac84e4ff6135d51461122e0e1b5b39614b3e6eca (patch) | |
tree | 727c242513fcd2b9edb7036286b880919db54fee /sw/qa | |
parent | ee9b3c1f1cb7445f0a7e76736e32fe81878f8d00 (diff) |
tdf#94011: load&save more border types
supported dash_dot, dash_dot_dot and double_thin border types
added export test
enabled odf import tests on Windows
except for testFdo37606Copy because it fails
Change-Id: Ia9c7a030956326b33e9f07eaa57c11aaa8e0a6fd
Reviewed-on: https://gerrit.libreoffice.org/18495
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'sw/qa')
-rwxr-xr-x | sw/qa/extras/odfexport/data/border_types.odt | bin | 0 -> 10656 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 34 | ||||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 17 |
3 files changed, 38 insertions, 13 deletions
diff --git a/sw/qa/extras/odfexport/data/border_types.odt b/sw/qa/extras/odfexport/data/border_types.odt Binary files differnew file mode 100755 index 000000000000..97b72436f0bb --- /dev/null +++ b/sw/qa/extras/odfexport/data/border_types.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index bfb24d10ec25..7ab88cc2fe3f 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -16,6 +16,7 @@ #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/table/ShadowFormat.hpp> +#include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/XDocumentIndex.hpp> #include <com/sun/star/drawing/TextVerticalAdjust.hpp> @@ -706,6 +707,39 @@ DECLARE_ODFEXPORT_TEST(testGerrit13858, "gerrit13858.odt") { // Just make sure the output is valid. } +DECLARE_ODFEXPORT_TEST(testOdtBorderTypes, "border_types.odt") +{ + static const sal_Int32 lineStyles[] = { 0, 1, 2, 14, 16, 17, 3, 15 }; + uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + do + { + uno::Reference<lang::XServiceInfo> xServiceInfo; + if (xParaEnum->nextElement() >>= xServiceInfo) + { + if (xServiceInfo->supportsService("com.sun.star.text.TextTable")) + { + uno::Reference<table::XCellRange> const xCellRange(xServiceInfo, uno::UNO_QUERY_THROW); + + for (sal_Int32 row = 0; row < 15; row += 2) + { + uno::Reference<table::XCell> xCell = xCellRange->getCellByPosition(1, row); + uno::Reference< beans::XPropertySet > xPropSet(xCell, uno::UNO_QUERY_THROW); + + uno::Any aTopBorder = xPropSet->getPropertyValue("TopBorder"); + table::BorderLine2 aTopBorderLine; + if (aTopBorder >>= aTopBorderLine) + { + sal_Int32 lineStyle = aTopBorderLine.LineStyle; + CPPUNIT_ASSERT_EQUAL(lineStyles[row / 2], lineStyle); + } + } //end of the 'for' loop + } + } + } while (xParaEnum->hasMoreElements()); +} #endif diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 2f8239ccfb20..3e069305baf3 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -9,14 +9,14 @@ #include <swmodeltestbase.hxx> -#if !defined(WNT) - #include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/BitmapMode.hpp> #include <com/sun/star/style/PageStyleLayout.hpp> #include <com/sun/star/table/XCell.hpp> +#include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/table/BorderLine.hpp> +#include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/text/XTextSection.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/PageNumberType.hpp> @@ -498,7 +498,7 @@ DECLARE_ODFIMPORT_TEST(testFdo37606, "fdo37606.odt") CPPUNIT_ASSERT(!pContentNode->FindTableNode()); } } - +#if !defined(WNT) DECLARE_ODFIMPORT_TEST(testFdo37606Copy, "fdo37606.odt") { SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get()); @@ -527,7 +527,7 @@ DECLARE_ODFIMPORT_TEST(testFdo37606Copy, "fdo37606.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount()); #endif } - +#endif //WNT DECLARE_ODFIMPORT_TEST(testFdo69862, "fdo69862.odt") { // The test doc is special in that it starts with a table and it also has a footnote. @@ -631,14 +631,5 @@ DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt") CPPUNIT_ASSERT(getProperty<bool>(getParagraph(2), "ParaKeepTogether")); } -DECLARE_ODFIMPORT_TEST(testTdf92586, "tdf92586.odt") -{ - uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - // This was BitmapMode_NO_REPEAT. - CPPUNIT_ASSERT_EQUAL(drawing::BitmapMode_STRETCH, getProperty<drawing::BitmapMode>(xPageStyle, "FillBitmapMode")); -} - -#endif - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |