LibreOffice Module sc (master) 1
|
Provides functions to convert Calc cell addresses to Excel cell addresses. More...
#include <xehelper.hxx>
Public Member Functions | |
XclExpAddressConverter (const XclExpRoot &rRoot) | |
bool | CheckAddress (const ScAddress &rScPos, bool bWarn) |
Checks if the passed Calc cell address is valid. More... | |
bool | ConvertAddress (XclAddress &rXclPos, const ScAddress &rScPos, bool bWarn) |
Converts the passed Calc cell address to an Excel cell address. More... | |
XclAddress | CreateValidAddress (const ScAddress &rScPos, bool bWarn) |
Returns a valid cell address by moving it into allowed dimensions. More... | |
bool | CheckRange (const ScRange &rScRange, bool bWarn) |
Checks if the passed cell range is valid (checks start and end position). More... | |
bool | ValidateRange (ScRange &rScRange, bool bWarn) |
Checks and eventually crops the cell range to valid dimensions. More... | |
bool | ConvertRange (XclRange &rXclRange, const ScRange &rScRange, bool bWarn) |
Converts the passed Calc cell range to an Excel cell range. More... | |
void | ValidateRangeList (ScRangeList &rScRanges, bool bWarn) |
Checks and eventually crops the cell ranges to valid dimensions. More... | |
void | ConvertRangeList (XclRangeList &rXclRanges, const ScRangeList &rScRanges, bool bWarn) |
Converts the passed Calc cell range list to an Excel 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 Calc cell addresses to Excel cell addresses.
Definition at line 81 of file xehelper.hxx.
|
explicit |
Definition at line 164 of file xehelper.cxx.
bool XclExpAddressConverter::CheckAddress | ( | const ScAddress & | rScPos, |
bool | bWarn | ||
) |
Checks if the passed Calc cell address is valid.
rScPos | The Calc 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 171 of file xehelper.cxx.
References ScAddress::Col(), XclAddressConverterBase::maMaxPos, XclAddressConverterBase::mbColTrunc, XclAddressConverterBase::mbRowTrunc, XclAddressConverterBase::mbTabTrunc, XclAddressConverterBase::mrTracer, ScAddress::Row(), ScAddress::Tab(), and XclTracer::TraceInvalidAddress().
Referenced by CheckRange(), ConvertAddress(), ConvertRange(), and ValidateRange().
bool XclExpAddressConverter::CheckRange | ( | const ScRange & | rScRange, |
bool | bWarn | ||
) |
Checks if the passed cell range is valid (checks start and end position).
rScRange | The Calc cell range to check. |
bWarn | true = Sets the internal flag that produces a warning box after loading/saving the file, if the cell range is not valid. |
Definition at line 211 of file xehelper.cxx.
References ScRange::aEnd, ScRange::aStart, and CheckAddress().
Referenced by ValidateRangeList().
bool XclExpAddressConverter::ConvertAddress | ( | XclAddress & | rXclPos, |
const ScAddress & | rScPos, | ||
bool | bWarn | ||
) |
Converts the passed Calc cell address to an Excel cell address.
rXclPos | (Out) The converted Excel cell address, if valid. |
rScPos | The Calc 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 not valid. |
Definition at line 192 of file xehelper.cxx.
References CheckAddress(), ScAddress::Col(), and ScAddress::Row().
Referenced by CreateValidAddress(), and XclExpDffDropDownAnchor::XclExpDffDropDownAnchor().
bool XclExpAddressConverter::ConvertRange | ( | XclRange & | rXclRange, |
const ScRange & | rScRange, | ||
bool | bWarn | ||
) |
Converts the passed Calc cell range to an Excel cell range.
rXclRange | (Out) The converted Excel cell range, if valid. |
rScRange | The Calc 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 237 of file xehelper.cxx.
References ScRange::aEnd, ScRange::aStart, CheckAddress(), ScAddress::Col(), XclRange::maFirst, XclRange::maLast, XclAddressConverterBase::maMaxPos, and ScAddress::Row().
Referenced by ConvertRangeList().
void XclExpAddressConverter::ConvertRangeList | ( | XclRangeList & | rXclRanges, |
const ScRangeList & | rScRanges, | ||
bool | bWarn | ||
) |
Converts the passed Calc cell range list to an Excel 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 Excel cell range list.
rXclRanges | (Out) The converted Excel cell range list. |
rScRanges | The Calc 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 271 of file xehelper.cxx.
References XclRangeList::clear(), ConvertRange(), nCount, nPos, XclRangeList::push_back(), ScRangeList::size(), and ScAddress::UNINITIALIZED.
Referenced by XclExpTabViewSettings::CreateSelectionData(), XclExpDV::Finalize(), XclExpMergedcells::Save(), XclExpLabelranges::Save(), XclExpSheetEnhancedProtection::WriteBody(), and XclExpCondfmt::XclExpCondfmt().
XclAddress XclExpAddressConverter::CreateValidAddress | ( | const ScAddress & | rScPos, |
bool | bWarn | ||
) |
Returns a valid cell address by moving it into allowed dimensions.
rScPos | The Calc 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 201 of file xehelper.cxx.
References ScAddress::Col(), ConvertAddress(), XclAddressConverterBase::maMaxPos, ScAddress::Row(), and ScAddress::UNINITIALIZED.
Referenced by XclExpTabViewSettings::CreateSelectionData(), XclExpTabViewSettings::SaveXml(), and XclExpTabViewSettings::XclExpTabViewSettings().
bool XclExpAddressConverter::ValidateRange | ( | ScRange & | rScRange, |
bool | bWarn | ||
) |
Checks and eventually crops the cell range to valid dimensions.
@descr The start position of the range will not be modified.
rScRange | (In/out) The cell range to validate. |
bWarn | true = Sets the internal flag that produces a warning box after loading/saving the file, if the cell range contains invalid cells. If the range is partly valid, this function sets the warning flag, corrects the range and returns true. |
Definition at line 216 of file xehelper.cxx.
References ScRange::aEnd, ScRange::aStart, CheckAddress(), ScAddress::Col(), XclAddressConverterBase::maMaxPos, ScRange::PutInOrder(), ScAddress::Row(), ScAddress::SetCol(), ScAddress::SetRow(), ScAddress::SetTab(), and ScAddress::Tab().
Referenced by XclExpCellTable::XclExpCellTable(), and XclExpFormulaCell::XclExpFormulaCell().
void XclExpAddressConverter::ValidateRangeList | ( | ScRangeList & | rScRanges, |
bool | bWarn | ||
) |
Checks and eventually crops the cell ranges to valid dimensions.
@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 removed from the cell range list.
rScRanges | (In/out) The cell range list to check. |
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 261 of file xehelper.cxx.
References CheckRange(), ScRangeList::Remove(), and ScRangeList::size().
Referenced by XclExpNameManagerImpl::CreateBuiltInNames().