summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVarun <varun.dhall@studentpartner.com>2015-07-06 19:49:11 +0530
committerMichael Stahl <mstahl@redhat.com>2015-07-06 20:04:06 +0000
commitc12c1b15eaa2310b1e04d0585c009e7c9bf45793 (patch)
tree5e05e5920b32fb3c3cda58db316971265bf39007 /sw
parent36a77b748a0b1d35ce72b2e14d1daa158d5f7c4b (diff)
Added Test for tdf#81995 check outline numbering
Change-Id: I0a35a010d3edc8caea30e16813c937f1fa4d3ac8 Reviewed-on: https://gerrit.libreoffice.org/16797 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 980184d9f223..8bbf6ebf47b3 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();