LibreOffice Module sc (master) 1
|
Converter for cell addresses and cell ranges for OOXML and BIFF filters. More...
#include <addressconverter.hxx>
Public Member Functions | |
AddressConverter (const WorkbookHelper &rHelper) | |
const ScAddress & | getMaxApiAddress () const |
Returns the biggest valid cell address in the own Calc document. More... | |
const ScAddress & | getMaxXlsAddress () const |
Returns the biggest valid cell address in the imported/exported Excel document. More... | |
const ScAddress & | getMaxAddress () const |
Returns the biggest valid cell address in both Calc and the imported/exported Excel document. More... | |
bool | checkCol (sal_Int32 nCol, bool bTrackOverflow) |
Checks if the passed column index is valid. More... | |
bool | checkRow (sal_Int32 nRow, bool bTrackOverflow) |
Checks if the passed row index is valid. More... | |
bool | checkTab (sal_Int16 nSheet, bool bTrackOverflow) |
Checks if the passed sheet index is valid. More... | |
bool | checkCellAddress (const ScAddress &rAddress, bool bTrackOverflow) |
Checks the passed cell address if it fits into the spreadsheet limits. More... | |
bool | convertToCellAddress (ScAddress &orAddress, const OUString &rString, sal_Int16 nSheet, bool bTrackOverflow) |
Tries to convert the passed string to a single cell address. More... | |
bool | convertToCellAddress (ScAddress &rAddress, std::string_view pStr, sal_Int16 nSheet, bool bTrackOverflow) |
ScAddress | createValidCellAddress (const OUString &rString, sal_Int16 nSheet, bool bTrackOverflow) |
Returns a valid cell address by moving it into allowed dimensions. More... | |
bool | convertToCellAddress (ScAddress &orAddress, const BinAddress &rBinAddress, sal_Int16 nSheet, bool bTrackOverflow) |
Tries to convert the passed address to a single cell address. More... | |
ScAddress | createValidCellAddress (const BinAddress &rBinAddress, sal_Int16 nSheet, bool bTrackOverflow) |
Returns a valid cell address by moving it into allowed dimensions. More... | |
bool | checkCellRange (const ScRange &rRange, bool bAllowOverflow, bool bTrackOverflow) |
Checks the passed cell range if it fits into the spreadsheet limits. More... | |
bool | validateCellRange (ScRange &orRange, bool bAllowOverflow, bool bTrackOverflow) |
Checks the passed cell range, may try to fit it to current sheet limits. More... | |
bool | convertToCellRange (ScRange &orRange, std::u16string_view aString, sal_Int16 nSheet, bool bAllowOverflow, bool bTrackOverflow) |
Tries to convert the passed string to a cell range address. More... | |
bool | convertToCellRange (ScRange &orRange, const BinRange &rBinRange, sal_Int16 nSheet, bool bAllowOverflow, bool bTrackOverflow) |
Tries to convert the passed range to a cell range address. More... | |
void | validateCellRangeList (ScRangeList &orRanges, bool bTrackOverflow) |
Tries to restrict the passed cell range list to current sheet limits. More... | |
void | convertToCellRangeList (ScRangeList &orRanges, std::u16string_view aString, sal_Int16 nSheet, bool bTrackOverflow) |
Tries to convert the passed string to a cell range list. More... | |
void | convertToCellRangeList (ScRangeList &orRanges, const BinRangeList &rBinRanges, sal_Int16 nSheet, bool bTrackOverflow) |
Tries to convert the passed range list to a cell range list. More... | |
bool | isColOverflow () const |
bool | isRowOverflow () const |
bool | isTabOverflow () const |
Public Member Functions inherited from oox::xls::WorkbookHelper | |
WorkbookHelper (WorkbookGlobals &rBookGlob) | |
virtual | ~WorkbookHelper () |
WorkbookHelper (WorkbookHelper const &)=default | |
WorkbookHelper (WorkbookHelper &&)=default | |
WorkbookHelper & | operator= (WorkbookHelper const &)=delete |
WorkbookHelper & | operator= (WorkbookHelper &&)=delete |
::oox::core::FilterBase & | getBaseFilter () const |
Returns the base filter object (base class of all filters). More... | |
SegmentProgressBar & | getProgressBar () const |
Returns the filter progress bar. More... | |
sal_Int16 | getCurrentSheetIndex () const |
Returns the index of the current Calc sheet, if filter currently processes a sheet. More... | |
bool | isGeneratorKnownGood () const |
Returns true when reading a file generated by a known good generator. More... | |
bool | hasCalculatedFormulaCells () const |
Returns true if any formula cell is calculated. More... | |
void | setCalculatedFormulaCells () |
Set if any formula cell is calculated. More... | |
void | setVbaProjectStorage (const StorageRef &rxVbaPrjStrg) |
Sets the VBA project storage used to import VBA source code and forms. More... | |
void | setCurrentSheetIndex (SCTAB nSheet) |
Sets the index of the current Calc sheet, if filter currently processes a sheet. More... | |
void | finalizeWorkbookImport () |
Final conversion after importing the workbook. More... | |
void | useInternalChartDataTable (bool bInternal) |
ScDocument & | getScDocument () |
const ScDocument & | getScDocument () const |
ScDocumentImport & | getDocImport () |
const ScDocumentImport & | getDocImport () const |
ScEditEngineDefaulter & | getEditEngine () const |
const css::uno::Reference< css::sheet::XSpreadsheetDocument > & | getDocument () const |
Returns a reference to the source/target spreadsheet document model. More... | |
css::uno::Reference< css::sheet::XSpreadsheet > | getSheetFromDoc (sal_Int32 nSheet) const |
Returns a reference to the specified spreadsheet in the document model. More... | |
css::uno::Reference< css::sheet::XSpreadsheet > | getSheetFromDoc (const OUString &rSheet) const |
Returns a reference to the specified spreadsheet in the document model. More... | |
css::uno::Reference< css::table::XCellRange > | getCellRangeFromDoc (const ScRange &rRange) const |
Returns the XCellRange interface for the passed cell range address. More... | |
css::uno::Reference< css::container::XNameContainer > | getCellStyleFamily () const |
Returns the cell styles container from the Calc document. More... | |
css::uno::Reference< css::style::XStyle > | getStyleObject (const OUString &rStyleName, bool bPageStyle) const |
Returns the specified cell or page style from the Calc document. More... | |
RangeDataRet | createNamedRangeObject (OUString &orName, sal_Int32 nIndex, sal_Int32 nNameFlags, bool bHidden) const |
Creates and returns a defined name on-the-fly in the Calc document. More... | |
RangeDataRet | createLocalNamedRangeObject (OUString &orName, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab, bool bHidden) const |
Creates and returns a defined name on-the-fly in the sheet. More... | |
css::uno::Reference< css::sheet::XDatabaseRange > | createDatabaseRangeObject (OUString &orName, const ScRange &rRangeAddr) const |
Creates and returns a database range on-the-fly in the Calc document. More... | |
css::uno::Reference< css::sheet::XDatabaseRange > | createUnnamedDatabaseRangeObject (const ScRange &rRangeAddr) const |
Creates and returns an unnamed database range on-the-fly in the Calc document. More... | |
ScDBData * | findDatabaseRangeByIndex (sal_uInt16 nIndex) const |
Finds the (already existing) database range of the given formula token index. More... | |
css::uno::Reference< css::style::XStyle > | createStyleObject (OUString &orStyleName, bool bPageStyle) const |
Creates and returns a com.sun.star.style.Style object for cells or pages. More... | |
FormulaBuffer & | getFormulaBuffer () const |
WorkbookSettings & | getWorkbookSettings () const |
Returns the global workbook settings object. More... | |
ViewSettings & | getViewSettings () const |
Returns the workbook and sheet view settings object. More... | |
WorksheetBuffer & | getWorksheets () const |
Returns the worksheet buffer containing sheet names and properties. More... | |
ThemeBuffer & | getTheme () const |
Returns the office theme object read from the theme substorage. More... | |
StylesBuffer & | getStyles () const |
Returns all cell formatting objects read from the styles substream. More... | |
SharedStringsBuffer & | getSharedStrings () const |
Returns the shared strings read from the shared strings substream. More... | |
ExternalLinkBuffer & | getExternalLinks () const |
Returns the external links read from the external links substream. More... | |
DefinedNamesBuffer & | getDefinedNames () const |
Returns the defined names read from the workbook globals. More... | |
TableBuffer & | getTables () const |
Returns the tables collection (equivalent to Calc's database ranges). More... | |
ScenarioBuffer & | getScenarios () const |
Returns the scenarios collection. More... | |
ConnectionsBuffer & | getConnections () const |
Returns the collection of external data connections. More... | |
PivotCacheBuffer & | getPivotCaches () const |
Returns the collection of pivot caches. More... | |
PivotTableBuffer & | getPivotTables () const |
Returns the collection of pivot tables. More... | |
FormulaParser & | getFormulaParser () const |
Returns a shared import formula parser (import filter only!). More... | |
FormulaParser * | createFormulaParser () const |
Returns an unshared import formula parser (import filter only!). More... | |
UnitConverter & | getUnitConverter () const |
Returns the measurement unit converter. More... | |
AddressConverter & | getAddressConverter () const |
Returns the converter for string to cell address/range conversion. More... | |
oox::drawingml::chart::ChartConverter * | getChartConverter () const |
Returns the chart object converter. More... | |
PageSettingsConverter & | getPageSettingsConverter () const |
Returns the page and print settings converter. More... | |
::oox::core::XmlFilterBase & | getOoxFilter () const |
Returns the base OOXML/BIFF12 filter object. More... | |
bool | importOoxFragment (const rtl::Reference< oox::core::FragmentHandler > &rxHandler) |
Imports a fragment using the passed fragment handler, which contains the full path to the fragment stream. More... | |
bool | importOoxFragment (const rtl::Reference< oox::core::FragmentHandler > &rxHandler, oox::core::FastParser &rParser) |
rtl_TextEncoding | getTextEncoding () const |
Returns the text encoding used to import/export byte strings. More... | |
Static Public Member Functions | |
static bool | parseOoxAddress2d (sal_Int32 &ornColumn, sal_Int32 &ornRow, std::u16string_view aString, sal_Int32 nStart=0, sal_Int32 nLength=SAL_MAX_INT32) |
Tries to parse the passed string for a 2d cell address in A1 notation. More... | |
static bool | parseOoxAddress2d (sal_Int32 &ornColumn, sal_Int32 &ornRow, std::string_view pStr) |
static bool | parseOoxRange2d (sal_Int32 &ornStartColumn, sal_Int32 &ornStartRow, sal_Int32 &ornEndColumn, sal_Int32 &ornEndRow, std::u16string_view aString, sal_Int32 nStart=0) |
Tries to parse the passed string for a 2d cell range in A1 notation. More... | |
static bool | convertToCellAddressUnchecked (ScAddress &orAddress, const OUString &rString, sal_Int16 nSheet) |
Converts the passed string to a single cell address, without checking any sheet limits. More... | |
static bool | convertToCellAddressUnchecked (ScAddress &orAddress, std::string_view pStr, sal_Int16 nSheet) |
static void | convertToCellAddressUnchecked (ScAddress &orAddress, const BinAddress &rBinAddress, sal_Int16 nSheet) |
Converts the passed address to a single cell address, without checking any sheet limits. More... | |
static bool | convertToCellRangeUnchecked (ScRange &orRange, std::u16string_view aString, sal_Int16 nSheet) |
Converts the passed string to a cell range address, without checking any sheet limits. More... | |
static void | convertToCellRangeUnchecked (ScRange &orRange, const BinRange &rBinRange, sal_Int16 nSheet) |
Converts the passed range to a cell range address, without checking any sheet limits. More... | |
static css::uno::Sequence< css::table::CellRangeAddress > | toApiSequence (const ScRangeList &orRanges) |
Converts the passed range list to a sequence of cell range addresses. More... | |
Static Public Member Functions inherited from oox::xls::WorkbookHelper | |
static WorkbookGlobalsRef | constructGlobals (ExcelFilter &rFilter) |
Private Member Functions | |
void | initializeMaxPos (sal_Int16 nMaxXlsTab, sal_Int32 nMaxXlsCol, sal_Int32 nMaxXlsRow) |
Private Attributes | |
ScAddress | maMaxApiPos |
ScAddress | maMaxXlsPos |
Maximum valid cell address in Calc. More... | |
ScAddress | maMaxPos |
Maximum valid cell address in Excel. More... | |
bool | mbColOverflow |
Maximum valid cell address in Calc/Excel. More... | |
bool | mbRowOverflow |
Flag for "columns overflow". More... | |
bool | mbTabOverflow |
Flag for "rows overflow". More... | |
Additional Inherited Members | |
Public Types inherited from oox::xls::WorkbookHelper | |
typedef std::pair< ScRangeData *, bool > | RangeDataRet |
Converter for cell addresses and cell ranges for OOXML and BIFF filters.
Definition at line 95 of file addressconverter.hxx.
|
explicit |
Definition at line 72 of file addressconverter.cxx.
References initializeMaxPos().
bool oox::xls::AddressConverter::checkCellAddress | ( | const ScAddress & | rAddress, |
bool | bTrackOverflow | ||
) |
Checks the passed cell address if it fits into the spreadsheet limits.
rAddress | The cell address to be checked. |
bTrackOverflow | true = Update the internal overflow flags, if the address is outside of the supported sheet limits. |
Definition at line 250 of file addressconverter.cxx.
References checkCol(), checkRow(), checkTab(), ScAddress::Col(), ScAddress::Row(), and ScAddress::Tab().
Referenced by convertToCellAddress(), oox::xls::Scenario::finalizeImport(), and oox::xls::SheetDataContext::importCell().
bool oox::xls::AddressConverter::checkCellRange | ( | const ScRange & | rRange, |
bool | bAllowOverflow, | ||
bool | bTrackOverflow | ||
) |
Checks the passed cell range if it fits into the spreadsheet limits.
rRange | The cell range address to be checked. |
bAllowOverflow | true = Allow ranges that start inside the supported sheet limits but may end outside of these limits. false = Do not allow ranges that overflow the supported limits. |
bTrackOverflow | true = Update the internal overflow flags, if the passed range contains cells outside of the supported sheet limits. |
Definition at line 343 of file addressconverter.cxx.
References ScRange::aEnd, ScRange::aStart, checkCol(), checkRow(), checkTab(), ScAddress::Col(), ScAddress::Row(), and ScAddress::Tab().
Referenced by oox::xls::PivotCache::finalizeInternalSheetSource(), and validateCellRange().
bool oox::xls::AddressConverter::checkCol | ( | sal_Int32 | nCol, |
bool | bTrackOverflow | ||
) |
Checks if the passed column index is valid.
nCol | The column index to check. |
bTrackOverflow | true = Update the internal overflow flag, if the column index is outside of the supported limits. |
Definition at line 226 of file addressconverter.cxx.
References ScAddress::Col(), maMaxPos, and mbColOverflow.
Referenced by oox::xls::ShapeAnchor::calcAnchorRectEmu(), checkCellAddress(), checkCellRange(), and oox::xls::SheetDataContext::importRow().
bool oox::xls::AddressConverter::checkRow | ( | sal_Int32 | nRow, |
bool | bTrackOverflow | ||
) |
Checks if the passed row index is valid.
nRow | The row index to check. |
bTrackOverflow | true = Update the internal overflow flag, if the row index is outside of the supported limits. |
Definition at line 234 of file addressconverter.cxx.
References maMaxPos, mbRowOverflow, and ScAddress::Row().
Referenced by oox::xls::ShapeAnchor::calcAnchorRectEmu(), checkCellAddress(), checkCellRange(), and oox::xls::SheetDataContext::importRow().
bool oox::xls::AddressConverter::checkTab | ( | sal_Int16 | nSheet, |
bool | bTrackOverflow | ||
) |
Checks if the passed sheet index is valid.
nSheet | The sheet index to check. |
bTrackOverflow | true = Update the internal overflow flag, if the sheet index is outside of the supported limits. |
Definition at line 242 of file addressconverter.cxx.
References maMaxPos, mbTabOverflow, and ScAddress::Tab().
Referenced by checkCellAddress(), and checkCellRange().
bool oox::xls::AddressConverter::convertToCellAddress | ( | ScAddress & | orAddress, |
const BinAddress & | rBinAddress, | ||
sal_Int16 | nSheet, | ||
bool | bTrackOverflow | ||
) |
Tries to convert the passed address to a single cell address.
orAddress | (out-parameter) Returns the converted cell address. |
rBinAddress | Binary cell address struct. |
nSheet | Sheet index to be inserted into orAddress (will be checked). |
bTrackOverflow | true = Update the internal overflow flags, if the address is outside of the supported sheet limits. |
Definition at line 323 of file addressconverter.cxx.
References checkCellAddress(), and convertToCellAddressUnchecked().
bool oox::xls::AddressConverter::convertToCellAddress | ( | ScAddress & | orAddress, |
const OUString & | rString, | ||
sal_Int16 | nSheet, | ||
bool | bTrackOverflow | ||
) |
Tries to convert the passed string to a single cell address.
orAddress | (out-parameter) Returns the converted cell address. |
rString | Cell address string in A1 notation. |
nSheet | Sheet index to be inserted into orAddress (will be checked). |
bTrackOverflow | true = Update the internal overflow flags, if the address is outside of the supported sheet limits. |
Definition at line 284 of file addressconverter.cxx.
References checkCellAddress(), and convertToCellAddressUnchecked().
Referenced by createValidCellAddress(), oox::xls::SheetDataContext::importCell(), and oox::xls::SheetDataContext::readCellHeader().
bool oox::xls::AddressConverter::convertToCellAddress | ( | ScAddress & | rAddress, |
std::string_view | pStr, | ||
sal_Int16 | nSheet, | ||
bool | bTrackOverflow | ||
) |
Definition at line 292 of file addressconverter.cxx.
References checkCellAddress(), and convertToCellAddressUnchecked().
|
static |
Converts the passed address to a single cell address, without checking any sheet limits.
orAddress | (out-parameter) Returns the converted cell address. |
rBinAddress | Binary cell address struct. |
nSheet | Sheet index to be inserted into orAddress. |
Definition at line 315 of file addressconverter.cxx.
References oox::xls::BinAddress::mnCol, oox::xls::BinAddress::mnRow, ScAddress::SetCol(), ScAddress::SetRow(), and ScAddress::SetTab().
|
static |
Converts the passed string to a single cell address, without checking any sheet limits.
orAddress | (out-parameter) Returns the converted cell address. |
rString | Cell address string in A1 notation. |
nSheet | Sheet index to be inserted into orAddress. |
Definition at line 258 of file addressconverter.cxx.
References parseOoxAddress2d(), ScAddress::SetCol(), ScAddress::SetRow(), and ScAddress::SetTab().
Referenced by convertToCellAddress(), and oox::xls::Scenario::importInputCells().
|
static |
Definition at line 271 of file addressconverter.cxx.
References parseOoxAddress2d(), ScAddress::SetCol(), ScAddress::SetRow(), and ScAddress::SetTab().
bool oox::xls::AddressConverter::convertToCellRange | ( | ScRange & | orRange, |
const BinRange & | rBinRange, | ||
sal_Int16 | nSheet, | ||
bool | bAllowOverflow, | ||
bool | bTrackOverflow | ||
) |
Tries to convert the passed range to a cell range address.
orRange | (out-parameter) Returns the converted cell range address. If the passed original range contains cells outside the currently supported spreadsheet limits, and parameter bAllowOverflow is set to true, the range will be cropped to these limits. |
rBinRange | Binary cell range struct. |
nSheet | Sheet index to be inserted into orRange (will be checked). |
bAllowOverflow | true = Allow ranges that start inside the supported sheet limits but may end outside of these limits. The cell range returned in orRange will be cropped to these limits. false = Do not allow ranges that overflow the supported limits. |
bTrackOverflow | true = Update the internal overflow flags, if the original range contains cells outside of the supported sheet limits. |
Definition at line 412 of file addressconverter.cxx.
References convertToCellRangeUnchecked(), and validateCellRange().
bool oox::xls::AddressConverter::convertToCellRange | ( | ScRange & | orRange, |
std::u16string_view | aString, | ||
sal_Int16 | nSheet, | ||
bool | bAllowOverflow, | ||
bool | bTrackOverflow | ||
) |
Tries to convert the passed string to a cell range address.
orRange | (out-parameter) Returns the converted cell range address. If the original range in the passed string contains cells outside the currently supported spreadsheet limits, and parameter bAllowOverflow is set to true, the range will be cropped to these limits. Example: the range string "A1:ZZ100000" may be converted to the range A1:IV65536. |
aString | Cell range string in A1 notation. |
nSheet | Sheet index to be inserted into orRange (will be checked). |
bAllowOverflow | true = Allow ranges that start inside the supported sheet limits but may end outside of these limits. The cell range returned in orRange will be cropped to these limits. false = Do not allow ranges that overflow the supported limits. |
bTrackOverflow | true = Update the internal overflow flags, if the original range contains cells outside of the supported sheet limits. |
Definition at line 393 of file addressconverter.cxx.
References convertToCellRangeUnchecked(), and validateCellRange().
Referenced by convertToCellRangeList(), oox::xls::SheetDataContext::importFormula(), oox::xls::ViewSettings::importOleSize(), and oox::xls::SheetDataContext::readFormulaRef().
void oox::xls::AddressConverter::convertToCellRangeList | ( | ScRangeList & | orRanges, |
const BinRangeList & | rBinRanges, | ||
sal_Int16 | nSheet, | ||
bool | bTrackOverflow | ||
) |
Tries to convert the passed range list to a cell range list.
orRanges | (out-parameter) Returns the converted cell range addresses. If a range in the passed string contains cells outside the currently supported spreadsheet limits, it will be cropped to these limits. Example: the range string "A1:ZZ100000" may be converted to the range A1:IV65536. If a range is completely outside the limits, it will be omitted. |
rBinRanges | List of binary cell range objects. |
nSheet | Sheet index to be inserted into orRanges (will be checked). |
bTrackOverflow | true = Update the internal overflow flags, if the original ranges contain cells outside of the supported sheet limits. |
Definition at line 440 of file addressconverter.cxx.
References convertToCellRange(), and ScRangeList::push_back().
void oox::xls::AddressConverter::convertToCellRangeList | ( | ScRangeList & | orRanges, |
std::u16string_view | aString, | ||
sal_Int16 | nSheet, | ||
bool | bTrackOverflow | ||
) |
Tries to convert the passed string to a cell range list.
orRanges | (out-parameter) Returns the converted cell range addresses. If a range in the passed string contains cells outside the currently supported spreadsheet limits, it will be cropped to these limits. Example: the range string "A1:ZZ100000" may be converted to the range A1:IV65536. If a range is completely outside the limits, it will be omitted. |
rString | Cell range list string in A1 notation, space separated. |
nSheet | Sheet index to be inserted into orRanges (will be checked). |
bTrackOverflow | true = Update the internal overflow flags, if the original ranges contain cells outside of the supported sheet limits. |
Definition at line 426 of file addressconverter.cxx.
References convertToCellRange(), o3tl::getToken(), nPos, ScRangeList::push_back(), and u.
Referenced by oox::xls::CondFormat::importCondFormatting(), oox::xls::CondFormat::importConditionalFormatting(), oox::xls::WorksheetSettings::importProtectedRange(), and oox::xls::SheetViewSettings::importSelection().
|
static |
Converts the passed range to a cell range address, without checking any sheet limits.
orRange | (out-parameter) Returns the converted range address. |
rBinRange | Binary cell range struct. |
nSheet | Sheet index to be inserted into orRange. |
Definition at line 401 of file addressconverter.cxx.
References ScRange::aEnd, ScRange::aStart, oox::xls::BinRange::maFirst, oox::xls::BinRange::maLast, oox::xls::BinAddress::mnCol, oox::xls::BinAddress::mnRow, ScAddress::SetCol(), ScAddress::SetRow(), and ScAddress::SetTab().
|
static |
Converts the passed string to a cell range address, without checking any sheet limits.
orRange | (out-parameter) Returns the converted range address. |
rString | Cell range string in A1 notation. |
nSheet | Sheet index to be inserted into orRange. |
Definition at line 376 of file addressconverter.cxx.
References ScRange::aEnd, ScRange::aStart, ScAddress::Col(), parseOoxRange2d(), ScAddress::Row(), ScAddress::SetCol(), ScAddress::SetRow(), and ScAddress::SetTab().
Referenced by convertToCellRange(), oox::xls::AutoFilter::importAutoFilter(), oox::xls::Comment::importComment(), oox::xls::WorksheetFragment::importDimension(), oox::xls::PivotTable::importLocation(), oox::xls::PivotCache::importPCDSheetSource(), oox::xls::PivotTable::importPTLocation(), oox::xls::SortCondition::importSortCondition(), oox::xls::AutoFilter::importSortState(), oox::xls::Table::importTable(), and oox::xls::PivotCache::importWorksheetSource().
ScAddress oox::xls::AddressConverter::createValidCellAddress | ( | const BinAddress & | rBinAddress, |
sal_Int16 | nSheet, | ||
bool | bTrackOverflow | ||
) |
Returns a valid cell address by moving it into allowed dimensions.
rBinAddress | Binary cell address struct. |
nSheet | Sheet index for the returned address (will be checked). |
bTrackOverflow | true = Update the internal overflow flags, if the address is outside of the supported sheet limits. |
Definition at line 330 of file addressconverter.cxx.
References ScAddress::Col(), convertToCellAddress(), maMaxPos, oox::xls::BinAddress::mnCol, oox::xls::BinAddress::mnRow, ScAddress::Row(), ScAddress::SetCol(), ScAddress::SetRow(), ScAddress::SetTab(), and ScAddress::Tab().
ScAddress oox::xls::AddressConverter::createValidCellAddress | ( | const OUString & | rString, |
sal_Int16 | nSheet, | ||
bool | bTrackOverflow | ||
) |
Returns a valid cell address by moving it into allowed dimensions.
rString | Cell address string in A1 notation. |
nSheet | Sheet index for the returned address (will be checked). |
bTrackOverflow | true = Update the internal overflow flags, if the address is outside of the supported sheet limits. |
Definition at line 302 of file addressconverter.cxx.
References ScAddress::Col(), convertToCellAddress(), maMaxPos, ScAddress::Row(), ScAddress::SetCol(), ScAddress::SetRow(), ScAddress::SetTab(), and ScAddress::Tab().
Referenced by oox::xls::ShapeAnchor::calcAnchorRectEmu(), oox::xls::SheetViewSettings::importPane(), oox::xls::SheetViewSettings::importSelection(), and oox::xls::SheetViewSettings::importSheetView().
|
inline |
Returns the biggest valid cell address in both Calc and the imported/exported Excel document.
Definition at line 163 of file addressconverter.hxx.
References maMaxPos.
Referenced by oox::xls::DefinedName::convertFormula().
|
inline |
Returns the biggest valid cell address in the own Calc document.
Definition at line 153 of file addressconverter.hxx.
References maMaxApiPos.
Referenced by oox::xls::SheetDataBuffer::addColXfStyleProcessRowRanges(), oox::xls::SheetViewSettings::finalizeImport(), oox::xls::PivotCache::importPCRecord(), oox::xls::ExternalName::setResultSize(), and oox::xls::PivotCache::writeSourceHeaderCells().
|
inline |
Returns the biggest valid cell address in the imported/exported Excel document.
Definition at line 158 of file addressconverter.hxx.
References maMaxXlsPos.
|
private |
Definition at line 463 of file addressconverter.cxx.
References Exception, oox::xls::WorkbookHelper::getBaseFilter(), oox::xls::WorkbookHelper::getDocument(), oox::core::FilterBase::isImportFilter(), maMaxApiPos, maMaxPos, maMaxXlsPos, and ScAddress::Set().
Referenced by AddressConverter().
|
inline |
Definition at line 484 of file addressconverter.hxx.
References mbColOverflow.
Referenced by oox::xls::ExcelFilter::importDocument().
|
inline |
Definition at line 485 of file addressconverter.hxx.
References mbRowOverflow.
Referenced by oox::xls::ExcelFilter::importDocument().
|
inline |
Definition at line 486 of file addressconverter.hxx.
References mbTabOverflow.
Referenced by oox::xls::ExcelFilter::importDocument().
|
static |
Definition at line 142 of file addressconverter.cxx.
References aStr.
|
static |
Tries to parse the passed string for a 2d cell address in A1 notation.
This function accepts all strings that match the regular expression "[a-zA-Z]{1,6}0*[1-9][0-9]{0,8}" (without quotes), i.e. 1 to 6 letters for the column index (translated to 0-based column indexes from 0 to 321,272,405), and 1 to 9 digits for the 1-based row index (translated to 0-based row indexes from 0 to 999,999,998). The row number part may contain leading zeros, they will be ignored. It is up to the caller to handle cell addresses outside of a specific valid range (e.g. the entire spreadsheet).
ornColumn | (out-parameter) Returns the converted column index. |
ornRow | (out-parameter) returns the converted row index. |
rString | The string containing the cell address. |
nStart | Start index of string part in rString to be parsed. |
nLength | Length of string part in rString to be parsed. |
Definition at line 81 of file addressconverter.cxx.
References nLength.
Referenced by convertToCellAddressUnchecked(), and parseOoxRange2d().
|
static |
Tries to parse the passed string for a 2d cell range in A1 notation.
This function accepts all strings that match the regular expression "ADDR(:ADDR)?" (without quotes), where ADDR is a cell address accepted by the parseOoxAddress2d() function of this class. It is up to the caller to handle cell ranges outside of a specific valid range (e.g. the entire spreadsheet).
ornStartColumn | (out-parameter) Returns the converted start column index. |
ornStartRow | (out-parameter) returns the converted start row index. |
ornEndColumn | (out-parameter) Returns the converted end column index. |
ornEndRow | (out-parameter) returns the converted end row index. |
rString | The string containing the cell address. |
nStart | Start index of string part in rString to be parsed. |
Definition at line 198 of file addressconverter.cxx.
References parseOoxAddress2d(), and SAL_MAX_INT32.
Referenced by convertToCellRangeUnchecked().
|
static |
Converts the passed range list to a sequence of cell range addresses.
orRanges | List of range objects. |
Definition at line 449 of file addressconverter.cxx.
References ScUnoConversion::FillApiRange(), i, and ScRangeList::size().
Referenced by oox::xls::DefinedName::convertFormula(), oox::xls::Scenario::finalizeImport(), and oox::xls::WorksheetGlobals::getCellRangeList().
bool oox::xls::AddressConverter::validateCellRange | ( | ScRange & | orRange, |
bool | bAllowOverflow, | ||
bool | bTrackOverflow | ||
) |
Checks the passed cell range, may try to fit it to current sheet limits.
First, this function reorders the column and row indexes so that the starting indexes are less than or equal to the end indexes. Then, depending on the parameter bAllowOverflow, the range is just checked or cropped to the current sheet limits.
orRange | (in-out-parameter) Converts the passed cell range into a valid cell range address. If the passed range contains cells outside the currently supported spreadsheet limits, it will be cropped to these limits. |
bAllowOverflow | true = Allow ranges that start inside the supported sheet limits but may end outside of these limits. The cell range returned in orRange will be cropped to these limits. false = Do not allow ranges that overflow the supported limits. The function will return false when the range overflows the sheet limits. |
bTrackOverflow | true = Update the internal overflow flags, if the original range contains cells outside of the supported sheet limits. |
Definition at line 353 of file addressconverter.cxx.
References ScRange::aEnd, ScRange::aStart, checkCellRange(), ScAddress::Col(), maMaxPos, ScAddress::Row(), ScAddress::SetCol(), and ScAddress::SetRow().
Referenced by convertToCellRange(), oox::xls::WorkbookGlobals::createDatabaseRangeObject(), oox::xls::WorkbookGlobals::createUnnamedDatabaseRangeObject(), and validateCellRangeList().
void oox::xls::AddressConverter::validateCellRangeList | ( | ScRangeList & | orRanges, |
bool | bTrackOverflow | ||
) |
Tries to restrict the passed cell range list to current sheet limits.
orRanges | (in-out-parameter) Restricts the cell range addresses in the passed list to the current sheet limits and removes invalid ranges from the list. |
bTrackOverflow | true = Update the internal overflow flags, if the original ranges contain cells outside of the supported sheet limits. |
Definition at line 419 of file addressconverter.cxx.
References nIndex, ScRangeList::Remove(), ScRangeList::size(), and validateCellRange().
Referenced by oox::xls::FormulaProcessorBase::extractCellRangeList().
|
private |
Definition at line 493 of file addressconverter.hxx.
Referenced by getMaxApiAddress(), and initializeMaxPos().
|
private |
Maximum valid cell address in Excel.
Definition at line 495 of file addressconverter.hxx.
Referenced by checkCol(), checkRow(), checkTab(), createValidCellAddress(), getMaxAddress(), initializeMaxPos(), and validateCellRange().
|
private |
Maximum valid cell address in Calc.
Definition at line 494 of file addressconverter.hxx.
Referenced by getMaxXlsAddress(), and initializeMaxPos().
|
private |
Maximum valid cell address in Calc/Excel.
Definition at line 496 of file addressconverter.hxx.
Referenced by checkCol(), and isColOverflow().
|
private |
Flag for "columns overflow".
Definition at line 497 of file addressconverter.hxx.
Referenced by checkRow(), and isRowOverflow().
|
private |
Flag for "rows overflow".
Definition at line 498 of file addressconverter.hxx.
Referenced by checkTab(), and isTabOverflow().