diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-05-15 06:54:25 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-05-15 06:54:25 +0000 |
commit | 9d00202aec0a3c0e8e32721667002264d149b8fb (patch) | |
tree | 3f6fc054a526c3c23a7f80f2e49bbbe58430e26a /sc/inc/address.hxx | |
parent | d6a62387171da1546667a8b0f4750de5a98aef8c (diff) |
INTEGRATION: CWS chart26_DEV300 (1.14.20); FILE MERGED
2008/04/16 19:52:20 er 1.14.20.1: #i87128# sanitize view settings positions when loading documents that exceed max cols/rows
Diffstat (limited to 'sc/inc/address.hxx')
-rw-r--r-- | sc/inc/address.hxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 74e1f373cea7..3f6901b2bc37 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: address.hxx,v $ - * $Revision: 1.17 $ + * $Revision: 1.18 $ * * This file is part of OpenOffice.org. * @@ -178,6 +178,26 @@ inline bool ValidColRowTab( SCCOL nCol, SCROW nRow, SCTAB nTab ) return ValidCol( nCol) && ValidRow( nRow) && ValidTab( nTab); } +inline SCCOL SanitizeCol( SCCOL nCol ) +{ + return nCol < 0 ? 0 : (nCol > MAXCOL ? MAXCOL : nCol); +} + +inline SCROW SanitizeRow( SCROW nRow ) +{ + return nRow < 0 ? 0 : (nRow > MAXROW ? MAXROW : nRow); +} + +inline SCTAB SanitizeTab( SCTAB nTab ) +{ + return nTab < 0 ? 0 : (nTab > MAXTAB ? MAXTAB : nTab); +} + +inline SCTAB SanitizeTab( SCTAB nTab, SCTAB nMaxTab ) +{ + return nTab < 0 ? 0 : (nTab > nMaxTab ? nMaxTab : nTab); +} + // === ScAddress ============================================================= // The old cell address is combined in one UINT32: |