diff options
author | Eike Rathke <erack@redhat.com> | 2015-08-31 19:52:27 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-08-31 19:59:38 +0200 |
commit | f284678e334b02808a6c2d473ce683745c99d08e (patch) | |
tree | 0b83aa57871e3c57de2ca8fd60864b3101f5a10a /sc | |
parent | 8709571dc5a595fbc51b25e159fbd944fcb2ebc1 (diff) |
TableRef: write OOXML table autoFilter fragment
... actually we're already able to import that. Needs more work for the
filter settings export if applied.
Change-Id: I4fc596f6a69c7729fc6ca488e5f596fdbe9a79b8
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xedbdata.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx index f2cd42495878..69c4dccd3d18 100644 --- a/sc/source/filter/excel/xedbdata.cxx +++ b/sc/source/filter/excel/xedbdata.cxx @@ -207,7 +207,20 @@ void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, const Entry& rEntry ) // OOXTODO: XML_totalsRowDxfId, ..., FSEND); - // OOXTODO: write <autoFilter> + if (rData.HasAutoFilter()) + { + /* TODO: does this need to exclude totals row? */ + + /* TODO: in OOXML 12.3.21 Table Definition Part has information + * that an applied autoFilter has child elements + * <af:filterColumn><af:filters><af:filter>. + * When not applied but buttons hidden, Excel writes, for example, + * <filterColumn colId="0" hiddenButton="1"/> */ + + pTableStrm->singleElement( XML_autoFilter, + XML_ref, XclXmlUtils::ToOString(aRange), + FSEND); + } const std::vector< OUString >& rColNames = rData.GetTableColumnNames(); if (!rColNames.empty()) @@ -222,6 +235,8 @@ void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, const Entry& rEntry ) // which case we'd need start/endElement XML_tableColumn for such // column. + // OOXTODO: write <totalsRowFormula> once we support it. + pTableStrm->singleElement( XML_tableColumn, XML_id, OString::number(i+1).getStr(), XML_name, OUStringToOString( rColNames[i], RTL_TEXTENCODING_UTF8).getStr(), |