13#include <document.hxx>
15#include <oox/token/namespaces.hxx>
25 explicit XclExpTablesImpl5(
const XclExpRoot& rRoot );
35 explicit XclExpTablesImpl8(
const XclExpRoot& rRoot );
43XclExpTablesImpl5::XclExpTablesImpl5(
const XclExpRoot& rRoot ) :
59XclExpTablesImpl8::XclExpTablesImpl8(
const XclExpRoot& rRoot ) :
73 pWorksheetStrm->startElement(XML_tableParts);
74 for (
auto const& it : maTables)
80 pWorksheetStrm->getOutputStream(),
85 pWorksheetStrm->singleElement(XML_tablePart,
FSNS(XML_r, XML_id), aRelId.toUtf8());
87 rStrm.PushStream( pTableStrm);
88 SaveTableXml( rStrm, it);
91 pWorksheetStrm->endElement( XML_tableParts);
116 sal_Int32 nTableId = 0;
117 for (
const auto& rxDB : rDBs)
124 TablesMapType::iterator it =
maTablesMap.find( nTab);
131 pNew =
new XclExpTablesImpl5(
GetRoot());
134 pNew =
new XclExpTablesImpl8(
GetRoot());
137 assert(!
"Unknown BIFF type!");
140 ::std::pair< TablesMapType::iterator, bool > ins(
maTablesMap.insert( ::std::make_pair( nTab, pNew)));
143 assert(!
"XclExpTablesManager::Initialize - XclExpTables insert failed");
148 it->second->AppendTable( pDBData, ++nTableId);
154 TablesMapType::iterator it =
maTablesMap.find(nTab);
155 return it ==
maTablesMap.end() ? nullptr : it->second;
159 mpData(
pData), mnTableId(nTableId)
183 pTableStrm->startElement( XML_table,
184 XML_xmlns,
rStrm.getNamespaceURL(OOX_NS(xls)).toUtf8(),
185 XML_id, OString::number( rEntry.
mnTableId),
186 XML_name, rData.
GetName().toUtf8(),
187 XML_displayName, rData.
GetName().toUtf8(),
189 XML_headerRowCount, ToPsz10(rData.
HasHeader()),
190 XML_totalsRowCount, ToPsz10(rData.
HasTotals()),
191 XML_totalsRowShown, ToPsz10(rData.
HasTotals())
225 if (!rColNames.empty())
227 pTableStrm->startElement(XML_tableColumns,
230 for (
size_t i=0,
n=rColNames.size();
i <
n; ++
i)
238 pTableStrm->singleElement( XML_tableColumn,
239 XML_id, OString::number(
i+1),
240 XML_name, rColNames[
i].toUtf8(),
241 XML_totalsRowFunction, (
i < rColAttributes.size() ? rColAttributes[
i].maTotalsFunction : std::nullopt)
254 pTableStrm->endElement( XML_tableColumns);
259 pTableStrm->endElement( XML_table);
virtual void SaveXml(XclExpXmlStream &rStrm) override
Stores global named database ranges.
bool HasAutoFilter() const
const OUString & GetName() const
SC_DLLPUBLIC void RefreshTableColumnNames(ScDocument *pDoc)
Refresh/update the column names with the header row's cell contents.
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
SC_DLLPUBLIC const ::std::vector< TableColumnAttributes > & GetTableColumnAttributes() const
SC_DLLPUBLIC const ::std::vector< OUString > & GetTableColumnNames() const
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
virtual void SaveXml(XclExpXmlStream &rStrm)
virtual void Save(XclExpStream &rStrm)
Overwrite this method to do any operation while saving the record.
Access to global data from other classes.
const XclExpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
This class is used to export Excel record streams.
rtl::Reference< XclExpTables > GetTablesBySheet(SCTAB nTab)
TablesMapType maTablesMap
virtual ~XclExpTablesManager() override
XclExpTablesManager(const XclExpRoot &rRoot)
virtual ~XclExpTables() override
static void SaveTableXml(XclExpXmlStream &rStrm, const Entry &rEntry)
void AppendTable(const ScDBData *pData, sal_Int32 nTableId)
XclExpTables(const XclExpRoot &rRoot)
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
static OString ToOString(const Color &rColor)
static OUString GetStreamName(const char *sStreamDir, const char *sStream, sal_Int32 nId)
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
std::unique_ptr< sal_Int32[]> pData
std::shared_ptr< FastSerializerHelper > FSHelperPtr
#define CREATE_OFFICEDOC_RELATION_TYPE(ascii)
#define CREATE_XL_CONTENT_TYPE(ascii)
Entry(const ScDBData *pData, sal_Int32 nTableId)
used as [n] in table[n].xml part name.
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)