sc/source/filter/excel/excdoc.cxx | 7 +++---- sc/source/filter/excel/xedbdata.cxx | 19 ++++++++++++------- sc/source/filter/inc/xedbdata.hxx | 7 +++---- 3 files changed, 18 insertions(+), 15 deletions(-)
New commits: commit 4112ecadd53f7ae48e007dd5024f077aca305062 Author: Eike Rathke <er...@redhat.com> Date: Thu Nov 26 11:30:18 2015 +0100 TableRef: write <tableParts> before <extLst>, resolves tdf#96049 Excel expects this order, so let XclExpTables be managed as XclExpRecordBase in the sheet's XclExpRecordList. Change-Id: If2cefc255c74688661e861a26218564117b1e3ce diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index f5d5393..75a7677 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -678,6 +678,9 @@ void ExcTable::FillAsTableXml() if (pImgData) aRecList.AppendRecord(std::shared_ptr<XclExpRecordBase>(pImgData)); + // <tableParts> after <drawing> and before <extLst> + aRecList.AppendRecord( GetTablesManager().GetTablesBySheet( mnScTab)); + aRecList.AppendRecord( xExtLst ); } @@ -744,10 +747,6 @@ void ExcTable::WriteXml( XclExpXmlStream& rStrm ) if (pPT) pPT->SaveXml(rStrm); - XclExpTables* pTables = GetTablesManager().GetTablesBySheet(mnScTab); - if (pTables) - pTables->SaveXml(rStrm); - rStrm.GetCurrentStream()->endElement( XML_worksheet ); rStrm.PopStream(); } diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx index 6613c37..5be286d 100644 --- a/sc/source/filter/excel/xedbdata.cxx +++ b/sc/source/filter/excel/xedbdata.cxx @@ -133,27 +133,32 @@ void XclExpTablesManager::Initialize() TablesMapType::iterator it = maTablesMap.find( nTab); if (it == maTablesMap.end()) { - XclExpTables* pNew; + ::std::shared_ptr< XclExpTables > pNew; switch( GetBiff() ) { case EXC_BIFF5: - pNew = new XclExpTablesImpl5( GetRoot()); + pNew.reset( new XclExpTablesImpl5( GetRoot())); break; case EXC_BIFF8: - pNew = new XclExpTablesImpl8( GetRoot()); + pNew.reset( new XclExpTablesImpl8( GetRoot())); break; default: assert(!"Unknown BIFF type!"); continue; // for } - it = maTablesMap.insert( nTab, pNew).first; + ::std::pair< TablesMapType::iterator, bool > ins( maTablesMap.insert( ::std::make_pair( nTab, pNew))); + if (!ins.second) + { + assert(!"XclExpTablesManager::Initialize - XclExpTables insert failed"); + continue; // for + } + it = ins.first; } - XclExpTables* p = it->second; - p->AppendTable( pDBData, ++nTableId); + it->second->AppendTable( pDBData, ++nTableId); } } -XclExpTables* XclExpTablesManager::GetTablesBySheet( SCTAB nTab ) +::std::shared_ptr< XclExpTables > XclExpTablesManager::GetTablesBySheet( SCTAB nTab ) { TablesMapType::iterator it = maTablesMap.find(nTab); return it == maTablesMap.end() ? nullptr : it->second; diff --git a/sc/source/filter/inc/xedbdata.hxx b/sc/source/filter/inc/xedbdata.hxx index f5dd980..4b31ffe 100644 --- a/sc/source/filter/inc/xedbdata.hxx +++ b/sc/source/filter/inc/xedbdata.hxx @@ -22,7 +22,6 @@ #include "xeroot.hxx" #include "xerecord.hxx" -#include <boost/ptr_container/ptr_map.hpp> class ScDBData; class XclExpTablesManagerImpl; @@ -44,7 +43,7 @@ protected: Entry( const ScDBData* pData, sal_Int32 nTableId ); }; - typedef std::vector<Entry> TablesType; + typedef ::std::vector<Entry> TablesType; TablesType maTables; static void SaveTableXml( XclExpXmlStream& rStrm, const Entry& rEntry ); @@ -59,10 +58,10 @@ public: virtual ~XclExpTablesManager(); void Initialize(); - XclExpTables* GetTablesBySheet( SCTAB nTab ); + ::std::shared_ptr< XclExpTables > GetTablesBySheet( SCTAB nTab ); private: - typedef boost::ptr_map< SCTAB, XclExpTables > TablesMapType; + typedef ::std::map< SCTAB, ::std::shared_ptr< XclExpTables > > TablesMapType; TablesMapType maTablesMap; }; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits