LibreOffice Module sc (master)  1
Public Member Functions | List of all members
XclImpAddressConverter Class Reference

Provides functions to convert Excel cell addresses to Calc cell addresses. More...

#include <xihelper.hxx>

Inheritance diagram for XclImpAddressConverter:
[legend]
Collaboration diagram for XclImpAddressConverter:
[legend]

Public Member Functions

 XclImpAddressConverter (const XclImpRoot &rRoot)
 
bool CheckAddress (const XclAddress &rXclPos, bool bWarn)
 Checks if the passed Excel cell address is valid. More...
 
bool ConvertAddress (ScAddress &rScPos, const XclAddress &rXclPos, SCTAB nScTab, bool bWarn)
 Converts the passed Excel cell address to a Calc cell address. More...
 
ScAddress CreateValidAddress (const XclAddress &rXclPos, SCTAB nScTab, bool bWarn)
 Returns a valid cell address by moving it into allowed dimensions. More...
 
bool ConvertRange (ScRange &rScRange, const XclRange &rXclRange, SCTAB nScTab1, SCTAB nScTab2, bool bWarn)
 Converts the passed Excel cell range to a Calc cell range. More...
 
void ConvertRangeList (ScRangeList &rScRanges, const XclRangeList &rXclRanges, SCTAB nScTab, bool bWarn)
 Converts the passed Excel cell range list to a Calc cell range list. More...
 
- Public Member Functions inherited from XclAddressConverterBase
 XclAddressConverterBase (XclTracer &rTracer, const ScAddress &rMaxPos)
 
virtual ~XclAddressConverterBase ()
 
bool IsColTruncated () const
 Returns whether the "some columns have been cut" warning box should be shown. More...
 
bool IsRowTruncated () const
 Returns whether the "some rows have been cut" warning box should be shown. More...
 
bool IsTabTruncated () const
 Returns whether the "some sheets have been cut" warning box should be shown. More...
 
void CheckScTab (SCTAB nScTab)
 Checks if the passed sheet index is valid. More...
 

Additional Inherited Members

- Protected Attributes inherited from XclAddressConverterBase
XclTracermrTracer
 
ScAddress maMaxPos
 Tracer for invalid addresses. More...
 
sal_uInt16 mnMaxCol
 Default maximum position. More...
 
sal_uInt32 mnMaxRow
 Maximum column index, as 16-bit value. More...
 
bool mbColTrunc
 Maximum row index. More...
 
bool mbRowTrunc
 Flag for "columns truncated" warning box. More...
 
bool mbTabTrunc
 Flag for "rows truncated" warning box. More...
 

Detailed Description

Provides functions to convert Excel cell addresses to Calc cell addresses.

Definition at line 42 of file xihelper.hxx.

Constructor & Destructor Documentation

XclImpAddressConverter::XclImpAddressConverter ( const XclImpRoot rRoot)
explicit

Definition at line 55 of file xihelper.cxx.

Member Function Documentation

bool XclImpAddressConverter::CheckAddress ( const XclAddress rXclPos,
bool  bWarn 
)

Checks if the passed Excel cell address is valid.

Parameters
rXclPosThe Excel cell address to check.
bWarntrue = Sets the internal flag that produces a warning box after loading/saving the file, if the cell address is not valid.
Returns
true = Cell address in rXclPos is valid.

Definition at line 62 of file xihelper.cxx.

References XclAddressConverterBase::maMaxPos, XclAddressConverterBase::mbColTrunc, XclAddressConverterBase::mbRowTrunc, XclAddress::mnCol, XclAddressConverterBase::mnMaxCol, XclAddressConverterBase::mnMaxRow, XclAddress::mnRow, XclAddressConverterBase::mrTracer, and XclTracer::TraceInvalidAddress().

Referenced by ConvertAddress(), and ConvertRange().

