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 | |
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>
-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 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlithlp.cxx | 10 |
5 files changed, 59 insertions, 14 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: */ diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index f1a9a2ce56d4..6a74e1b85d68 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -744,6 +744,18 @@ bool SvXMLExportItemMapper::QueryXMLValue( case table::BorderLineStyle::DASHED: eStyle = XML_DASHED; break; + case table::BorderLineStyle::FINE_DASHED: + eStyle = XML_FINE_DASHED; + break; + case table::BorderLineStyle::DASH_DOT: + eStyle = XML_DASH_DOT; + break; + case table::BorderLineStyle::DASH_DOT_DOT: + eStyle = XML_DASH_DOT_DOT; + break; + case table::BorderLineStyle::DOUBLE_THIN: + eStyle = XML_DOUBLE_THIN; + break; case table::BorderLineStyle::DOUBLE: case table::BorderLineStyle::THINTHICK_SMALLGAP: case table::BorderLineStyle::THINTHICK_MEDIUMGAP: diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx index d97fd0f54304..2ad46ab74ee5 100644 --- a/sw/source/filter/xml/xmlithlp.cxx +++ b/sw/source/filter/xml/xmlithlp.cxx @@ -49,6 +49,10 @@ using namespace ::com::sun::star; #define API_LINE_ENGRAVED 11 #define API_LINE_OUTSET 12 #define API_LINE_INSET 13 +#define API_LINE_FINE_DASHED table::BorderLineStyle::FINE_DASHED +#define API_LINE_DASH_DOT table::BorderLineStyle::DASH_DOT +#define API_LINE_DASH_DOT_DOT table::BorderLineStyle::DASH_DOT_DOT +#define API_LINE_DOUBLE_THIN table::BorderLineStyle::DOUBLE_THIN #define SVX_XML_BORDER_WIDTH_THIN 0 #define SVX_XML_BORDER_WIDTH_MIDDLE 1 @@ -60,9 +64,13 @@ const struct SvXMLEnumMapEntry psXML_BorderStyles[] = { XML_HIDDEN, API_LINE_NONE }, { XML_SOLID, API_LINE_SOLID }, { XML_DOUBLE, API_LINE_DOUBLE }, + { XML_DOUBLE_THIN, API_LINE_DOUBLE_THIN }, { XML_DOTTED, API_LINE_DOTTED }, { XML_DASHED, API_LINE_DASHED }, - { XML_GROOVE, API_LINE_ENGRAVED }, + { XML_FINE_DASHED, API_LINE_FINE_DASHED }, + { XML_DASH_DOT, API_LINE_DASH_DOT }, + { XML_DASH_DOT_DOT, API_LINE_DASH_DOT_DOT }, + { XML_GROOVE, API_LINE_ENGRAVED }, { XML_RIDGE, API_LINE_EMBOSSED }, { XML_INSET, API_LINE_INSET }, { XML_OUTSET, API_LINE_OUTSET }, |