summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-12-22 06:57:05 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-12-22 06:57:45 +0100
commit319ba046b3a1266b20661116d742779417d38cbf (patch)
treeef20645d018f77ac02ea6570f187da62f58ae5cb /sc/qa/unit
parentb241910325456b32c2d3614c2e200305e85a357c (diff)
add import test for xlsb
Change-Id: Ieb01027851b423287681f0145d3a39f98fc97f88
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/xlsb/universal-content.xlsbbin0 -> 11087 bytes
-rw-r--r--sc/qa/unit/filters-test.cxx12
-rw-r--r--sc/qa/unit/helper/qahelper.cxx3
-rw-r--r--sc/qa/unit/helper/qahelper.hxx2
4 files changed, 16 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xlsb/universal-content.xlsb b/sc/qa/unit/data/xlsb/universal-content.xlsb
new file mode 100644
index 000000000000..fd9c253ef75c
--- /dev/null
+++ b/sc/qa/unit/data/xlsb/universal-content.xlsb
Binary files differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index fab94ba40af9..3e3b02b96d1a 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -72,6 +72,7 @@ public:
void testContentXLSXStrict(); // strict OOXML
void testContentLotus123();
void testContentDIF();
+ void testContentXLSB();
//void testContentXLS_XML();
void testSharedFormulaXLS();
void testSharedFormulaXLSX();
@@ -93,6 +94,7 @@ public:
CPPUNIT_TEST(testContentXLSXStrict);
CPPUNIT_TEST(testContentLotus123);
CPPUNIT_TEST(testContentDIF);
+ CPPUNIT_TEST(testContentXLSB);
//CPPUNIT_TEST(testContentXLS_XML);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testSharedFormulaXLSX);
@@ -301,6 +303,16 @@ void ScFiltersTest::testContentDIF()
xDocSh->DoClose();
}
+void ScFiltersTest::testContentXLSB()
+{
+ ScDocShellRef xDocSh = loadDoc("universal-content.", XLSB);
+ xDocSh->DoHardRecalc(true);
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ testContentImpl(rDoc, XLSB);
+ xDocSh->DoClose();
+}
+
// void ScFiltersTest::testContentXLS_XML()
// {
// ScDocShellRef xDocSh = loadDoc("universal-content.", XLS_XML);
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 2b183ebe3582..9713eac2a624 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -74,7 +74,8 @@ FileFormat aFileFormats[] = {
{ "html" , "calc_HTML_WebQuery", "generic_HTML", HTML_FORMAT_TYPE },
{ "123" , "Lotus", "calc_Lotus", LOTUS123_FORMAT_TYPE },
{ "dif", "DIF", "calc_DIF", DIF_FORMAT_TYPE },
- { "xml", "MS Excel 2003 XML", "calc_MS_Excel_2003_XML", XLS_XML_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 }
};
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 30a655dc56d0..f204dba50cd3 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -48,6 +48,7 @@
#define HTML_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_USESOPTIONS)
#define DIF_FORMAT_TYPE 195
#define XLS_XML_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN)
+#define XLSB_XML_FORMAT_TYPE 268959809
#define ODS 0
#define XLS 1
@@ -58,6 +59,7 @@
#define LOTUS123 6
#define DIF 7
#define XLS_XML 8
+#define XLSB 9
enum StringType { PureString, FormulaValue, StringValue };