diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-06 14:19:22 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-06 14:19:22 +0000 |
commit | 1c8554a5b72748e8d64c65f8d385b836ee063271 (patch) | |
tree | 5da461cb4aa98fdb2cedf5e4e56f24ddf468cc9c /sc/inc/refdata.hxx | |
parent | 91c63d0827f57abe54dae56c9bd0aeca5b4f0df8 (diff) |
INTEGRATION: CWS odff (1.5.526); FILE MERGED
2008/02/07 13:10:01 er 1.5.526.3: Always wanted to do this, now I'm taking the opportunity: :retab on selected files and all tabs are gone, producing hopefully easier to read diffs in future.
2007/12/17 15:59:33 er 1.5.526.2: #i32341# union / range list operator ocUnion; first wave
2007/11/29 19:06:45 er 1.5.526.1: #i4904# range operator ocRange
Diffstat (limited to 'sc/inc/refdata.hxx')
-rw-r--r-- | sc/inc/refdata.hxx | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/sc/inc/refdata.hxx b/sc/inc/refdata.hxx index 9626cd305e79..8ee5ad4bfb14 100644 --- a/sc/inc/refdata.hxx +++ b/sc/inc/refdata.hxx @@ -4,9 +4,9 @@ * * $RCSfile: refdata.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2005-09-08 17:51:21 $ + * last change: $Author: kz $ $Date: 2008-03-06 15:19:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -94,6 +94,7 @@ struct SingleRefData // Single reference (one address) into the sheet inline void InitFlags() { bFlags = 0; } // all FALSE // InitAddress: InitFlags and set address inline void InitAddress( const ScAddress& rAdr ); + inline void InitAddress( SCCOL nCol, SCROW nRow, SCTAB nTab ); // InitAddressRel: InitFlags and set address, everything relative to rPos inline void InitAddressRel( const ScAddress& rAdr, const ScAddress& rPos ); inline void SetColRel( BOOL bVal ) { Flags.bColRel = (bVal ? TRUE : FALSE ); } @@ -127,21 +128,23 @@ struct SingleRefData // Single reference (one address) into the sheet BOOL operator==( const SingleRefData& ) const; }; -inline void SingleRefData::InitAddress( const ScAddress& rAdr ) +inline void SingleRefData::InitAddress( SCCOL nColP, SCROW nRowP, SCTAB nTabP ) { InitFlags(); - nCol = rAdr.Col(); - nRow = rAdr.Row(); - nTab = rAdr.Tab(); + nCol = nColP; + nRow = nRowP; + nTab = nTabP; +} + +inline void SingleRefData::InitAddress( const ScAddress& rAdr ) +{ + InitAddress( rAdr.Col(), rAdr.Row(), rAdr.Tab()); } inline void SingleRefData::InitAddressRel( const ScAddress& rAdr, const ScAddress& rPos ) { - InitFlags(); - nCol = rAdr.Col(); - nRow = rAdr.Row(); - nTab = rAdr.Tab(); + InitAddress( rAdr.Col(), rAdr.Row(), rAdr.Tab()); SetColRel( TRUE ); SetRowRel( TRUE ); SetTabRel( TRUE ); @@ -173,6 +176,12 @@ struct ComplRefData // Complex reference (a range) into the sheet Ref1.InitAddressRel( rRange.aStart, rPos ); Ref2.InitAddressRel( rRange.aEnd, rPos ); } + inline void InitRange( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, + SCCOL nCol2, SCROW nRow2, SCTAB nTab2 ) + { + Ref1.InitAddress( nCol1, nRow1, nTab1 ); + Ref2.InitAddress( nCol2, nRow2, nTab2 ); + } inline void SmartRelAbs( const ScAddress& rPos ) { Ref1.SmartRelAbs( rPos ); Ref2.SmartRelAbs( rPos ); } inline void CalcRelFromAbs( const ScAddress& rPos ) @@ -183,9 +192,15 @@ struct ComplRefData // Complex reference (a range) into the sheet { return Ref1.IsDeleted() || Ref2.IsDeleted(); } inline BOOL Valid() const { return Ref1.Valid() && Ref2.Valid(); } - void PutInOrder(); + /// Absolute references have to be up-to-date when calling this! + void PutInOrder(); inline BOOL operator==( const ComplRefData& r ) const { return Ref1 == r.Ref1 && Ref2 == r.Ref2; } + /** Enlarge range if reference passed is not within existing range. + ScAddress position is used to calculate absolute references from + relative references. */ + ComplRefData& Extend( const SingleRefData & rRef, const ScAddress & rPos ); + ComplRefData& Extend( const ComplRefData & rRef, const ScAddress & rPos ); }; #endif |