summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 14:29:29 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 14:36:59 +0200
commitce565ff09743c52a08dffc28b9639d657d56bee2 (patch)
treed09a83705393329688367013d4a8550844d5754d /sc/qa
parentfd2f96c2ff83bee968fec8aa7c402ae02e78e2e4 (diff)
add disabled test for Excel 2003 XML import
Change-Id: I5c6ff3a79357ce37b220bd7cad64a3783bc7dc55
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xml/universal-content.xml119
-rw-r--r--sc/qa/unit/filters-test.cxx13
-rw-r--r--sc/qa/unit/helper/qahelper.cxx1
-rw-r--r--sc/qa/unit/helper/qahelper.hxx2
4 files changed, 135 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xml/universal-content.xml b/sc/qa/unit/data/xml/universal-content.xml
new file mode 100644
index 000000000000..828af6039fa9
--- /dev/null
+++ b/sc/qa/unit/data/xml/universal-content.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <Author>moggi</Author>
+ <LastAuthor>moggi</LastAuthor>
+ <Created>2013-09-05T11:50:47Z</Created>
+ <Version>14.00</Version>
+ </DocumentProperties>
+ <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
+ <AllowPNG/>
+ </OfficeDocumentSettings>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+ <WindowHeight>8190</WindowHeight>
+ <WindowWidth>16380</WindowWidth>
+ <WindowTopX>0</WindowTopX>
+ <WindowTopY>0</WindowTopY>
+ <TabRatio>141</TabRatio>
+ <ProtectStructure>False</ProtectStructure>
+ <ProtectWindows>False</ProtectWindows>
+ </ExcelWorkbook>
+ <Styles>
+ <Style ss:ID="Default" ss:Name="Normal">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Font ss:FontName="Arial" x:Family="Swiss"/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ </Styles>
+ <Worksheet ss:Name="Sheet1">
+ <Table ss:ExpandedColumnCount="8" ss:ExpandedRowCount="4" x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="60.75">
+ <Row>
+ <Cell>
+ <Data ss:Type="Number">1</Data>
+ </Cell>
+ <Cell>
+ <Data ss:Type="String">String1</Data>
+ </Cell>
+ <Cell ss:Formula="=2*3">
+ <Data ss:Type="Number">6</Data>
+ </Cell>
+ </Row>
+ <Row>
+ <Cell>
+ <Data ss:Type="Number">2</Data>
+ </Cell>
+ <Cell>
+ <Data ss:Type="String">String2</Data>
+ </Cell>
+ <Cell ss:Formula="=2+3">
+ <Data ss:Type="Number">5</Data>
+ </Cell>
+ <Cell ss:Index="5" ss:MergeAcross="1" ss:MergeDown="1"/>
+ </Row>
+ <Row>
+ <Cell ss:Index="3" ss:Formula="=2-3">
+ <Data ss:Type="Number">-1</Data>
+ </Cell>
+ <Cell ss:Index="8">
+ <Comment ss:Author="">
+ <ss:Data xmlns="http://www.w3.org/TR/REC-html40">
+ <Font html:Face="Tahoma" x:CharSet="1" html:Size="9" html:Color="#000000">Test</Font>
+ </ss:Data>
+ </Comment>
+ </Cell>
+ </Row>
+ <Row>
+ <Cell ss:Index="3" ss:Formula="=R[-3]C+R[-2]C">
+ <Data ss:Type="Number">11</Data>
+ </Cell>
+ </Row>
+ </Table>
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <PageSetup>
+ <Layout x:StartPageNumber="1"/>
+ <Header x:Margin="0.78749999999999998" x:Data="&amp;C&amp;A"/>
+ <Footer x:Margin="0.78749999999999998" x:Data="&amp;CPage &amp;P"/>
+ <PageMargins x:Bottom="1.0249999999999999" x:Left="0.78749999999999998" x:Right="0.78749999999999998" x:Top="1.0249999999999999"/>
+ </PageSetup>
+ <Print>
+ <ValidPrinterInfo/>
+ <HorizontalResolution>300</HorizontalResolution>
+ <VerticalResolution>300</VerticalResolution>
+ </Print>
+ <Selected/>
+ <Panes>
+ <Pane>
+ <Number>3</Number>
+ <ActiveRow>6</ActiveRow>
+ <ActiveCol>3</ActiveCol>
+ </Pane>
+ </Panes>
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ <EnableSelection>NoSelection</EnableSelection>
+ </WorksheetOptions>
+ </Worksheet>
+ <Worksheet ss:Name="Sheet2">
+ <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="60.75">
+ </Table>
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <PageSetup>
+ <Header x:Margin="0.78749999999999998" x:Data="&amp;C&amp;A"/>
+ <Footer x:Margin="0.78749999999999998" x:Data="&amp;CPage &amp;P"/>
+ <PageMargins x:Bottom="1.0249999999999999" x:Left="0.78749999999999998" x:Right="0.78749999999999998" x:Top="1.0249999999999999"/>
+ </PageSetup>
+ <Print>
+ <ValidPrinterInfo/>
+ <HorizontalResolution>300</HorizontalResolution>
+ <VerticalResolution>300</VerticalResolution>
+ </Print>
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ <EnableSelection>NoSelection</EnableSelection>
+ </WorksheetOptions>
+ </Worksheet>
+</Workbook>
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index deb1571dd4cf..f6b9b0bc4da3 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -66,6 +66,7 @@ public:
void testContentXLSX();
void testContentLotus123();
void testContentDIF();
+ void testContentXLS_XML();
void testSharedFormulaXLS();
void testSharedFormulaXLSX();
#if TEST_BUG_FILES
@@ -86,6 +87,7 @@ public:
CPPUNIT_TEST(testContentXLSX);
CPPUNIT_TEST(testContentLotus123);
CPPUNIT_TEST(testContentDIF);
+ //CPPUNIT_TEST(testContentXLS_XML);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testSharedFormulaXLSX);
CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape);
@@ -333,6 +335,17 @@ void ScFiltersTest::testContentDIF()
xDocSh->DoClose();
}
+void ScFiltersTest::testContentXLS_XML()
+{
+ ScDocShellRef xDocSh = loadDoc("universal-content.", XLS_XML);
+ CPPUNIT_ASSERT(xDocSh);
+
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ testContentImpl(pDoc, XLS_XML);
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testSharedFormulaXLS()
{
ScDocShellRef xDocSh = loadDoc("shared-formula.", XLS);
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 2a572136165d..7c409ef1267f 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -58,6 +58,7 @@ 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 }
};
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 eea457635e96..3597dd1271c4 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -36,6 +36,7 @@
#define CSV_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_USESOPTIONS)
#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 ODS 0
#define XLS 1
@@ -44,6 +45,7 @@
#define HTML 4
#define LOTUS123 5
#define DIF 6
+#define XLS_XML 7
enum StringType { PureString, FormulaValue, StringValue };