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  */
23 #include "xlroot.hxx"
24 #include <memory>
26 // Forward declarations of objects in public use ==============================
28 class XclImpStream;
31 typedef std::shared_ptr< XclImpString > XclImpStringRef;
33 // Global data ================================================================
37 class XclImpSst;
38 class XclImpPalette;
39 class XclImpFontBuffer;
40 class XclImpNumFmtBuffer;
41 class XclImpXFBuffer;
43 class XclImpTabInfo;
44 class XclImpNameManager;
45 class XclImpLinkManager;
47 class XclImpSheetDrawing;
53 class XclImpPageSettings;
59 class ScRangeListTabs;
60 class ExcelToSc;
61 class ScDocumentImport;
64 struct XclImpRootData : public XclRootData
65 {
66  typedef std::shared_ptr< XclImpAddressConverter > XclImpAddrConvRef;
67  typedef std::shared_ptr< XclImpFormulaCompiler > XclImpFmlaCompRef;
69  typedef std::shared_ptr< XclImpSst > XclImpSstRef;
70  typedef std::shared_ptr< XclImpPalette > XclImpPaletteRef;
71  typedef std::shared_ptr< XclImpFontBuffer > XclImpFontBfrRef;
72  typedef std::shared_ptr< XclImpNumFmtBuffer > XclImpNumFmtBfrRef;
73  typedef std::shared_ptr< XclImpXFBuffer > XclImpXFBfrRef;
74  typedef std::shared_ptr< XclImpXFRangeBuffer > XclImpXFRangeBfrRef;
75  typedef std::shared_ptr< XclImpTabInfo > XclImpTabInfoRef;
76  typedef std::shared_ptr< XclImpNameManager > XclImpNameMgrRef;
77  typedef std::shared_ptr< XclImpLinkManager > XclImpLinkMgrRef;
78  typedef std::shared_ptr< XclImpObjectManager > XclImpObjectMgrRef;
79  typedef std::shared_ptr< XclImpCondFormatManager > XclImpCondFmtMgrRef;
80  typedef std::shared_ptr< XclImpValidationManager > XclImpValidationMgrRef;
81  typedef std::shared_ptr< XclImpWebQueryBuffer > XclImpWebQueryBfrRef;
82  typedef std::shared_ptr< XclImpPivotTableManager > XclImpPTableMgrRef;
83  typedef std::shared_ptr< XclImpPageSettings > XclImpPageSettRef;
84  typedef std::shared_ptr< XclImpDocViewSettings > XclImpDocViewSettRef;
85  typedef std::shared_ptr< XclImpTabViewSettings > XclImpTabViewSettRef;
86  typedef std::shared_ptr< XclImpSheetProtectBuffer > XclImpTabProtectRef;
87  typedef std::shared_ptr< XclImpDocProtectBuffer > XclImpDocProtectRef;
89  XclImpAddrConvRef mxAddrConv;
90  XclImpFmlaCompRef mxFmlaComp;
92  XclImpSstRef mxSst;
93  XclImpPaletteRef mxPalette;
94  XclImpFontBfrRef mxFontBfr;
95  XclImpNumFmtBfrRef mxNumFmtBfr;
96  XclImpXFBfrRef mpXFBfr;
97  XclImpXFRangeBfrRef mxXFRangeBfr;
99  XclImpTabInfoRef mxTabInfo;
100  XclImpNameMgrRef mxNameMgr;
101  XclImpLinkMgrRef mxLinkMgr;
103  XclImpObjectMgrRef mxObjMgr;
104  XclImpCondFmtMgrRef mxCondFmtMgr;
105  XclImpValidationMgrRef mxValidMgr;
106  XclImpWebQueryBfrRef mxWebQueryBfr;
107  XclImpPTableMgrRef mxPTableMgr;
109  XclImpPageSettRef mxPageSett;
110  XclImpDocViewSettRef mxDocViewSett;
111  XclImpTabViewSettRef mxTabViewSett;
112  XclImpTabProtectRef mxTabProtect;
113  XclImpDocProtectRef mxDocProtect;
115  std::shared_ptr<ScDocumentImport> mxDocImport;
118  bool mbHasBasic;
120  explicit XclImpRootData( XclBiff eBiff, SfxMedium& rMedium,
121  const tools::SvRef<SotStorage>& xRootStrg, ScDocument& rDoc, rtl_TextEncoding eTextEnc );
122  virtual ~XclImpRootData() override;
123 };
126 class XclImpRoot : public XclRoot
127 {
128 public:
129  explicit XclImpRoot( XclImpRootData& rImpRootData );
132  const XclImpRoot& GetRoot() const { return *this; }
133  XclImpRoot& GetRoot() { return *this; }
136  void SetCodePage( sal_uInt16 nCodePage );
139  void InitializeTable( SCTAB nScTab );
141  void FinalizeTable();
151  XclImpSst& GetSst() const;
153  XclImpPalette& GetPalette() const;
159  XclImpXFBuffer& GetXFBuffer() const;
169  XclImpTabInfo& GetTabInfo() const;
202  static OUString GetScAddInName( const OUString& rXclName );
205  bool HasBasic() const { return mrImpData.mbHasBasic; }
207  void SetHasBasic() { mrImpData.mbHasBasic = true; }
209  void ReadCodeName( XclImpStream& rStrm, bool bGlobals );
213 private:
215 };
217 #endif
219 /* 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:85
ScDocumentImport & GetDocImport()
Definition: xiroot.cxx:292
Drawing manager of a single sheet.
Definition: xiescher.hxx:1111
An enumeration for all Excel file format types (BIFF types).
Definition: xlconst.hxx:30
std::shared_ptr< XclImpPageSettings > XclImpPageSettRef
Definition: xiroot.hxx:83
Contains all view settings for a single sheet.
Definition: xiview.hxx:59
Contains all XF records occurred in the file.
Definition: xistyle.hxx:478
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:29
XclImpPivotTableManager & GetPivotTableManager() const
Returns the pivot table manager.
Definition: xiroot.cxx:230
XclImpValidationMgrRef mxValidMgr
Conditional formatting.
Definition: xiroot.hxx:105
Stores all drawing and OLE objects and additional data related to these objects.
Definition: xiescher.hxx:1145
Stores global buffers and data needed for Excel import filter.
Definition: xiroot.hxx:64
XclImpWebQueryBfrRef mxWebQueryBfr
Data validation.
Definition: xiroot.hxx:106
XclImpRootData & mrImpData
Definition: xiroot.hxx:214
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:82
XclImpCondFmtMgrRef mxCondFmtMgr
All drawing objects.
Definition: xiroot.hxx:104
XclImpObjectMgrRef mxObjMgr
Manager for internal/external links.
Definition: xiroot.hxx:103
std::shared_ptr< XclImpNameManager > XclImpNameMgrRef
Definition: xiroot.hxx:76
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:607
std::shared_ptr< XclImpDocProtectBuffer > XclImpDocProtectRef
Definition: xiroot.hxx:87
Stores global buffers and data needed elsewhere in the Excel filters.
Definition: xlroot.hxx:62
std::shared_ptr< XclImpLinkManager > XclImpLinkMgrRef
Definition: xiroot.hxx:77
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:132
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:42
XclImpPalette & GetPalette() const
Returns the color buffer.
Definition: xiroot.cxx:141
std::shared_ptr< XclImpValidationManager > XclImpValidationMgrRef
Definition: xiroot.hxx:80
std::shared_ptr< XclImpXFRangeBuffer > XclImpXFRangeBfrRef
Definition: xiroot.hxx:74
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:207
std::shared_ptr< XclImpSst > XclImpSstRef
Definition: xiroot.hxx:69
std::shared_ptr< XclImpNumFmtBuffer > XclImpNumFmtBfrRef
Definition: xiroot.hxx:72
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:110
std::shared_ptr< XclImpDocViewSettings > XclImpDocViewSettRef
Definition: xiroot.hxx:84
Imports and collects all conditional formatting of a sheet.
Definition: xicontent.hxx:148
bool mbHasBasic
true = CODEPAGE record exists.
Definition: xiroot.hxx:118
XclImpNameMgrRef mxNameMgr
Sheet creation order list.
Definition: xiroot.hxx:100
std::shared_ptr< XclImpCondFormatManager > XclImpCondFmtMgrRef
Definition: xiroot.hxx:79
XclImpNumFmtBfrRef mxNumFmtBfr
All fonts in the file.
Definition: xiroot.hxx:95
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:75
A buffer containing information about names and creation order of sheets.
Definition: xilink.hxx:61
XclImpTabInfo & GetTabInfo() const
Returns the buffer that contains the sheet creation order.
Definition: xiroot.cxx:178
XclImpSstRef mxSst
The formula compiler.
Definition: xiroot.hxx:92
XclImpAutoFilterBuffer & GetFilterManager() const
Returns the filter manager.
Definition: xiroot.cxx:217
XclImpFontBfrRef mxFontBfr
The color buffer.
Definition: xiroot.hxx:94
XclImpTabInfoRef mxTabInfo
Buffer of XF index ranges in a sheet.
Definition: xiroot.hxx:99
XclImpAddressConverter & GetAddressConverter() const
Returns the address converter.
Definition: xiroot.cxx:119
Contains all page (print) settings for a single sheet.
Definition: xipage.hxx:30
Stores all user defined number formats occurred in the file.
Definition: xistyle.hxx:205
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:115
The formula compiler to create Calc token arrays from Excel token arrays.
Definition: xiformula.hxx:33
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:67
XclImpDocProtectRef mxDocProtect
Sheet protection options for current sheet.
Definition: xiroot.hxx:113
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:81
std::shared_ptr< XclImpPivotTableManager > XclImpPTableMgrRef
Definition: xiroot.hxx:82
XclImpPageSettRef mxPageSett
All pivot tables and pivot caches.
Definition: xiroot.hxx:109
std::shared_ptr< XclImpSheetProtectBuffer > XclImpTabProtectRef
Definition: xiroot.hxx:86
bool HasBasic() const
Returns true, if the document contains a VB project.
Definition: xiroot.hxx:205
Imports validation data.
Definition: xicontent.hxx:169
XclImpSheetDrawing & GetCurrSheetDrawing() const
Returns the drawing container of the current sheet.
Definition: xiroot.cxx:199
XclImpFmlaCompRef mxFmlaComp
The address converter.
Definition: xiroot.hxx:90
XclImpXFBfrRef mpXFBfr
All number formats in the file.
Definition: xiroot.hxx:96
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:107
XclImpWebQueryBuffer & GetWebQueryBuffer() const
Returns the web query buffer.
Definition: xiroot.cxx:224
std::shared_ptr< XclImpXFBuffer > XclImpXFBfrRef
Definition: xiroot.hxx:73
XclImpPaletteRef mxPalette
The shared string table.
Definition: xiroot.hxx:93
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:29
The main class for pivot table import.
Definition: xipivot.hxx:372
Stores the data of all fonts occurred in an Excel file.
Definition: xistyle.hxx:153
The SST (shared string table) contains all strings used in a BIFF8 file.
Definition: xicontent.hxx:56
Stores the default colors for the current BIFF version and the contents of a PALETTE record...
Definition: xistyle.hxx:45
XclImpAddrConvRef mxAddrConv
Definition: xiroot.hxx:89
XclImpDocViewSettings & GetDocViewSettings() const
Returns the view settings of the entire document.
Definition: xiroot.cxx:253
XclImpLinkMgrRef mxLinkMgr
Internal defined names.
Definition: xiroot.hxx:101
XclImpCondFormatManager & GetCondFormatManager() const
Returns the conditional formatting manager.
Definition: xiroot.cxx:205
XclImpXFRangeBfrRef mxXFRangeBfr
All XF record data in the file.
Definition: xiroot.hxx:97
This class is used to import record oriented streams.
Definition: xistream.hxx:278
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:112
Access to global data from other classes.
Definition: xiroot.hxx:126
std::shared_ptr< XclImpAddressConverter > XclImpAddrConvRef
Definition: xiroot.hxx:66
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:31
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:133
XclImpTabViewSettRef mxTabViewSett
View settings for entire document.
Definition: xiroot.hxx:111
std::shared_ptr< XclImpObjectManager > XclImpObjectMgrRef
Definition: xiroot.hxx:78
std::shared_ptr< XclImpFontBuffer > XclImpFontBfrRef
Definition: xiroot.hxx:71
sal_Int16 SCTAB
Definition: types.hxx:23
This is the central class for the import of all internal/external links.
Definition: xilink.hxx:184
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:70
bool mbHasCodePage
Definition: xiroot.hxx:117