summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/filter/excel/excdoc.cxx7
-rw-r--r--sc/source/filter/excel/xedbdata.cxx19
-rw-r--r--sc/source/filter/inc/xedbdata.hxx7
3 files changed, 18 insertions, 15 deletions
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index f5d539307767..75a767740359 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 6613c37c13d9..5be286d1090b 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 f5dd980116a2..4b31ffeedda8 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;
};