add basic universal content test, tdf#107828

Change-Id: Ifb2a867cf2168a5ebf51d4a408d2e2a29032a764
Reviewed-on: https://gerrit.libreoffice.org/37580
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
diff --git a/sc/qa/unit/data/gnumeric/universal-content.gnumeric b/sc/qa/unit/data/gnumeric/universal-content.gnumeric
new file mode 100644
index 0000000..440c2fe
--- /dev/null
+++ b/sc/qa/unit/data/gnumeric/universal-content.gnumeric
Binary files differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 0548f10..ec5f4cb 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -74,6 +74,7 @@ public:
    void testContentDIF();
    void testContentXLSB();
    void testContentXLS_XML();
    void testContentGnumeric();
    void testSharedFormulaXLS();
    void testSharedFormulaXLSX();
    void testSheetNamesXLSX();
@@ -96,6 +97,7 @@ public:
    CPPUNIT_TEST(testContentDIF);
    CPPUNIT_TEST(testContentXLSB);
    CPPUNIT_TEST(testContentXLS_XML);
    CPPUNIT_TEST(testContentGnumeric);
    CPPUNIT_TEST(testSharedFormulaXLS);
    CPPUNIT_TEST(testSharedFormulaXLSX);
    CPPUNIT_TEST(testSheetNamesXLSX);
@@ -230,7 +232,8 @@ void testContentImpl(ScDocument& rDoc, sal_Int32 nFormat ) //same code for ods, 
    ASSERT_DOUBLES_EQUAL_MESSAGE("=C1+C2", 11.0, fValue);

    //check merged cells import
    if (nFormat != FORMAT_LOTUS123 && nFormat != FORMAT_DIF && nFormat != FORMAT_XLS_XML)
    if (nFormat != FORMAT_LOTUS123 && nFormat != FORMAT_DIF && nFormat != FORMAT_XLS_XML
            && nFormat != FORMAT_GNUMERIC)
    {
        SCCOL nCol = 4;
        SCROW nRow = 1;
@@ -327,6 +330,16 @@ void ScFiltersTest::testContentXLS_XML()
    xDocSh->DoClose();
}

void ScFiltersTest::testContentGnumeric()
{
    ScDocShellRef xDocSh = loadDoc("universal-content.", FORMAT_GNUMERIC);
    CPPUNIT_ASSERT(xDocSh.is());

    ScDocument& rDoc = xDocSh->GetDocument();
    testContentImpl(rDoc, FORMAT_GNUMERIC);
    xDocSh->DoClose();
}

void ScFiltersTest::testSharedFormulaXLS()
{
    ScDocShellRef xDocSh = loadDoc("shared-formula/basic.", FORMAT_XLS);
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index c8ac345..5f37dd9 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -82,7 +82,8 @@ const FileFormat ScBootstrapFixture::aFileFormats[] = {
    { "dif", "DIF", "calc_DIF", DIF_FORMAT_TYPE },
    { "xml", "MS Excel 2003 XML", "calc_MS_Excel_2003_XML", XLS_XML_FORMAT_TYPE },
    { "xlsb", "Calc MS Excel 2007 Binary", "MS Excel 2007 Binary", XLSB_XML_FORMAT_TYPE },
    { "fods", "OpenDocument Spreadsheet Flat XML", "calc_ODS_FlatXML", FODS_FORMAT_TYPE }
    { "fods", "OpenDocument Spreadsheet Flat XML", "calc_ODS_FlatXML", FODS_FORMAT_TYPE },
    { "gnumeric", "Gnumeric Spreadsheet", "Gnumerix XML", GNUMERIC_FORMAT_TYPE }
};

bool testEqualsWithTolerance( long nVal1, long nVal2, long nTol )
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index cc4f5d40..4e93f96 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -52,6 +52,7 @@
#define XLS_XML_FORMAT_TYPE  (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::STARONEFILTER)
#define XLSB_XML_FORMAT_TYPE (SfxFilterFlags::IMPORT |                          SfxFilterFlags::ALIEN | SfxFilterFlags::STARONEFILTER | SfxFilterFlags::PREFERED)
#define FODS_FORMAT_TYPE     (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::OWN | SfxFilterFlags::STARONEFILTER )
#define GNUMERIC_FORMAT_TYPE (SfxFilterFlags::IMPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::PREFERED )

#define FORMAT_ODS      0
#define FORMAT_XLS      1
@@ -64,6 +65,7 @@
#define FORMAT_XLS_XML  8
#define FORMAT_XLSB     9
#define FORMAT_FODS     10
#define FORMAT_GNUMERIC 11

enum class StringType { PureString, StringValue };