diff options
author | Peter Burow <pb@openoffice.org> | 2001-09-28 11:33:45 +0000 |
---|---|---|
committer | Peter Burow <pb@openoffice.org> | 2001-09-28 11:33:45 +0000 |
commit | 53bc3c6a3eb79ff6070453295015880b2cc38efe (patch) | |
tree | 6b31b02b1ed7b546a921ce336e67c646f9097b24 /sot/source | |
parent | ed2675a20a439a119c1b55ab1ca059cdf556af08 (diff) |
fix: #91670# read filelist from stream fixed
Diffstat (limited to 'sot/source')
-rw-r--r-- | sot/source/base/filelist.cxx | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx index 608a8ae1164e..3c1d88c5caad 100644 --- a/sot/source/base/filelist.cxx +++ b/sot/source/base/filelist.cxx @@ -2,9 +2,9 @@ * * $RCSfile: filelist.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jp $ $Date: 2001-09-06 13:47:09 $ + * last change: $Author: pb $ $Date: 2001-09-28 12:33:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -244,26 +244,29 @@ SvStream& operator>>( SvStream& rIStm, FileList& rFileList ) // Unicode ? if( aSv_DROPFILES.fWide ) { - // no, only ANSI + // yes, Unicode String aStr; sal_uInt16 c; - // 1. Zeichen lesen - rIStm >> c; - do { + while( !rIStm.IsEof() ) + { aStr.Erase(); - // String bis '\0' lesen + // read first character of filepath; c==0 > reach end of stream + rIStm >> c; + if ( !c ) + break; + + // read string till c==0 while( c && !rIStm.IsEof() ) { aStr += (sal_Unicode)c; rIStm >> c; } - // String in die Liste stopfen + // append the filepath rFileList.AppendFile( aStr ); } - while( c && !rIStm.IsEof() ); // c == 0 && cLast == 0 -> Ende } else { @@ -271,27 +274,30 @@ SvStream& operator>>( SvStream& rIStm, FileList& rFileList ) ByteString aStr; sal_Char c; - // 1. Zeichen lesen - rIStm >> c; - do { + while( !rIStm.IsEof() ) + { aStr.Erase(); - // String bis '\0' lesen + // read first character of filepath; c==0 > reach end of stream + rIStm >> c; + if ( !c ) + break; + + // read string till c==0 while( c && !rIStm.IsEof() ) { aStr += c; rIStm >> c; } - // String in die Liste stopfen - rFileList.AppendFile( String(aStr, RTL_TEXTENCODING_ASCII_US)); + // append the filepath + rFileList.AppendFile( String( aStr, RTL_TEXTENCODING_ASCII_US ) ); } - while( c && !rIStm.IsEof() ); // c == 0 && cLast == 0 -> Ende } + return rIStm; } - /****************************************************************************** |* |* Liste fuellen/abfragen @@ -316,5 +322,3 @@ ULONG FileList::Count( void ) const return pStrList->Count(); } - - |