bool XclImpAddressConverter::ConvertAddress ( ScAddress rScPos,
const XclAddress rXclPos,
SCTAB  nScTab,
bool  bWarn 
)

Converts the passed Excel cell address to a Calc cell address.

Parameters
rScPos(Out) The converted Calc cell address, if valid.
rXclPosThe Excel cell address to convert.
bWarntrue = Sets the internal flag that produces a warning box after loading/saving the file, if the cell address is invalid.
Returns
true = Cell address returned in rScPos is valid.

Definition at line 77 of file xihelper.cxx.

References CheckAddress(), XclAddress::mnCol, and XclAddress::mnRow.

Referenced by CreateValidAddress().

bool XclImpAddressConverter::ConvertRange ( ScRange rScRange,
const XclRange rXclRange,
SCTAB  nScTab1,
SCTAB  nScTab2,
bool  bWarn 
)

Converts the passed Excel cell range to a Calc cell range.

Parameters
rScRange(Out) The converted Calc cell range, if valid.
rXclRangeThe Excel cell range to convert.
bWarntrue = Sets the internal flag that produces a warning box after loading/saving the file, if the cell range contains invalid cells.
Returns
true = Cell range returned in rScRange is valid (original or cropped).

Definition at line 101 of file xihelper.cxx.

References ScRange::aEnd, ScRange::aStart, CheckAddress(), XclRange::maFirst, XclRange::maLast, XclAddress::mnCol, XclAddressConverterBase::mnMaxCol, XclAddressConverterBase::mnMaxRow, and XclAddress::mnRow.

Referenced by ImportExcel::Cellmerging(), ConvertRangeList(), ExcelToSc::GetAbsRefs(), ExcelToSc8::GetAbsRefs(), XclImpHyperlink::InsertUrl(), ImportExcel::Olesize(), XclImpPivotCache::ReadDconref(), ImportExcel::ReadDimensions(), and XclImpPivotTable::ReadSxview().

void XclImpAddressConverter::ConvertRangeList ( ScRangeList rScRanges,
const XclRangeList rXclRanges,
SCTAB  nScTab,
bool  bWarn 
)

Converts the passed Excel cell range list to a Calc cell range list.

The start position of the ranges will not be modified. Cell ranges that fit partly into valid dimensions are cropped accordingly. Cell ranges that do not fit at all, are not inserted into the Calc cell range list.

Parameters
rScRanges(Out) The converted Calc cell range list.
rXclRangesThe Excel cell range list to convert.
bWarntrue = Sets the internal flag that produces a warning box after loading/saving the file, if at least one of the cell ranges contains invalid cells.

Definition at line 125 of file xihelper.cxx.

References ConvertRange(), ScRangeList::push_back(), ScRangeList::RemoveAll(), and ScAddress::UNINITIALIZED.

Referenced by ImportExcel8::Feat(), XclImpTabViewSettings::Finalize(), XclImpCondFormat::ReadCondfmt(), XclImpValidationManager::ReadDV(), and XclImpLabelranges::ReadLabelranges().

ScAddress XclImpAddressConverter::CreateValidAddress ( const XclAddress rXclPos,
SCTAB  nScTab,
bool  bWarn 
)

Returns a valid cell address by moving it into allowed dimensions.

Parameters
rXclPosThe Excel cell address to convert.
bWarntrue = Sets the internal flag that produces a warning box after loading/saving the file, if the cell address is invalid.
Returns
The converted Calc cell address.

Definition at line 86 of file xihelper.cxx.

References ConvertAddress(), XclAddressConverterBase::maMaxPos, XclAddress::mnCol, XclAddressConverterBase::mnMaxCol, XclAddressConverterBase::mnMaxRow, XclAddress::mnRow, ScAddress::SetCol(), ScAddress::SetRow(), ScAddress::SetTab(), ScAddress::Tab(), and ScAddress::UNINITIALIZED.

Referenced by XclImpTabViewSettings::Finalize().


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