LibreOffice Module sc (master)  1
Public Member Functions | Private Types | Private Attributes | List of all members
XclImpTabInfo Class Reference

A buffer containing information about names and creation order of sheets. More...

#include <xilink.hxx>

Public Member Functions

void AppendXclTabName (const OUString &rXclTabName, SCTAB nScTab)
 Appends an original Excel sheet name with corresponding Calc sheet index. More...
 
void InsertScTab (SCTAB nScTab)
 Inserts a Calc sheet index (increases all following sheet indexes). More...
 
SCTAB GetScTabFromXclName (const OUString &rXclTabName) const
 Returns the Calc sheet index from the passed original Excel sheet name. More...
 
void ReadTabid (XclImpStream &rStrm)
 Reads the TABID record. More...
 
sal_uInt16 GetCurrentIndex (sal_uInt16 nCreatedId, sal_uInt16 nMaxTabId) const
 Returns the current sheet index calculated from creation index. More...
 

Private Types

typedef ::std::map< OUString, SCTABXclTabNameMap
 

Private Attributes

XclTabNameMap maTabNames
 
ScfUInt16Vec maTabIdVec
 All Excel sheet names with Calc sheet index. More...
 

Detailed Description

A buffer containing information about names and creation order of sheets.

The first purpose of this buffer is to translate original Excel sheet names into Calc sheet indexes. This is not trivial because the filter may rename the Calc sheets during creation. This buffer stores the original Excel sheet names with the corresponding Calc sheet indexes.

The second purpose is to store the creation order of all sheets inside the Excel workbook. The creation order list is contained in the TABID record and needed to import the change log. Example: if the list contains 3;1;2 this means that the second sheet in the file was created first, then the third sheet in the file was created and finally the first sheet.

Definition at line 61 of file xilink.hxx.

Member Typedef Documentation

typedef ::std::map< OUString, SCTAB > XclImpTabInfo::XclTabNameMap
private

Definition at line 88 of file xilink.hxx.

Member Function Documentation

void XclImpTabInfo::AppendXclTabName ( const OUString &  rXclTabName,
SCTAB  nScTab 
)

Appends an original Excel sheet name with corresponding Calc sheet index.

Definition at line 226 of file xilink.cxx.

References maTabNames.

Referenced by ImportExcel8::Boundsheet().

sal_uInt16 XclImpTabInfo::GetCurrentIndex ( sal_uInt16  nCreatedId,
sal_uInt16  nMaxTabId 
) const

Returns the current sheet index calculated from creation index.

Parameters
nCreatedIdThe creation index of the sheet (1-based).
nMaxTabIdAll values greater than this parameter are not used to find the index.
Returns
The 0-based index of the sheet nCreatedId if it is contained in the list. Example: The buffer is 3;5;2;4;1, nCreatedId is 1 and nMaxTabId is 3. The function will return 2 which is the 0-based index of sheet 1 in the list 3;2;1.

Definition at line 262 of file xilink.cxx.

References maTabIdVec, and nValue.

Referenced by XclImpChangeTrack::Read3DTabRefInfo(), and XclImpChangeTrack::ReadTabNum().

SCTAB XclImpTabInfo::GetScTabFromXclName ( const OUString &  rXclTabName) const

Returns the Calc sheet index from the passed original Excel sheet name.

Definition at line 238 of file xilink.cxx.

References maTabNames, and SCTAB_INVALID.

Referenced by XclImpPivotCache::ReadPivotCacheStream().

void XclImpTabInfo::InsertScTab ( SCTAB  nScTab)

Inserts a Calc sheet index (increases all following sheet indexes).

Definition at line 231 of file xilink.cxx.

References maTabNames.

Referenced by ExcScenario::Apply().

void XclImpTabInfo::ReadTabid ( XclImpStream rStrm)

Member Data Documentation

ScfUInt16Vec XclImpTabInfo::maTabIdVec
private

All Excel sheet names with Calc sheet index.

Definition at line 91 of file xilink.hxx.

Referenced by GetCurrentIndex(), and ReadTabid().

XclTabNameMap XclImpTabInfo::maTabNames
private

Definition at line 90 of file xilink.hxx.

Referenced by AppendXclTabName(), GetScTabFromXclName(), and InsertScTab().


The documentation for this class was generated from the following files: