[Libreoffice-commits] core.git: sw/qa sw/source

Oliver Specht oliver.specht at cib.de
Mon Sep 28 07:45:57 PDT 2015


 sw/qa/extras/odfexport/data/border_types.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx         |   34 +++++++++++++++++++++++++++
 sw/qa/extras/odfimport/odfimport.cxx         |   17 +++----------
 sw/source/filter/xml/xmlexpit.cxx            |   12 +++++++++
 sw/source/filter/xml/xmlithlp.cxx            |   10 +++++++
 5 files changed, 59 insertions(+), 14 deletions(-)

New commits:
commit ac84e4ff6135d51461122e0e1b5b39614b3e6eca
Author: Oliver Specht <oliver.specht at cib.de>
Date:   Fri Sep 11 12:28:10 2015 +0200

    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 at libreoffice.org>
    Reviewed-by: Oliver Specht <oliver.specht at cib.de>

diff --git a/sw/qa/extras/odfexport/data/border_types.odt b/sw/qa/extras/odfexport/data/border_types.odt
new file mode 100755
index 0000000..97b7243
Binary files /dev/null and b/sw/qa/extras/odfexport/data/border_types.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index bfb24d1..7ab88cc 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 2f8239c..3e06930 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 f1a9a2c..6a74e1b 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 d97fd0f..2ad46ab 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 },


More information about the Libreoffice-commits mailing list