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

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

#include <xehelper.hxx>

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

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
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 Calc cell addresses to Excel cell addresses.

Definition at line 81 of file xehelper.hxx.

Constructor & Destructor Documentation

◆ XclExpAddressConverter()

XclExpAddressConverter::XclExpAddressConverter ( const XclExpRoot rRoot)
explicit

Definition at line 164 of file xehelper.cxx.

Member Function Documentation

◆ CheckAddress()

bool XclExpAddressConverter::CheckAddress ( const ScAddress rScPos,
bool  bWarn 
)

Checks if the passed Calc cell address is valid.

Parameters
rScPosThe Calc 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 rScPos is 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().

◆ CheckRange()

bool XclExpAddressConverter::CheckRange ( const ScRange rScRange,
bool  bWarn 
)

Checks if the passed cell range is valid (checks start and end position).

Parameters
rScRangeThe Calc cell range to check.
bWarntrue = Sets the internal flag that produces a warning box after loading/saving the file, if the cell range is not valid.
Returns
true = Cell range in rScRange is valid.

Definition at line 211 of file xehelper.cxx.

References ScRange::aEnd, ScRange::aStart, and CheckAddress().

Referenced by ValidateRangeList().

◆ ConvertAddress()

bool XclExpAddressConverter::ConvertAddress ( XclAddress rXclPos,
const ScAddress rScPos,
bool  bWarn 
)

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

Parameters
rXclPos(Out) The converted Excel cell address, if valid.
rScPosThe Calc cell address to convert.
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 returned in rXclPos is valid.

Definition at line 192 of file xehelper.cxx.

References CheckAddress(), ScAddress::Col(), and ScAddress::Row().

Referenced by CreateValidAddress(), and XclExpDffDropDownAnchor::XclExpDffDropDownAnchor().

◆ ConvertRange()

bool XclExpAddressConverter::ConvertRange ( XclRange rXclRange,
const ScRange rScRange,
bool  bWarn 
)

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

Parameters
rXclRange(Out) The converted Excel cell range, if valid.
rScRangeThe Calc 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 rXclRange is valid (original or cropped).

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().

◆ 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.

Parameters
rXclRanges(Out) The converted Excel cell range list.
rScRangesThe Calc 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 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().

◆ CreateValidAddress()

XclAddress XclExpAddressConverter::CreateValidAddress ( const ScAddress rScPos,
bool  bWarn 
)

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

Parameters
rScPosThe Calc 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 Excel cell address.

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().

◆ ValidateRange()

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.

Parameters
rScRange(In/out) The cell range to validate.
bWarntrue = 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.
Returns
true = Cell range in rScRange is valid (original or cropped).

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().

◆ ValidateRangeList()

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.

Parameters
rScRanges(In/out) The cell range list to check.
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 261 of file xehelper.cxx.

References CheckRange(), ScRangeList::Remove(), and ScRangeList::size().

Referenced by XclExpNameManagerImpl::CreateBuiltInNames().


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