diff options
author | Eike Rathke <erack@redhat.com> | 2015-08-31 18:48:46 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-08-31 19:59:38 +0200 |
commit | 8709571dc5a595fbc51b25e159fbd944fcb2ebc1 (patch) | |
tree | 08d3b64931616c6842663743ef74a9edc6bf008e /sc | |
parent | ef89f94b26e61b43451f1f4f685a55aaa959311c (diff) |
TableRef: write OOXML tableColumns,tableColumn
Change-Id: I535f2dc600f3b4fdac2c7fa817eb8430848bbae6
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/dbdata.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/excel/xedbdata.cxx | 36 |
2 files changed, 36 insertions, 1 deletions
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index 7508e0f78fbd..2b6dfaec97a8 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -112,6 +112,7 @@ public: bool IsStripData() const { return bStripData; } void SetStripData(bool bSet) { bStripData = bSet; } void SetTableColumnNames( const ::std::vector< OUString >& rNames ) { maTableColumnNames = rNames; } + const ::std::vector< OUString >& GetTableColumnNames() const { return maTableColumnNames; } /** Finds the column named rName and returns the corresponding offset within the table. diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx index 97dbe4ad702e..f2cd42495878 100644 --- a/sc/source/filter/excel/xedbdata.cxx +++ b/sc/source/filter/excel/xedbdata.cxx @@ -207,7 +207,41 @@ void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, const Entry& rEntry ) // OOXTODO: XML_totalsRowDxfId, ..., FSEND); - /* TODO: columns and stuff */ + // OOXTODO: write <autoFilter> + + const std::vector< OUString >& rColNames = rData.GetTableColumnNames(); + if (!rColNames.empty()) + { + pTableStrm->startElement( XML_tableColumns, + XML_count, OString::number( aRange.aEnd.Col() - aRange.aStart.Col() + 1).getStr(), + FSEND); + + for (size_t i=0, n=rColNames.size(); i < n; ++i) + { + // OOXTODO: write <calculatedColumnFormula> once we support it, in + // which case we'd need start/endElement XML_tableColumn for such + // column. + + pTableStrm->singleElement( XML_tableColumn, + XML_id, OString::number(i+1).getStr(), + XML_name, OUStringToOString( rColNames[i], RTL_TEXTENCODING_UTF8).getStr(), + // OOXTODO: XML_dataCellStyle, ..., + // OOXTODO: XML_dataDxfId, ..., + // OOXTODO: XML_headerRowCellStyle, ..., + // OOXTODO: XML_headerRowDxfId, ..., + // OOXTODO: XML_queryTableFieldId, ..., + // OOXTODO: XML_totalsRowCellStyle, ..., + // OOXTODO: XML_totalsRowDxfId, ..., + // OOXTODO: XML_totalsRowFunction, ..., + // OOXTODO: XML_totalsRowLabel, ..., + // OOXTODO: XML_uniqueName, ..., + FSEND); + } + + pTableStrm->endElement( XML_tableColumns); + } + + // OOXTODO: write <tableStyleInfo> once we have table styles. pTableStrm->endElement( XML_table); } |