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

Varun varun.dhall at studentpartner.com
Mon Jul 6 13:04:56 PDT 2015


 sw/qa/extras/uiwriter/uiwriter.cxx |   36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

New commits:
commit c12c1b15eaa2310b1e04d0585c009e7c9bf45793
Author: Varun <varun.dhall at studentpartner.com>
Date:   Mon Jul 6 19:49:11 2015 +0530

    Added Test for tdf#81995 check outline numbering
    
    Change-Id: I0a35a010d3edc8caea30e16813c937f1fa4d3ac8
    Reviewed-on: https://gerrit.libreoffice.org/16797
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 980184d..8bbf6eb 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -36,6 +36,7 @@
 #include <unocrsrhelper.hxx>
 #include <unotbl.hxx>
 #include <pagedesc.hxx>
+#include "com/sun/star/text/XDefaultNumberingProvider.hpp"
 
 #include <svx/svdpage.hxx>
 #include <svx/svdview.hxx>
@@ -98,6 +99,7 @@ public:
     void testTdf90003();
     void testTdf51741();
     void testdelofTableRedlines();
+    void testTdf81995();
     void testExportToPicture();
     void testTdf69282();
     void testTdf69282WithMirror();
@@ -149,6 +151,7 @@ public:
     CPPUNIT_TEST(testTdf90003);
     CPPUNIT_TEST(testTdf51741);
     CPPUNIT_TEST(testdelofTableRedlines);
+    CPPUNIT_TEST(testTdf81995);
     CPPUNIT_TEST(testExportToPicture);
     CPPUNIT_TEST(testTdf69282);
     CPPUNIT_TEST(testTdf69282WithMirror);
@@ -1003,6 +1006,39 @@ void SwUiWriterTest::testdelofTableRedlines()
     CPPUNIT_ASSERT(redtbl.IsEmpty());
 }
 
+void SwUiWriterTest::testTdf81995()
+{
+    uno::Reference<text::XDefaultNumberingProvider> xDefNum(m_xSFactory->createInstance("com.sun.star.text.DefaultNumberingProvider"), uno::UNO_QUERY);
+    com::sun::star::lang::Locale alocale;
+    alocale.Language = OUString("en");
+    alocale.Country = OUString("US");
+    uno::Sequence<uno::Reference<container::XIndexAccess>> aIndexAccess(xDefNum->getDefaultOutlineNumberings(alocale));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aIndexAccess.getLength());
+    for(int i=0;i<aIndexAccess.getLength();i++)
+    {
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aIndexAccess[i]->getCount());
+        for(int j=0;j<aIndexAccess[i]->getCount();j++)
+        {
+            uno::Sequence<beans::PropertyValue> aProps;
+            aIndexAccess[i]->getByIndex(j) >>= aProps;
+            CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aProps.getLength());
+            for(int k=0;k<aProps.getLength();k++)
+            {
+                const beans::PropertyValue& rProp = aProps[k];
+                uno::Any aAny = rProp.Value;
+                if(rProp.Name == "Prefix" || rProp.Name == "Suffix" || rProp.Name == "BulletChar" || rProp.Name == "BulletFontName" || rProp.Name == "Transliteration")
+                    CPPUNIT_ASSERT_EQUAL(OUString("string"), aAny.getValueTypeName());
+                else if(rProp.Name == "NumberingType" || rProp.Name == "ParentNumbering" || rProp.Name == "Adjust")
+                    CPPUNIT_ASSERT_EQUAL(OUString("short"), aAny.getValueTypeName());
+                else if(rProp.Name == "LeftMargin" || rProp.Name == "SymbolTextDistance" || rProp.Name == "FirstLineOffset" || rProp.Name == "NatNum")
+                    CPPUNIT_ASSERT_EQUAL(OUString("long"), aAny.getValueTypeName());
+                else
+                    CPPUNIT_FAIL("Property Name not matched");
+            }
+        }
+    }
+}
+
 void SwUiWriterTest::testExportToPicture()
 {
     createDoc();


More information about the Libreoffice-commits mailing list