LibreOffice Module sc (master)  1
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at .
18  */
20 #pragma once
22 #include "xlroot.hxx"
23 #include <memory>
25 // Forward declarations of objects in public use ==============================
27 class XclImpStream;
30 typedef std::shared_ptr< XclImpString > XclImpStringRef;
32 // Global data ================================================================
36 class XclImpSst;
37 class XclImpPalette;
38 class XclImpFontBuffer;
39 class XclImpNumFmtBuffer;
40 class XclImpXFBuffer;
42 class XclImpTabInfo;
43 class XclImpNameManager;
44 class XclImpLinkManager;
46 class XclImpSheetDrawing;
52 class XclImpPageSettings;
58 class ScRangeListTabs;
59 class ExcelToSc;
60 class ScDocumentImport;
63 struct XclImpRootData : public XclRootData
64 {
65  typedef std::shared_ptr< XclImpAddressConverter > XclImpAddrConvRef;
66  typedef std::shared_ptr< XclImpFormulaCompiler > XclImpFmlaCompRef;
68  typedef std::shared_ptr< XclImpSst > XclImpSstRef;
69  typedef std::shared_ptr< XclImpPalette > XclImpPaletteRef;
70  typedef std::shared_ptr< XclImpFontBuffer > XclImpFontBfrRef;
71  typedef std::shared_ptr< XclImpNumFmtBuffer > XclImpNumFmtBfrRef;
72  typedef std::shared_ptr< XclImpXFBuffer > XclImpXFBfrRef;
73  typedef std::shared_ptr< XclImpXFRangeBuffer > XclImpXFRangeBfrRef;
74  typedef std::shared_ptr< XclImpTabInfo > XclImpTabInfoRef;
75  typedef std::shared_ptr< XclImpNameManager > XclImpNameMgrRef;
76  typedef std::shared_ptr< XclImpLinkManager > XclImpLinkMgrRef;
77  typedef std::shared_ptr< XclImpObjectManager > XclImpObjectMgrRef;
78  typedef std::shared_ptr< XclImpCondFormatManager > XclImpCondFmtMgrRef;
79  typedef std::shared_ptr< XclImpValidationManager > XclImpValidationMgrRef;
80  typedef std::shared_ptr< XclImpWebQueryBuffer > XclImpWebQueryBfrRef;
81  typedef std::shared_ptr< XclImpPivotTableManager > XclImpPTableMgrRef;
82  typedef std::shared_ptr< XclImpPageSettings > XclImpPageSettRef;
83  typedef std::shared_ptr< XclImpDocViewSettings > XclImpDocViewSettRef;
84  typedef std::shared_ptr< XclImpTabViewSettings > XclImpTabViewSettRef;
85  typedef std::shared_ptr< XclImpSheetProtectBuffer > XclImpTabProtectRef;
86  typedef std::shared_ptr< XclImpDocProtectBuffer > XclImpDocProtectRef;
88  XclImpAddrConvRef mxAddrConv;
89  XclImpFmlaCompRef mxFmlaComp;
91  XclImpSstRef mxSst;
92  XclImpPaletteRef mxPalette;
93  XclImpFontBfrRef mxFontBfr;
94  XclImpNumFmtBfrRef mxNumFmtBfr;
95  XclImpXFBfrRef mpXFBfr;
96  XclImpXFRangeBfrRef mxXFRangeBfr;
98  XclImpTabInfoRef mxTabInfo;
99  XclImpNameMgrRef mxNameMgr;
100  XclImpLinkMgrRef mxLinkMgr;
102  XclImpObjectMgrRef mxObjMgr;
103  XclImpCondFmtMgrRef mxCondFmtMgr;
104  XclImpValidationMgrRef mxValidMgr;
105  XclImpWebQueryBfrRef mxWebQueryBfr;
106  XclImpPTableMgrRef mxPTableMgr;
108  XclImpPageSettRef mxPageSett;
109  XclImpDocViewSettRef mxDocViewSett;
110  XclImpTabViewSettRef mxTabViewSett;
111  XclImpTabProtectRef mxTabProtect;
112  XclImpDocProtectRef mxDocProtect;
114  std::shared_ptr<ScDocumentImport> mxDocImport;
117  bool mbHasBasic;
119  explicit XclImpRootData( XclBiff eBiff, SfxMedium& rMedium,
120  const tools::SvRef<SotStorage>& xRootStrg, ScDocument& rDoc, rtl_TextEncoding eTextEnc );
121  virtual ~XclImpRootData() override;
122 };
125 class XclImpRoot : public XclRoot
126 {
127 public:
128  explicit XclImpRoot( XclImpRootData& rImpRootData );
131  const XclImpRoot& GetRoot() const { return *this; }
132  XclImpRoot& GetRoot() { return *this; }
135  void SetCodePage( sal_uInt16 nCodePage );
138  void InitializeTable( SCTAB nScTab );
140  void FinalizeTable();
150  XclImpSst& GetSst() const;
152  XclImpPalette& GetPalette() const;
158  XclImpXFBuffer& GetXFBuffer() const;
168  XclImpTabInfo& GetTabInfo() const;
201  static OUString GetScAddInName( const OUString& rXclName );
204  bool HasBasic() const { return mrImpData.mbHasBasic; }
206  void SetHasBasic() { mrImpData.mbHasBasic = true; }
208  void ReadCodeName( XclImpStream& rStrm, bool bGlobals );
212 private:
214 };
216 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XclImpValidationManager & GetValidationManager() const
Definition: xiroot.cxx:211
void ReadCodeName(XclImpStream &rStrm, bool bGlobals)
Reads the CODENAME record and inserts the codename into the document.
Definition: xiroot.cxx:271
std::shared_ptr< XclImpTabViewSettings > XclImpTabViewSettRef
Definition: xiroot.hxx:84
ScDocumentImport & GetDocImport()
Definition: xiroot.cxx:292
Drawing manager of a single sheet.
Definition: xiescher.hxx:1110
An enumeration for all Excel file format types (BIFF types).
Definition: xlconst.hxx:29
std::shared_ptr< XclImpPageSettings > XclImpPageSettRef
Definition: xiroot.hxx:82
Contains all view settings for a single sheet.
Definition: xiview.hxx:58
Contains all XF records occurred in the file.
Definition: xistyle.hxx:477
XclImpTabViewSettings & GetTabViewSettings() const
Returns the view settings of the current sheet.
Definition: xiroot.cxx:258
XclImpNumFmtBuffer & GetNumFmtBuffer() const
Returns the number format buffer.
Definition: xiroot.cxx:151
Contains document view settings (WINDOW1 record).
Definition: xiview.hxx:28
XclImpPivotTableManager & GetPivotTableManager() const
Returns the pivot table manager.
Definition: xiroot.cxx:230
XclImpValidationMgrRef mxValidMgr
Conditional formatting.
Definition: xiroot.hxx:104
Stores all drawing and OLE objects and additional data related to these objects.
Definition: xiescher.hxx:1144
Stores global buffers and data needed for Excel import filter.
Definition: xiroot.hxx:63
XclImpWebQueryBfrRef mxWebQueryBfr
Data validation.
Definition: xiroot.hxx:105
XclImpRootData & mrImpData
Definition: xiroot.hxx:213
static OUString GetScAddInName(const OUString &rXclName)
Returns the Calc add-in function name for an Excel function name.
Definition: xiroot.cxx:263
This buffer contains all internal defined names of the document.
Definition: xiname.hxx:81
XclImpCondFmtMgrRef mxCondFmtMgr
All drawing objects.
Definition: xiroot.hxx:103
XclImpObjectMgrRef mxObjMgr
Manager for internal/external links.
Definition: xiroot.hxx:102
std::shared_ptr< XclImpNameManager > XclImpNameMgrRef
Definition: xiroot.hxx:75
XclImpXFRangeBuffer & GetXFRangeBuffer() const
Returns the buffer of XF index ranges for a sheet.
Definition: xiroot.cxx:161
Contains the XF indexes for every used cell in a single sheet.
Definition: xistyle.hxx:606
std::shared_ptr< XclImpDocProtectBuffer > XclImpDocProtectRef
Definition: xiroot.hxx:86
Stores global buffers and data needed elsewhere in the Excel filters.
Definition: xlroot.hxx:61
std::shared_ptr< XclImpLinkManager > XclImpLinkMgrRef
Definition: xiroot.hxx:76
XclImpObjectManager & GetObjectManager() const
Returns the drawing object manager.
Definition: xiroot.cxx:194
Accessor class to ScDocument.
const XclImpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Definition: xiroot.hxx:131
XclImpPageSettings & GetPageSettings() const
Returns the page settings of the current sheet.
Definition: xiroot.cxx:248
Provides functions to convert Excel cell addresses to Calc cell addresses.
Definition: xihelper.hxx:41
XclImpPalette & GetPalette() const
Returns the color buffer.
Definition: xiroot.cxx:141
std::shared_ptr< XclImpValidationManager > XclImpValidationMgrRef
Definition: xiroot.hxx:79
std::shared_ptr< XclImpXFRangeBuffer > XclImpXFRangeBfrRef
Definition: xiroot.hxx:73
XclImpSst & GetSst() const
Returns the shared string table.
Definition: xiroot.cxx:135
void SetHasBasic()
Called to indicate that the document contains a VB project.
Definition: xiroot.hxx:206
std::shared_ptr< XclImpSst > XclImpSstRef
Definition: xiroot.hxx:68
std::shared_ptr< XclImpNumFmtBuffer > XclImpNumFmtBfrRef
Definition: xiroot.hxx:71
ExcelToSc & GetOldFmlaConverter() const
Returns the old formula converter.
Definition: xiroot.cxx:129
XclImpXFBuffer & GetXFBuffer() const
Returns the cell formatting attributes buffer.
Definition: xiroot.cxx:156
XclImpDocViewSettRef mxDocViewSett
Page settings for current sheet.
Definition: xiroot.hxx:109
std::shared_ptr< XclImpDocViewSettings > XclImpDocViewSettRef
Definition: xiroot.hxx:83
Imports and collects all conditional formatting of a sheet.
Definition: xicontent.hxx:147
bool mbHasBasic
true = CODEPAGE record exists.
Definition: xiroot.hxx:117
XclImpNameMgrRef mxNameMgr
Sheet creation order list.
Definition: xiroot.hxx:99
std::shared_ptr< XclImpCondFormatManager > XclImpCondFmtMgrRef
Definition: xiroot.hxx:78
XclImpNumFmtBfrRef mxNumFmtBfr
All fonts in the file.
Definition: xiroot.hxx:94
XclImpRootData(XclBiff eBiff, SfxMedium &rMedium, const tools::SvRef< SotStorage > &xRootStrg, ScDocument &rDoc, rtl_TextEncoding eTextEnc)
true = document contains VB project.
Definition: xiroot.cxx:42
std::shared_ptr< XclImpTabInfo > XclImpTabInfoRef
Definition: xiroot.hxx:74
A buffer containing information about names and creation order of sheets.
Definition: xilink.hxx:60
XclImpTabInfo & GetTabInfo() const
Returns the buffer that contains the sheet creation order.
Definition: xiroot.cxx:178
XclImpSstRef mxSst
The formula compiler.
Definition: xiroot.hxx:91
XclImpAutoFilterBuffer & GetFilterManager() const
Returns the filter manager.
Definition: xiroot.cxx:217
XclImpFontBfrRef mxFontBfr
The color buffer.
Definition: xiroot.hxx:93
XclImpTabInfoRef mxTabInfo
Buffer of XF index ranges in a sheet.
Definition: xiroot.hxx:98
XclImpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xiroot.cxx:119
Contains all page (print) settings for a single sheet.
Definition: xipage.hxx:29
Stores all user defined number formats occurred in the file.
Definition: xistyle.hxx:204
void FinalizeTable()
Is called when import filter stops importing a single sheet (all BIFF versions).
Definition: xiroot.cxx:111
std::shared_ptr< ScDocumentImport > mxDocImport
Document protection options.
Definition: xiroot.hxx:114
The formula compiler to create Calc token arrays from Excel token arrays.
Definition: xiformula.hxx:32
virtual ~XclImpRootData() override
Definition: xiroot.cxx:51
ScRangeListTabs & GetTitleAreaBuffer() const
Returns the buffer that contains all print titles in the document.
Definition: xiroot.cxx:172
std::shared_ptr< XclImpFormulaCompiler > XclImpFmlaCompRef
Definition: xiroot.hxx:66
XclImpDocProtectRef mxDocProtect
Sheet protection options for current sheet.
Definition: xiroot.hxx:112
XclImpNameManager & GetNameManager() const
Returns the buffer that contains internal defined names.
Definition: xiroot.cxx:183
XclImpFormulaCompiler & GetFormulaCompiler() const
Returns the formula converter.
Definition: xiroot.cxx:124
std::shared_ptr< XclImpWebQueryBuffer > XclImpWebQueryBfrRef
Definition: xiroot.hxx:80
std::shared_ptr< XclImpPivotTableManager > XclImpPTableMgrRef
Definition: xiroot.hxx:81
XclImpPageSettRef mxPageSett
All pivot tables and pivot caches.
Definition: xiroot.hxx:108
std::shared_ptr< XclImpSheetProtectBuffer > XclImpTabProtectRef
Definition: xiroot.hxx:85
bool HasBasic() const
Returns true, if the document contains a VB project.
Definition: xiroot.hxx:204
Imports validation data.
Definition: xicontent.hxx:168
XclImpSheetDrawing & GetCurrSheetDrawing() const
Returns the drawing container of the current sheet.
Definition: xiroot.cxx:199
XclImpFmlaCompRef mxFmlaComp
The address converter.
Definition: xiroot.hxx:89
XclImpXFBfrRef mpXFBfr
All number formats in the file.
Definition: xiroot.hxx:95
XclImpLinkManager & GetLinkManager() const
Returns the link manager.
Definition: xiroot.cxx:188
void SetCodePage(sal_uInt16 nCodePage)
Sets a code page read from a CODEPAGE record for byte string import.
Definition: xiroot.cxx:89
XclImpPTableMgrRef mxPTableMgr
All web queries.
Definition: xiroot.hxx:106
XclImpWebQueryBuffer & GetWebQueryBuffer() const
Returns the web query buffer.
Definition: xiroot.cxx:224
std::shared_ptr< XclImpXFBuffer > XclImpXFBfrRef
Definition: xiroot.hxx:72
XclImpPaletteRef mxPalette
The shared string table.
Definition: xiroot.hxx:92
XclImpRoot(XclImpRootData &rImpRootData)
Definition: xiroot.cxx:55
XclImpFontBuffer & GetFontBuffer() const
Returns the font buffer.
Definition: xiroot.cxx:146
std::shared_ptr< XclImpString > XclImpStringRef
Definition: xiroot.hxx:28
The main class for pivot table import.
Definition: xipivot.hxx:371
Stores the data of all fonts occurred in an Excel file.
Definition: xistyle.hxx:152
The SST (shared string table) contains all strings used in a BIFF8 file.
Definition: xicontent.hxx:55
Stores the default colors for the current BIFF version and the contents of a PALETTE record...
Definition: xistyle.hxx:44
XclImpAddrConvRef mxAddrConv
Definition: xiroot.hxx:88
XclImpDocViewSettings & GetDocViewSettings() const
Returns the view settings of the entire document.
Definition: xiroot.cxx:253
XclImpLinkMgrRef mxLinkMgr
Internal defined names.
Definition: xiroot.hxx:100
XclImpCondFormatManager & GetCondFormatManager() const
Returns the conditional formatting manager.
Definition: xiroot.cxx:205
XclImpXFRangeBfrRef mxXFRangeBfr
All XF record data in the file.
Definition: xiroot.hxx:96
This class is used to import record oriented streams.
Definition: xistream.hxx:277
void InitializeTable(SCTAB nScTab)
Is called when import filter starts importing a single sheet (all BIFF versions). ...
Definition: xiroot.cxx:95
XclImpTabProtectRef mxTabProtect
View settings for current sheet.
Definition: xiroot.hxx:111
Access to global data from other classes.
Definition: xiroot.hxx:125
std::shared_ptr< XclImpAddressConverter > XclImpAddrConvRef
Definition: xiroot.hxx:65
XclImpSheetProtectBuffer & GetSheetProtectBuffer() const
Returns the sheet protection options of the current sheet.
Definition: xiroot.cxx:236
This class represents an unformatted or formatted string and provides importing from stream...
Definition: xistring.hxx:30
Access to global data for a filter object (imported or exported document) from other classes...
Definition: xlroot.hxx:127
XclImpDocProtectBuffer & GetDocProtectBuffer() const
Returns the document protection options.
Definition: xiroot.cxx:242
XclImpRoot & GetRoot()
Definition: xiroot.hxx:132
XclImpTabViewSettRef mxTabViewSett
View settings for entire document.
Definition: xiroot.hxx:110
std::shared_ptr< XclImpObjectManager > XclImpObjectMgrRef
Definition: xiroot.hxx:77
std::shared_ptr< XclImpFontBuffer > XclImpFontBfrRef
Definition: xiroot.hxx:70
sal_Int16 SCTAB
Definition: types.hxx:22
This is the central class for the import of all internal/external links.
Definition: xilink.hxx:183
ScRangeListTabs & GetPrintAreaBuffer() const
Returns the buffer that contains all print areas in the document.
Definition: xiroot.cxx:166
std::shared_ptr< XclImpPalette > XclImpPaletteRef
Definition: xiroot.hxx:69
bool mbHasCodePage
Definition: xiroot.hxx:116