20 #ifndef INCLUDED_SC_INC_ADDRESS_HXX
21 #define INCLUDED_SC_INC_ADDRESS_HXX
23 #include <rtl/ustrbuf.hxx>
24 #include <rtl/strbuf.hxx>
39 struct ExternalLinkInfo;
96 return nCol >= 0 && nCol <= nMaxCol;
102 return nRow >= 0 && nRow <= nMaxRow;
107 return nTab >= 0 && nTab <=
MAXTAB;
112 return nTab >= 0 && nTab <= nMaxTab;
130 return nCol < 0 ? 0 : (nCol > nMaxCol ? nMaxCol : nCol);
136 return nRow < 0 ? 0 : (nRow > nMaxRow ? nMaxRow : nRow);
218 eConv(eConvP), nRow(nRowP), nCol(nColP)
221 eConv(eConvP), nRow(rAddr.
Row()), nCol(rAddr.
Col())
224 eConv(eConvP), nRow(0), nCol(0)
238 mnFileId(0), mbExternal(false)
243 nRow(0), nCol(0), nTab(0)
246 nRow(nRowP), nCol(nColP), nTab(nTabP)
253 nRow(-1), nCol(-1), nTab(-1)
256 nRow(rAddress.nRow), nCol(rAddress.nCol), nTab(rAddress.nTab)
295 return (nRow >= 0) && (nCol >= 0) && (nTab >= 0);
302 nRow = sal::static_int_cast<
SCROW>(nRow + nDelta);
306 nCol = sal::static_int_cast<
SCCOL>(nCol + nDelta);
310 nTab = sal::static_int_cast<
SCTAB>(nTab + nDelta);
328 const Details& rDetails = detailsOOOa1,
329 ExternalInfo* pExtInfo =
nullptr,
330 const css::uno::Sequence<css::sheet::ExternalLinkInfo>* pExternalLinks =
nullptr,
331 sal_Int32* pSheetEndPos =
nullptr,
332 const OUString* pErrRef =
nullptr );
336 const Details& rDetails = detailsOOOa1)
const;
340 const Details& rDetails = detailsOOOa1)
const;
356 inline bool lessThanByRow(
const ScAddress& rAddress )
const;
358 inline size_t hash()
const;
369 OUString GetColRowString()
const;
373 template<
typename charT,
typename traits>
374 inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> &
stream,
const ScAddress& rAddress)
377 rAddress.Tab()+1 <<
"!"
378 "R" << rAddress.Row()+1 <<
379 "C" << rAddress.Col()+1;
386 if ( rAddress.
Col() <
Col() )
392 if ( rAddress.
Row() <
Row() )
398 if ( rAddress.
Tab() <
Tab() )
466 #if SAL_TYPES_SIZEOFPOINTER == 8
468 return (static_cast<size_t>(
nTab) << 36) ^
469 (
static_cast<size_t>(
nCol) << 20) ^
470 static_cast<size_t>(
nRow);
475 return (static_cast<size_t>(
nTab) << 24) ^
476 (static_cast<size_t>(
nCol) << 16) ^ static_cast<size_t>(
nRow);
478 return (static_cast<size_t>(
nTab) << 28) ^
479 (static_cast<size_t>(
nCol) << 24) ^ static_cast<size_t>(
nRow);
487 return rAddress.
hash();
508 aStart( eUninitialized ), aEnd( eUninitialized )
511 aStart( eInvalid ), aEnd( eInvalid )
514 aStart( aInputStart ), aEnd( aInputEnd )
519 aStart( rRange.aStart ), aEnd( rRange.aEnd )
522 aStart( rRange ), aEnd( rRange )
525 aStart( nCol, nRow, nTab ), aEnd( aStart )
528 aStart( nCol1, nRow1, nTab1 ), aEnd( nCol2, nRow2, nTab2 )
539 aStart = aEnd = rPos;
557 const css::uno::Sequence<css::sheet::ExternalLinkInfo>* pExternalLinks =
nullptr,
558 const OUString* pErrRef =
nullptr );
591 OUString& rExternDocName, OUString& rStartTabName,
593 bool bOnlyAcceptSingle,
594 const css::uno::Sequence<css::sheet::ExternalLinkInfo>* pExternalLinks =
nullptr,
595 const OUString* pErrRef =
nullptr );
620 bool bFullAddressNotation =
false )
const;
649 inline bool IsEndColSticky()
const;
651 inline bool IsEndRowSticky()
const;
669 inline size_t hashArea()
const;
671 inline size_t hashStartColumn()
const;
675 template<
typename charT,
typename traits>
676 inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> &
stream,
const ScRange& rRange)
679 if (rRange.aEnd != rRange.aStart)
682 if (rRange.aEnd.Tab() != rRange.aStart.Tab())
686 "R" << rRange.aEnd.Row()+1 <<
687 "C" << rRange.aEnd.Col()+1;
751 #if SAL_TYPES_SIZEOFPOINTER == 8
754 (static_cast<size_t>(
aStart.
Row()) << 44) ^
755 (
static_cast<size_t>(
aStart.
Col()) << 32) ^
756 (
static_cast<size_t>(
aEnd.
Col()) << 20) ^
757 static_cast<size_t>(
aEnd.
Row());
767 (static_cast<size_t>(
aStart.
Row()) << 26) ^
768 (
static_cast<size_t>(
aStart.
Col()) << 21) ^
769 (
static_cast<size_t>(
aEnd.
Col()) << 15) ^
770 static_cast<size_t>(
aEnd.
Row());
776 #if SAL_TYPES_SIZEOFPOINTER == 8
779 (static_cast<size_t>(
aStart.
Col()) << 40) ^
780 (
static_cast<size_t>(
aStart.
Row()) << 20) ^
781 static_cast<size_t>(
aEnd.
Row());
787 (static_cast<size_t>(
aStart.
Col()) << 24) ^
788 (
static_cast<size_t>(
aStart.
Row()) << 16) ^
789 static_cast<size_t>(
aEnd.
Row());
844 bRelCol(false), bRelRow(false), bRelTab(false)
847 aAdr(nCol, nRow, nTab),
848 bRelCol(false), bRelRow(false), bRelTab(false)
851 aAdr(rRef.aAdr), bRelCol(rRef.bRelCol), bRelRow(rRef.bRelRow),
852 bRelTab(rRef.bRelTab)
872 bRelCol = bNewRelCol;
876 bRelRow = bNewRelRow;
880 bRelTab = bNewRelTab;
884 bool bNewRelCol,
bool bNewRelRow,
bool bNewRelTab );
886 bool bNewRelCol,
bool bNewRelRow,
bool bNewRelTab );
922 bool bNewRelCol,
bool bNewRelRow,
bool bNewRelTab )
931 bool bNewRelCol,
bool bNewRelRow,
bool bNewRelTab )
933 aAdr.
Set( nNewCol, nNewRow, nNewTab);
951 #define BCA_BRDCST_ALWAYS ScAddress( 0, SCROW_MAX, 0 )
952 #define BCA_LISTEN_ALWAYS ScRange( BCA_BRDCST_ALWAYS, BCA_BRDCST_ALWAYS )
954 template<
typename T >
inline void PutInOrder( T& nStart, T& nEnd )
958 std::swap(nStart, nEnd);
978 OUStringBuffer
aBuf(4);
985 OUStringBuffer
aBuf(4);
987 return aBuf.makeStringAndClear();
993 #endif // INCLUDED_SC_INC_ADDRESS_HXX
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Details(formula::FormulaGrammar::AddressConvention eConvP)
ScAddress(const ScAddress &rAddress)
void Set(const ScAddress &rAdr, bool bNewRelCol, bool bNewRelRow, bool bNewRelTab)
void GetVars(SCCOL &nColP, SCROW &nRowP, SCTAB &nTabP) const
bool operator!=(const ScAddress &rAddress) const
size_t hashArea() const
Hash 2D area ignoring table number.
SC_DLLPUBLIC void ScColToAlpha(OUStringBuffer &rBuffer, SCCOL nCol)
append alpha representation of column to buffer
ScRange(const ScRange &rRange)
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
void IncTab(SCTAB nDelta=1)
const SCCOLROW SCCOLROW_MAX
bool ConvertDoubleRef(const ScDocument &rDocument, const OUString &rRefString, SCTAB nDefTab, ScRefAddress &rStartRefAddress, ScRefAddress &rEndRefAddress, const ScAddress::Details &rDetails, ScAddress::ExternalInfo *pExtInfo=nullptr)
ScRangePair & operator=(const ScRangePair &rRange)
size_t hashStartColumn() const
Hash start column and start and end rows.
void SetRelTab(bool bNewRelTab)
constexpr std::underlying_type_t< T > underlyingEnumValue(T e)
void PutInOrder(ScAddress &rAddress)
ScRange(const ScAddress &rRange)
bool operator<=(const BigInt &rVal1, const BigInt &rVal2)
ScRange(ScAddress::Uninitialized eUninitialized)
bool operator<(const ScRange &rRange) const
Sort on upper left corner tab,col,row, if equal then use lower right too.
bool operator==(const ScRefAddress &r) const
ScRefAddress & operator=(const ScRefAddress &)
exports com.sun.star. sheet
ScAddress(InitializeInvalid)
bool ConvertSingleRef(const ScDocument &pDocument, const OUString &rRefString, SCTAB nDefTab, ScRefAddress &rRefAddress, const ScAddress::Details &rDetails, ScAddress::ExternalInfo *pExtInfo=nullptr)
bool ValidColRowTab(SCCOL nCol, SCROW nRow, SCTAB nTab, SCCOL nMaxCol, SCROW nMaxRow)
formula::FormulaGrammar::AddressConvention eConv
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 ...
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
bool ValidRange(const ScRange &rRange, SCCOL nMaxCol=MAXCOL, SCROW nMaxRow=MAXROW)
static SC_DLLPUBLIC const Details detailsOOOa1
ScAddress & operator=(const ScAddress &rAddress)
SCROW SanitizeRow(SCROW nRow, SCROW nMaxRow)
ScRange(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
ScRange & operator=(const ScRange &rRange)
void PutInOrder(T &nStart, T &nEnd)
ScRefAddress(const ScRefAddress &rRef)
SCCOL SanitizeCol(SCCOL nCol, SCCOL nMaxCol)
ScRange & GetRange(sal_uInt16 n)
bool ValidCol(SCCOL nCol, SCCOL nMaxCol)
ScRange & operator=(const ScAddress &rPos)
bool IsEndColSticky() const
If maximum end column should not be adapted during reference update.
const SCTAB SC_TAB_APPEND
void IncCol(SCCOL nDelta=1)
void Set(SCCOL nCol, SCROW nRow, SCTAB nTab)
Details(formula::FormulaGrammar::AddressConvention eConvP, SCROW nRowP, SCCOL nColP)
bool operator!=(const ScRange &rRange) const
void applyStartToEndFlags(ScRefFlags &target, const ScRefFlags source)
std::array< ScRange, 2 > aRange
bool IsEndRowSticky() const
If maximum end row should not be adapted during reference update.
void IncRow(SCROW nDelta=1)
const ScRange & GetRange(sal_uInt16 n) const
ScRange(SCCOL nCol, SCROW nRow, SCTAB nTab)
bool operator<=(const ScRange &rRange) const
void GetVars(SCCOL &nCol1, SCROW &nRow1, SCTAB &nTab1, SCCOL &nCol2, SCROW &nRow2, SCTAB &nTab2) const
bool AlphaToCol(const ScDocument &rDoc, SCCOL &rCol, const OUString &rStr)
get column number of A..IV... string
ScRangePair(const ScRangePair &r)
bool In(const ScAddress &) const
is Address& in Range?
bool operator<(const ScAddress &rAddress) const
Less than ordered by tab,col,row.
const SCROW SCROW_REPEAT_NONE
ScRange(const ScAddress &aInputStart, const ScAddress &aInputEnd)
ScRange(ScAddress::InitializeInvalid eInvalid)
Details(formula::FormulaGrammar::AddressConvention eConvP, ScAddress const &rAddr)
Reference< XOutputStream > stream
SCTAB SanitizeTab(SCTAB nTab)
bool operator<(const ScDPCollection::DBType &left, const ScDPCollection::DBType &right)
const ScAddress & GetAddress() const
size_t operator()(const ScAddress &rAddress) const
const SCCOL INITIALCOLCOUNT
void SetRelCol(bool bNewRelCol)
ScRefAddress(SCCOL nCol, SCROW nRow, SCTAB nTab)
bool ValidColRow(SCCOL nCol, SCROW nRow, SCCOL nMaxCol, SCROW nMaxRow)
bool ValidRow(SCROW nRow, SCROW nMaxRow)
const SCCOL SC_TABSTART_NONE
ScAddress(Uninitialized)
Yes, it is what it seems to be: Uninitialized.
ScAddress(SCCOL nColP, SCROW nRowP, SCTAB nTabP)
bool lessThanByRow(const ScAddress &rAddress) const
Less than ordered by tab,row,col as needed by row-wise import/export.
const SCTAB MAXTABCOUNT
limiting to 10000 for now, problem with 32 bit builds for now
ScRangePair(const ScRange &rRange1, const ScRange &rRange2)
bool ValidTab(SCTAB nTab)
const SCCOL SCCOL_REPEAT_NONE
bool operator==(const ScAddress &rAddress) const
bool operator<=(const ScAddress &rAddress) const
void SetRelRow(bool bNewRelRow)
bool ValidAddress(const ScAddress &rAddress, SCCOL nMaxCol=MAXCOL, SCROW nMaxRow=MAXROW)
bool operator==(const ScRange &rRange) const