diff options
author | Frank Schönheit <fs@openoffice.org> | 2001-10-15 09:27:12 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2001-10-15 09:27:12 +0000 |
commit | c0c7d730ec42c72c9701b822e9470765915a2982 (patch) | |
tree | 308e3532cc32641ca0eac365176e60a5366f0b2a /svx/source/form/fmpage.cxx | |
parent | 9d6f1b2cf8dcdfc0018373c78faf191fc62ed3c8 (diff) |
#93100# ReadData: recognize corrupted files where block previously written by the impl class is empty
Diffstat (limited to 'svx/source/form/fmpage.cxx')
-rw-r--r-- | svx/source/form/fmpage.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index 5b6ea6ab5827..0b30f9868ccd 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmpage.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2000-12-18 13:11:04 $ + * last change: $Author: fs $ $Date: 2001-10-15 10:27:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -222,6 +222,8 @@ void FmFormPage::WriteData(SvStream& rOut) const SdrDownCompat aCompat(rOut, STREAM_WRITE); // Fuer Abwaertskompatibilitaet (Lesen neuer Daten mit altem Code) pImpl->WriteData(rOut); } +#else + DBG_ERROR( "FmFormPage::WriteData: not to be called in SVX_LIGHT version!" ); #endif } @@ -246,7 +248,12 @@ void FmFormPage::ReadData(const SdrIOHeader& rHead, SvStream& rIn) { SdrDownCompat aCompat(rIn, STREAM_READ); // Fuer Abwaertskompatibilitaet (Lesen neuer Daten mit altem Code) #ifndef SVX_LIGHT - pImpl->ReadData(rHead, rIn); + DBG_ASSERT( aCompat.GetBytesLeft(), "FmFormPage::ReadData: invalid file format!" ); + if ( aCompat.GetBytesLeft() ) + pImpl->ReadData(rHead, rIn); + // some old (corrupted) versions between 511 and 554 wrote an empty block here - and some of these documents + // are still out there + // So we allow for such an empty block ... #endif } } |