LibreOffice Module sc (master) 1
|
Provides functions to convert Excel cell addresses to Calc cell addresses. More...
#include <xihelper.hxx>
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 | |
XclTracer & | mrTracer |
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... | |
Provides functions to convert Excel cell addresses to Calc cell addresses.
Definition at line 41 of file xihelper.hxx.
|
explicit |
Definition at line 55 of file xihelper.cxx.
bool XclImpAddressConverter::CheckAddress | ( | const XclAddress & | rXclPos, |
bool | bWarn | ||
) |
Checks if the passed Excel cell address is valid.
rXclPos | The Excel cell address to check. |
bWarn | true = Sets the internal flag that produces a warning box after loading/saving the file, if the cell address is not 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.
rScPos | (Out) The converted Calc cell address, if valid. |
rXclPos | The Excel cell address to convert. |
bWarn | true = Sets the internal flag that produces a warning box after loading/saving the file, if the cell address is invalid. |
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.
rScRange | (Out) The converted Calc cell range, if valid. |
rXclRange | The Excel cell range to convert. |
bWarn | true = Sets the internal flag that produces a warning box after loading/saving the file, if the cell range contains invalid cells. |
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(), 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.
@descr 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.
rScRanges | (Out) The converted Calc cell range list. |
rXclRanges | The Excel cell range list to convert. |
bWarn | true = 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.
rXclPos | The Excel cell address to convert. |
bWarn | true = Sets the internal flag that produces a warning box after loading/saving the file, if the cell address is invalid. |
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().