diff options
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/tool/refdata.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx index 3d49fa861bcf..a8048386d00d 100644 --- a/sc/source/core/tool/refdata.cxx +++ b/sc/source/core/tool/refdata.cxx @@ -75,6 +75,20 @@ bool ScSingleRefData::IsDeleted() const return IsColDeleted() || IsRowDeleted() || IsTabDeleted(); } +bool ScSingleRefData::Valid() const +{ + return nCol >= 0 && nCol <= MAXCOL && + nRow >= 0 && nRow <= MAXROW && + nTab >= 0 && nTab <= MAXTAB; +} + +bool ScSingleRefData::ValidExternal() const +{ + return nCol >= 0 && nCol <= MAXCOL && + nRow >= 0 && nRow <= MAXROW && + nTab == -1; +} + ScAddress ScSingleRefData::toAbs( const ScAddress& rPos ) const { SCCOL nRetCol = Flags.bColRel ? nRelCol + rPos.Col() : nCol; @@ -292,6 +306,24 @@ ScComplexRefData& ScComplexRefData::Extend( const ScComplexRefData & rRef, const return Extend( rRef.Ref1, rPos).Extend( rRef.Ref2, rPos); } +bool ScComplexRefData::IsDeleted() const +{ + return Ref1.IsDeleted() || Ref2.IsDeleted(); +} + +bool ScComplexRefData::Valid() const +{ + return Ref1.Valid() && Ref2.Valid(); +} + +bool ScComplexRefData::ValidExternal() const +{ + return Ref1.ValidExternal() && + Ref2.nCol >= 0 && Ref2.nCol <= MAXCOL && + Ref2.nRow >= 0 && Ref2.nRow <= MAXROW && + Ref2.nTab >= Ref1.nTab; +} + ScRange ScComplexRefData::toAbs( const ScAddress& rPos ) const { return ScRange(Ref1.toAbs(rPos), Ref2.toAbs(rPos)); |