diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2007-07-06 11:49:50 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2007-07-06 11:49:50 +0000 |
commit | 4c4535bff8195e6a06aeea091c36e5f8b647135c (patch) | |
tree | 3217b7edd134556cbf4ee62676355832fdc91f08 /sot | |
parent | e445140af64f3876beef70a75c5eb20faeb116dc (diff) |
INTEGRATION: CWS dr55 (1.10.36); FILE MERGED
2007/06/20 12:37:55 dr 1.10.36.1: #i73846# accept access to first page behind end of file
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stgcache.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index 79451250bf0e..50d21ee39a69 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -4,9 +4,9 @@ * * $RCSfile: stgcache.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: obo $ $Date: 2006-09-17 16:09:21 $ + * last change: $Author: rt $ $Date: 2007-07-06 12:49:50 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -436,9 +436,13 @@ BOOL StgCache::Read( INT32 nPage, void* pBuf, INT32 nPg ) { if( Good() ) { - if ( nPage >= nPages ) + /* #i73846# real life: a storage may refer to a page one-behind the + last valid page (see document attached to the issue). In that case + (if nPage==nPages), just do nothing here and let the caller work on + the empty zero-filled buffer. */ + if ( nPage > nPages ) SetError( SVSTREAM_READ_ERROR ); - else + else if ( nPage < nPages ) { ULONG nPos = Page2Pos( nPage ); INT32 nPg2 = ( ( nPage + nPg ) > nPages ) ? nPages - nPage : nPg; |