22#include <rtl/ustrbuf.hxx>
23#include <rtl/strbuf.hxx>
38 struct ExternalLinkInfo;
102 return nCol >= 0 && nCol <= nMaxCol;
108 return nRow >= 0 && nRow <= nMaxRow;
113 return nTab >= 0 && nTab <=
MAXTAB;
118 return nTab >= 0 && nTab <= nMaxTab;
136 return nCol < 0 ? 0 : (nCol > nMaxCol ? nMaxCol : nCol);
142 return nRow < 0 ? 0 : (nRow > nMaxRow ? nMaxRow : nRow);
150template <
typename T>
inline void PutInOrder(T& nStart, T& nEnd)
153 std::swap(nStart, nEnd);
230 eConv(eConvP), nRow(nRowP), nCol(nColP)
233 eConv(eConvP), nRow(rAddr.
Row()), nCol(rAddr.
Col())
236 eConv(eConvP), nRow(0), nCol(0)
250 mnFileId(0), mbExternal(false)
255 nRow(0), nCol(0), nTab(0)
258 nRow(nRowP), nCol(nColP), nTab(nTabP)
265 nRow(-1), nCol(-1), nTab(-1)
268 nRow(rAddress.nRow), nCol(rAddress.nCol), nTab(rAddress.nTab)
307 return (nRow >= 0) && (nCol >= 0) && (nTab >= 0);
314 nRow = sal::static_int_cast<SCROW>(nRow + nDelta);
318 nCol = sal::static_int_cast<SCCOL>(nCol + nDelta);
322 nTab = sal::static_int_cast<SCTAB>(nTab + nDelta);
340 const Details& rDetails = detailsOOOa1,
341 ExternalInfo* pExtInfo =
nullptr,
342 const css::uno::Sequence<css::sheet::ExternalLinkInfo>* pExternalLinks =
nullptr,
343 sal_Int32* pSheetEndPos =
nullptr,
344 const OUString* pErrRef =
nullptr );
348 const Details& rDetails = detailsOOOa1)
const;
352 const Details& rDetails = detailsOOOa1)
const;
368 inline bool lessThanByRow(
const ScAddress& rAddress )
const;
370 inline size_t hash()
const;
381 OUString GetColRowString()
const;
385template<
typename charT,
typename traits>
386inline std::basic_ostream<charT, traits> &
operator <<(std::basic_ostream<charT, traits> & stream,
const ScAddress& rAddress)
389 rAddress.
Tab()+1 <<
"!"
390 "R" << rAddress.
Row()+1 <<
391 "C" << rAddress.
Col()+1;
463#if SAL_TYPES_SIZEOFPOINTER == 8
465 return (
static_cast<size_t>(
nTab) << 36) ^
466 (
static_cast<size_t>(
nCol) << 20) ^
467 static_cast<size_t>(
nRow);
472 return (
static_cast<size_t>(
nTab) << 24) ^
473 (
static_cast<size_t>(
nCol) << 16) ^
static_cast<size_t>(
nRow);
475 return (
static_cast<size_t>(
nTab) << 28) ^
476 (
static_cast<size_t>(
nCol) << 24) ^
static_cast<size_t>(
nRow);
484 return rAddress.
hash();
505 aStart( eUninitialized ), aEnd( eUninitialized )
508 aStart( eInvalid ), aEnd( eInvalid )
511 aStart( aInputStart ), aEnd( aInputEnd )
516 aStart( rRange.aStart ), aEnd( rRange.aEnd )
519 aStart( rRange ), aEnd( rRange )
522 aStart( nCol, nRow, nTab ), aEnd( aStart )
525 aStart( nCol1, nRow1, nTab1 ), aEnd( nCol2, nRow2, nTab2 )
536 aStart = aEnd = rPos;
548 inline bool Contains(
const ScAddress& )
const;
549 inline bool Contains(
const ScRange& )
const;
550 inline bool Intersects(
const ScRange& rRange )
const;
555 const css::uno::Sequence<css::sheet::ExternalLinkInfo>* pExternalLinks =
nullptr,
556 const OUString* pErrRef =
nullptr );
589 OUString& rExternDocName, OUString& rStartTabName,
591 bool bOnlyAcceptSingle,
592 const css::uno::Sequence<css::sheet::ExternalLinkInfo>* pExternalLinks =
nullptr,
593 const OUString* pErrRef =
nullptr );
618 bool bFullAddressNotation =
false )
const;
641 void ExtendTo(
const ScRange& rRange );
646 bool IsEndColSticky(
const ScDocument& rDoc )
const;
648 bool IsEndRowSticky(
const ScDocument& rDoc )
const;
666 inline size_t hashArea()
const;
668 inline size_t hashStartColumn()
const;
672template<
typename charT,
typename traits>
673inline std::basic_ostream<charT, traits> &
operator <<(std::basic_ostream<charT, traits> & stream,
const ScRange& rRange)
744#if SAL_TYPES_SIZEOFPOINTER == 8
747 (
static_cast<size_t>(
aStart.
Row()) << 44) ^
748 (
static_cast<size_t>(
aStart.
Col()) << 32) ^
749 (
static_cast<size_t>(
aEnd.
Col()) << 20) ^
750 static_cast<size_t>(
aEnd.
Row());
760 (
static_cast<size_t>(
aStart.
Row()) << 26) ^
761 (
static_cast<size_t>(
aStart.
Col()) << 21) ^
762 (
static_cast<size_t>(
aEnd.
Col()) << 15) ^
763 static_cast<size_t>(
aEnd.
Row());
769#if SAL_TYPES_SIZEOFPOINTER == 8
772 (
static_cast<size_t>(
aStart.
Col()) << 40) ^
773 (
static_cast<size_t>(
aStart.
Row()) << 20) ^
774 static_cast<size_t>(
aEnd.
Row());
780 (
static_cast<size_t>(
aStart.
Col()) << 24) ^
781 (
static_cast<size_t>(
aStart.
Row()) << 16) ^
782 static_cast<size_t>(
aEnd.
Row());
837 bRelCol(false), bRelRow(false), bRelTab(false)
840 aAdr(nCol, nRow, nTab),
841 bRelCol(false), bRelRow(false), bRelTab(false)
844 aAdr(rRef.aAdr), bRelCol(rRef.bRelCol), bRelRow(rRef.bRelRow),
845 bRelTab(rRef.bRelTab)
865 bRelCol = bNewRelCol;
869 bRelRow = bNewRelRow;
873 bRelTab = bNewRelTab;
877 bool bNewRelCol,
bool bNewRelRow,
bool bNewRelTab );
879 bool bNewRelCol,
bool bNewRelRow,
bool bNewRelTab );
915 bool bNewRelCol,
bool bNewRelRow,
bool bNewRelTab )
924 bool bNewRelCol,
bool bNewRelRow,
bool bNewRelTab )
926 aAdr.
Set( nNewCol, nNewRow, nNewTab);
944#define BCA_BRDCST_ALWAYS ScAddress( 0, SCROW_MAX, 0 )
945#define BCA_LISTEN_ALWAYS ScRange( BCA_BRDCST_ALWAYS, BCA_BRDCST_ALWAYS )
963 OUStringBuffer
aBuf(4);
970 OUStringBuffer
aBuf(4);
972 return aBuf.makeStringAndClear();
bool ValidColRow(SCCOL nCol, SCROW nRow, SCCOL nMaxCol, SCROW nMaxRow)
bool ValidTab(SCTAB nTab)
SCROW SanitizeRow(SCROW nRow, SCROW nMaxRow)
bool ConvertDoubleRef(const ScDocument &rDocument, const OUString &rRefString, SCTAB nDefTab, ScRefAddress &rStartRefAddress, ScRefAddress &rEndRefAddress, const ScAddress::Details &rDetails, ScAddress::ExternalInfo *pExtInfo=nullptr)
const SCROW SCROW_REPEAT_NONE
const SCCOL SCCOL_REPEAT_NONE
constexpr OUStringLiteral MAXCOL_JUMBO_STRING(u"XFD")
bool ValidAddress(const ScAddress &rAddress, SCCOL nMaxCol, SCROW nMaxRow)
const SCTAB MAXTABCOUNT
limiting to 10000 for now, problem with 32 bit builds for now
bool ValidRange(const ScRange &rRange, SCCOL nMaxCol, SCROW nMaxRow)
constexpr OUStringLiteral MAXROW_JUMBO_STRING(u"16777215")
constexpr OUStringLiteral MAXCOL_STRING(u"XFD")
SC_DLLPUBLIC void ScColToAlpha(OUStringBuffer &rBuffer, SCCOL nCol)
append alpha representation of column to buffer
const SCCOL MAXCOLCOUNT_JUMBO
void applyStartToEndFlags(ScRefFlags &target, const ScRefFlags source)
const SCCOL INITIALCOLCOUNT
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, const ScAddress &rAddress)
const SCCOL SC_TABSTART_NONE
const SCTAB SC_TAB_APPEND
constexpr OUStringLiteral MAXROW_STRING(u"1048575")
SCCOL SanitizeCol(SCCOL nCol, SCCOL nMaxCol)
const SCROW MAXROWCOUNT_JUMBO
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
bool ValidColRowTab(SCCOL nCol, SCROW nRow, SCTAB nTab, SCCOL nMaxCol, SCROW nMaxRow)
SCTAB SanitizeTab(SCTAB nTab)
const SCCOLROW SCCOLROW_MAX
bool ConvertSingleRef(const ScDocument &pDocument, const OUString &rRefString, SCTAB nDefTab, ScRefAddress &rRefAddress, const ScAddress::Details &rDetails, ScAddress::ExternalInfo *pExtInfo=nullptr)
bool ValidRow(SCROW nRow, SCROW nMaxRow)
bool AlphaToCol(const ScDocument &rDoc, SCCOL &rCol, std::u16string_view rStr)
get column number of A..IV... string
bool ValidCol(SCCOL nCol, SCCOL nMaxCol)
void PutInOrder(T &nStart, T &nEnd)
bool operator<=(const BigInt &rVal1, const BigInt &rVal2)
void IncTab(SCTAB nDelta=1)
ScAddress & operator=(const ScAddress &rAddress)
void Set(SCCOL nCol, SCROW nRow, SCTAB nTab)
bool operator<(const ScAddress &rAddress) const
Less than ordered by tab,col,row.
bool operator<=(const ScAddress &rAddress) const
void PutInOrder(ScAddress &rAddress)
void GetVars(SCCOL &nColP, SCROW &nRowP, SCTAB &nTabP) const
void IncCol(SCCOL nDelta=1)
static SC_DLLPUBLIC const Details detailsOOOa1
ScAddress(SCCOL nColP, SCROW nRowP, SCTAB nTabP)
bool operator!=(const ScAddress &rAddress) const
ScAddress(const ScAddress &rAddress)
bool operator==(const ScAddress &rAddress) const
void IncRow(SCROW nDelta=1)
bool lessThanByRow(const ScAddress &rAddress) const
Less than ordered by tab,row,col as needed by row-wise import/export.
ScAddress(InitializeInvalid)
ScAddress(Uninitialized)
coverity[uninit_member] - Yes, it is what it seems to be: Uninitialized.
ScRangePair & operator=(const ScRangePair &rRange)
const ScRange & GetRange(sal_uInt16 n) const
ScRangePair(const ScRange &rRange1, const ScRange &rRange2)
ScRangePair(const ScRangePair &r)
ScRange & GetRange(sal_uInt16 n)
std::array< ScRange, 2 > aRange
bool operator==(const ScRange &rRange) const
ScRange(const ScRange &rRange)
void GetVars(SCCOL &nCol1, SCROW &nRow1, SCTAB &nTab1, SCCOL &nCol2, SCROW &nRow2, SCTAB &nTab2) const
ScRange(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
ScRange(ScAddress::Uninitialized eUninitialized)
bool operator<=(const ScRange &rRange) const
bool Intersects(const ScRange &rRange) const
bool operator!=(const ScRange &rRange) const
bool Contains(const ScAddress &) const
is Address& fully in Range?
ScRange(const ScAddress &aInputStart, const ScAddress &aInputEnd)
ScRange & operator=(const ScAddress &rPos)
ScRange(ScAddress::InitializeInvalid eInvalid)
bool operator<(const ScRange &rRange) const
Sort on upper left corner tab,col,row, if equal then use lower right too.
ScRange & operator=(const ScRange &rRange)
size_t hashStartColumn() const
Hash start column and start and end rows.
ScRange(const ScAddress &rRange)
ScRange(SCCOL nCol, SCROW nRow, SCTAB nTab)
size_t hashArea() const
Hash 2D area ignoring table number.
ScRefAddress(SCCOL nCol, SCROW nRow, SCTAB nTab)
const ScAddress & GetAddress() const
void SetRelTab(bool bNewRelTab)
void Set(const ScAddress &rAdr, bool bNewRelCol, bool bNewRelRow, bool bNewRelTab)
void SetRelCol(bool bNewRelCol)
ScRefAddress(const ScRefAddress &rRef)
ScRefAddress & operator=(const ScRefAddress &)
bool operator==(const ScRefAddress &r) const
void SetRelRow(bool bNewRelRow)
Reference< XOutputStream > stream
bool operator<(const ScDPCollection::DBType &left, const ScDPCollection::DBType &right)
constexpr std::underlying_type_t< T > to_underlying(T e)
size_t operator()(const ScAddress &rAddress) const
Details(formula::FormulaGrammar::AddressConvention eConvP, ScAddress const &rAddr)
Details(formula::FormulaGrammar::AddressConvention eConvP, SCROW nRowP, SCCOL nColP)
formula::FormulaGrammar::AddressConvention eConv
Details(formula::FormulaGrammar::AddressConvention eConvP)
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)