summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-19 23:09:58 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-20 02:38:22 +0200
commitf6a940ad1771016021a75c41a0e9be1e86843fb9 (patch)
tree21d5cd69453b1ae0757e919a291c7a225078597a /sc
parent4327d4973b572ed749803007d90574919da31f04 (diff)
export conditional formatting to xlsx, fdo#48360
This is not yet perfect but should export already the conditional formatting and a great deal of the styles to xlsx Still missing: font export number format export some advanced conditional formats features
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xecontent.cxx4
-rw-r--r--sc/source/filter/excel/xeroot.cxx6
-rw-r--r--sc/source/filter/excel/xestyle.cxx13
3 files changed, 21 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 17bd7e324d4c..3deb48a9701b 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -828,7 +828,11 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
XML_type, GetTypeString(),
XML_priority, OString::valueOf( mnPriority + 1 ).getStr(),
XML_operator, GetOperatorString( mrFormatEntry.GetOperation() ),
+ XML_dxfId, OString::valueOf( GetDxfs().GetDxfId( mrFormatEntry.GetStyle() ) ).getStr(),
FSEND );
+ rWorksheet->startElement( XML_formula, FSEND );
+ rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry( 0 ) ));
+ rWorksheet->endElement( XML_formula );
// OOXTODO: XML_extLst
rWorksheet->endElement( XML_cfRule );
}
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index bff5368a1c07..051656088c88 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -161,6 +161,12 @@ XclExpFilterManager& XclExpRoot::GetFilterManager() const
return *mrExpData.mxFilterMgr;
}
+XclExpDxfs& XclExpRoot::GetDxfs() const
+{
+ OSL_ENSURE( mrExpData.mxDxfs, "XclExpRoot::GetDxfs - missing object ( wrong BIFF?)" );
+ return *mrExpData.mxDxfs;
+}
+
XclExpPivotTableManager& XclExpRoot::GetPivotTableManager() const
{
OSL_ENSURE( mrExpData.mxPTableMgr, "XclExpRoot::GetPivotTableManager - missing object (wrong BIFF?)" );
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 01beec6a3e62..ca608ca4639c 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -2889,11 +2889,20 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
}
}
+sal_Int32 XclExpDxfs::GetDxfId( const rtl::OUString& rStyleName )
+{
+ std::map<rtl::OUString, sal_Int32>::iterator itr = maStyleNameToDxfId.find(rStyleName);
+ if(itr!= maStyleNameToDxfId.end())
+ return itr->second;
+ return -1;
+}
+
void XclExpDxfs::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream();
- rStyleSheet->startElement( XML_dxfs, FSEND,
- XML_count, rtl::OString::valueOf( static_cast<sal_Int32>(maDxf.size())).getStr() );
+ rStyleSheet->startElement( XML_dxfs,
+ XML_count, rtl::OString::valueOf( static_cast<sal_Int32>(maDxf.size())).getStr(),
+ FSEND );
for ( DxfContainer::iterator itr = maDxf.begin(); itr != maDxf.end(); ++itr )
{