[Libreoffice-commits] .: 2 commits - sw/qa

Miklos Vajna vmiklos at kemper.freedesktop.org
Tue May 15 01:38:06 PDT 2012


 sw/qa/extras/ooxmltok/data/fdo49940.docx |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx       |   15 +++++++++++++++
 sw/qa/extras/ww8tok/data/n760294.doc     |binary
 sw/qa/extras/ww8tok/ww8tok.cxx           |   17 +++++++++++++++++
 4 files changed, 32 insertions(+)

New commits:
commit 163e136650adba01382ec47e017d4b426aa49112
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue May 15 10:36:53 2012 +0200

    fdo#49940 testcase
    
    Change-Id: I3a6fc3bf2915699d886f3b8e966ae2718517d7bd

diff --git a/sw/qa/extras/ooxmltok/data/fdo49940.docx b/sw/qa/extras/ooxmltok/data/fdo49940.docx
new file mode 100644
index 0000000..2422844
Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/fdo49940.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 2c672d2..9e0473c 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -53,6 +53,7 @@ public:
     void testN751017();
     void testN750935();
     void testN757890();
+    void testFdo49940();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -61,6 +62,7 @@ public:
     CPPUNIT_TEST(testN751017);
     CPPUNIT_TEST(testN750935);
     CPPUNIT_TEST(testN757890);
+    CPPUNIT_TEST(testFdo49940);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -191,6 +193,19 @@ void Test::testN757890()
     CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue);
 }
 
+void Test::testFdo49940()
+{
+    load("fdo49940.docx");
+
+    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+    uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+    uno::Reference<beans::XPropertySet> xPara(xParaEnum->nextElement(), uno::UNO_QUERY);
+    OUString aValue;
+    xPara->getPropertyValue("PageStyleName") >>= aValue;
+    CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aValue);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 7d8077f2aea1f42ca19d5c685e64f597293f89bc
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue May 15 10:24:26 2012 +0200

    n#760294 testcase
    
    Change-Id: I52f063848c7bd63bdef73fb21eaad4256a14d128

diff --git a/sw/qa/extras/ww8tok/data/n760294.doc b/sw/qa/extras/ww8tok/data/n760294.doc
new file mode 100644
index 0000000..04960d0
Binary files /dev/null and b/sw/qa/extras/ww8tok/data/n760294.doc differ
diff --git a/sw/qa/extras/ww8tok/ww8tok.cxx b/sw/qa/extras/ww8tok/ww8tok.cxx
index 6a3ec74..dfc047e 100644
--- a/sw/qa/extras/ww8tok/ww8tok.cxx
+++ b/sw/qa/extras/ww8tok/ww8tok.cxx
@@ -28,8 +28,10 @@
 #include "../swmodeltestbase.hxx"
 
 #include <com/sun/star/table/BorderLine2.hpp>
+#include <com/sun/star/table/TableBorder.hpp>
 #include <com/sun/star/text/XDependentTextField.hpp>
 #include <com/sun/star/text/XTextFramesSupplier.hpp>
+#include <com/sun/star/text/XTextTablesSupplier.hpp>
 
 #include <vcl/svapp.hxx>
 
@@ -41,10 +43,12 @@ class Test : public SwModelTestBase
 {
 public:
     void testN757910();
+    void testN760294();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
     CPPUNIT_TEST(testN757910);
+    CPPUNIT_TEST(testN760294);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -76,6 +80,19 @@ void Test::testN757910()
     CPPUNIT_ASSERT(aBorder.LineWidth > 0);
 }
 
+void Test::testN760294()
+{
+    load("n760294.doc");
+
+    uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xTable(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+    table::TableBorder aTableBorder;
+    xTable->getPropertyValue("TableBorder") >>= aTableBorder;
+    CPPUNIT_ASSERT_EQUAL(aTableBorder.TopLine.InnerLineWidth, aTableBorder.TopLine.OuterLineWidth);
+    CPPUNIT_ASSERT_EQUAL(aTableBorder.TopLine.InnerLineWidth, aTableBorder.TopLine.LineDistance);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list